⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clienttest.java

📁 这是一个以JAVA编写的程序,本人还没有试过,是一个简单的温度控制系统
💻 JAVA
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -