1 3 package org.jgroups.protocols; 4 5 6 import org.jgroups.Address; 7 import org.jgroups.Event; 8 import org.jgroups.stack.Protocol; 9 10 11 17 public class DUMMY_TP extends Protocol { 18 private Address local_addr=null; 19 20 public DUMMY_TP() { 21 } 22 23 24 public String toString() { 25 return "Protocol DUMMY_TP (local address: " + local_addr + ')'; 26 } 27 28 29 30 31 public String getName() { 32 return "DUMMY_TP"; 33 } 34 35 36 37 38 public void init() throws Exception { 39 local_addr=new org.jgroups.stack.IpAddress("localhost", 10000); } 41 42 public void start() throws Exception { 43 passUp(new Event(Event.SET_LOCAL_ADDRESS, local_addr)); 44 } 45 46 47 53 public void down(Event evt) { 54 55 switch(evt.getType()) { 56 57 case Event.CONNECT: 58 passUp(new Event(Event.CONNECT_OK)); 59 break; 60 61 case Event.DISCONNECT: 62 passUp(new Event(Event.DISCONNECT_OK)); 63 break; 64 } 65 } 66 67 68 69 70 71 72 73 74 } 75 | Popular Tags |