servertest.java

来自「这是一个以JAVA编写的程序,本人还没有试过,是一个简单的温度控制系统」· Java 代码 · 共 37 行

JAVA
37
字号
package net.sf.dz.test.pnp;import org.freehold.jukebox.service.PassiveService;import net.sf.dz.pnp.MulticastServer;/** * Test case for {@link MulticastServer MulticastServer}. * * @author Copyright &copy; <a href="mailto:vt@freehold.crocodile.org">Vadim Tkachenko</a> 2004 * @version $Id: ServerTest.java,v 1.2 2004/06/28 20:35:49 vtt Exp $ */abstract public class ServerTest extends PassiveService {    private MulticastServer server;        protected final void startup() throws Throwable {            server = createServer();                server.setLogger(getLogger());                if ( !server.start().waitFor() ) {                    throw new IllegalStateException("Can't start the server");        }                server.announce("Hi there!");    }        protected final void shutdown(Throwable cause) throws Throwable {            server.stop().waitFor();    }        abstract protected MulticastServer createServer() throws Throwable;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?