import org.jgroups.JChannel; import org.jgroups.Message; import org.jgroups.ReceiverAdapter; public class JGroupsMulticastExample extends ReceiverAdapter { private JChannel channel; public void start() throws Exception { } @Override public void receive(Message msg) { System.out.println("Received message: " + msg.getObject()); } public void sendMessage(Object obj) throws Exception { } private void eventLoop() throws Exception { while (true) { if (input.equalsIgnoreCase("quit")) { break; } } } public static void main(String[] args) throws Exception { JGroupsMulticastExample example = new JGroupsMulticastExample(); example.start(); } }


上一篇:
下一篇:
切换中文