Adds a protocol at the tail of the protocol list @since 2.11
(Protocol prot)
| 459 | * @since 2.11 |
| 460 | */ |
| 461 | public ProtocolStack addProtocol(Protocol prot) { |
| 462 | if(prot == null) |
| 463 | return this; |
| 464 | prot.setProtocolStack(this); |
| 465 | prot.setUpProtocol(this); |
| 466 | if(bottom_prot == null) { |
| 467 | top_prot=bottom_prot=prot; |
| 468 | return this; |
| 469 | } |
| 470 | |
| 471 | prot.setDownProtocol(top_prot); |
| 472 | prot.getDownProtocol().setUpProtocol(prot); |
| 473 | top_prot=prot; |
| 474 | return this; |
| 475 | } |
| 476 | |
| 477 | /** |
| 478 | * Adds a list of protocols |