MCPcopy Create free account
hub / github.com/belaban/JGroups / replaceProtocol

Method replaceProtocol

src/org/jgroups/stack/ProtocolStack.java:748–766  ·  view source on GitHub ↗

Replaces one protocol instance with another. Should be done before the stack is connected @param existing_prot @param new_prot

(Protocol existing_prot, Protocol new_prot)

Source from the content-addressed store, hash-verified

746 * @param new_prot
747 */
748 public void replaceProtocol(Protocol existing_prot, Protocol new_prot) throws Exception {
749 Protocol up_neighbor=existing_prot.getUpProtocol(), down_neighbor=existing_prot.getDownProtocol();
750
751 new_prot.setUpProtocol(existing_prot.getUpProtocol());
752 new_prot.setDownProtocol(existing_prot.getDownProtocol());
753 up_neighbor.setDownProtocol(new_prot);
754 if(down_neighbor != null)
755 down_neighbor.setUpProtocol(new_prot);
756
757 existing_prot.setDownProtocol(null);
758 existing_prot.setUpProtocol(null);
759 existing_prot.stop();
760 existing_prot.destroy();
761
762 if(new_prot.getUpProtocol() == this)
763 top_prot=new_prot;
764 callAfterCreationHook(new_prot, afterCreationHook());
765 new_prot.init();
766 }
767
768
769

Calls 9

setUpProtocolMethod · 0.95
setDownProtocolMethod · 0.95
callAfterCreationHookMethod · 0.95
getUpProtocolMethod · 0.80
getDownProtocolMethod · 0.80
afterCreationHookMethod · 0.80
stopMethod · 0.65
destroyMethod · 0.65
initMethod · 0.65