clienttest.java

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

JAVA
47
字号
package net.sf.dz.test.pnp;import org.freehold.jukebox.logger.LogChannel;import org.freehold.jukebox.service.PassiveService;import net.sf.dz.pnp.MulticastClient;import net.sf.dz.pnp.MulticastEvent;import net.sf.dz.pnp.MulticastEventListener;/** * Test case for {@link MulticastClient MulticastClient}. * * @author Copyright &copy; <a href="mailto:vt@freehold.crocodile.org">Vadim Tkachenko</a> 2004 * @version $Id: ClientTest.java,v 1.2 2004/06/28 20:35:49 vtt Exp $ */abstract public class ClientTest extends PassiveService implements MulticastEventListener {    public static final LogChannel CH_CT = new LogChannel("ClientTest");    private MulticastClient client;        protected final void startup() throws Throwable {            client = createClient();                client.setLogger(getLogger());                if ( !client.start().waitFor() ) {                    throw new IllegalStateException("Can't start the client");        }                client.addListener(this);    }        protected final void shutdown(Throwable cause) throws Throwable {            client.stop().waitFor();    }        abstract protected MulticastClient createClient() throws Throwable;        public void multicastEventReceived(MulticastClient source, MulticastEvent message) {            complain(LOG_NOTICE, CH_CT, "Announce from " + source + ": " + message);    }}

⌨️ 快捷键说明

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