1 3 package org.jgroups.protocols; 4 5 import org.jgroups.Event; 6 import org.jgroups.Message; 7 import org.jgroups.View; 8 import org.jgroups.stack.Protocol; 9 10 import java.util.Vector ; 11 12 13 16 17 public class DUMMY extends Protocol { 18 final Vector members=new Vector (); 19 final String name="DUMMY"; 20 21 22 public String getName() {return "DUMMY";} 23 24 25 26 27 public void reset() {} 28 29 30 31 32 public void up(Event evt) { 33 Message msg; 34 35 switch(evt.getType()) { 36 37 case Event.MSG: 38 msg=(Message)evt.getArg(); 39 break; 42 } 43 44 passUp(evt); } 46 47 48 49 50 51 public void down(Event evt) { 52 Message msg; 53 54 switch(evt.getType()) { 55 case Event.TMP_VIEW: 56 case Event.VIEW_CHANGE: 57 Vector new_members=((View)evt.getArg()).getMembers(); 58 synchronized(members) { 59 members.removeAllElements(); 60 if(new_members != null && new_members.size() > 0) 61 for(int i=0; i < new_members.size(); i++) 62 members.addElement(new_members.elementAt(i)); 63 } 64 passDown(evt); 65 break; 66 67 case Event.MSG: 68 msg=(Message)evt.getArg(); 69 break; 70 } 71 72 passDown(evt); } 74 75 76 77 } 78 | Popular Tags |