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

Method insertProtocol

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

Inserts an already created (and initialized) protocol into the protocol list. Sets the links to the protocols above and below correctly and adjusts the linked list of protocols accordingly. Note that this method may change the value of top_prot or bottom_prot. @param prot The protocol to be inserted

(Protocol prot, Position position, String neighbor_prot)

Source from the content-addressed store, hash-verified

513 * @exception Exception Will be thrown when the new protocol cannot be created, or inserted.
514 */
515 public void insertProtocol(Protocol prot, Position position, String neighbor_prot) throws Exception {
516 if(neighbor_prot == null) throw new IllegalArgumentException("neighbor_prot is null");
517 Protocol neighbor=findProtocol(neighbor_prot);
518 if(neighbor == null)
519 throw new IllegalArgumentException("protocol " + neighbor_prot + " not found in " + printProtocolSpec(false));
520
521 if(position == Position.BELOW && neighbor instanceof TP)
522 throw new IllegalArgumentException("Cannot insert protocol " + prot.getName() + " below transport protocol");
523
524 insertProtocolInStack(prot, neighbor, position);
525 }
526
527
528 public void insertProtocolInStack(Protocol prot, Protocol neighbor, Position position) {

Calls 5

findProtocolMethod · 0.95
printProtocolSpecMethod · 0.95
insertProtocolInStackMethod · 0.95
getNameMethod · 0.65
toStringMethod · 0.65