1 3 4 package org.jgroups.tests; 5 6 7 import org.jgroups.*; 8 import org.jgroups.util.Util; 9 10 11 12 18 public class UpHandlerTest implements UpHandler { 19 Channel channel; 20 21 public void start() throws Exception { 22 channel=new JChannel(); 23 channel.setUpHandler(this); 24 channel.connect("UpHandlerTestGroup"); 25 26 channel.send(new Message(null, null, "Hello".getBytes())); 27 Util.sleep(2000); 28 channel.close(); 29 } 30 31 32 public void up(Event evt) { 33 System.out.println(evt); 34 } 35 36 37 public static void main(String [] args) { 38 try { 39 new UpHandlerTest().start(); 40 } 41 catch(Exception e) { 42 System.err.println(e); 43 } 44 } 45 } 46 | Popular Tags |