public ProtocolStack removeProtocols(String ... protocols) { for(String protocol: protocols) removeProtocol(protocol); return this; }
@SafeVarargs public final <T extends Protocol> T removeProtocol(Class<? extends Protocol>... protocols) { for(Class<? extends Protocol> cl: protocols) { T tmp=removeProtocol(cl); if(tmp != null) return tmp; } return null; }
/** * Removes a protocol from the stack. Stops the protocol and readjusts the linked lists of protocols. * @param prot_name The name of the protocol. Since all protocol names in a stack have to be unique * (otherwise the stack won't be created), the name refers to just 1 protocol. * @exception Exception Thrown if the protocol cannot be stopped correctly. */ public <T extends Protocol> T removeProtocol(String prot_name) { if(prot_name == null) return null; return removeProtocol((T)findProtocol(prot_name)); }
public <T extends Protocol> T removeProtocol(Class<? extends Protocol> prot) { if(prot == null) return null; return removeProtocol((T)findProtocol(prot)); }
@Override public JChannel createChannel() throws Exception { JChannel channel = remoteSite.getChannelFactory().createChannel(siteName); // Don't use FORK in bridge stack channel.getProtocolStack().removeProtocol(FORK.class); return channel; } };
for(Protocol prot_to_remove: protocols) { try { Protocol removed=removeProtocol(prot_to_remove); if(removed != null) log.debug("removed protocol %s from stack", prot_to_remove.getName());
public ProtocolStack removeProtocols(String ... protocols) { for(String protocol: protocols) removeProtocol(protocol); return this; }
@SafeVarargs public final <T extends Protocol> T removeProtocol(Class<? extends Protocol>... protocols) { for(Class<? extends Protocol> cl: protocols) { T tmp=removeProtocol(cl); if(tmp != null) return tmp; } return null; }
/** * Removes a protocol from the stack. Stops the protocol and readjusts the linked lists of protocols. * @param prot_name The name of the protocol. Since all protocol names in a stack have to be unique * (otherwise the stack won't be created), the name refers to just 1 protocol. * @exception Exception Thrown if the protocol cannot be stopped correctly. */ public <T extends Protocol> T removeProtocol(String prot_name) { if(prot_name == null) return null; return removeProtocol((T)findProtocol(prot_name)); }
public <T extends Protocol> T removeProtocol(Class<? extends Protocol> prot) { if(prot == null) return null; return removeProtocol((T)findProtocol(prot)); }
@Override public JChannel createChannel() throws Exception { JChannel channel = remoteSite.getChannel(); // Don't use FORK in bridge stack channel.getProtocolStack().removeProtocol(FORK.class); return channel; } };
@Override public JChannel createChannel() throws Exception { JChannel channel = remoteSite.getChannelFactory().createChannel(siteName); // Don't use FORK in bridge stack channel.getProtocolStack().removeProtocol(FORK.class); return channel; } };
@Override public synchronized boolean shutdown() { if (super.shutdown()) { String mainChannelName = mainChannel.getName(); List<String> forksForChannel = FORK_STACKS_BY_CHANNEL_NAME.get(mainChannelName); if (forksForChannel != null) { forksForChannel.remove(clusterName); if (forksForChannel.isEmpty()) { FORK_STACKS_BY_CHANNEL_NAME.remove(mainChannelName); Protocol removed = this.mainChannel.getProtocolStack().removeProtocol(FORK.class); if (removed != null) { LOGGER.debug("FORK protocol removed from original channel stack for channel {0}", mainChannelName); } else { LOGGER.debug("FORK protocol not found in original channel stack for channel {0}", mainChannelName); } } } return true; } return false; } }
@Override public synchronized boolean shutdown() { if (super.shutdown()) { String mainChannelName = mainChannel.getName(); List<String> forksForChannel = FORK_STACKS_BY_CHANNEL_NAME.get(mainChannelName); if (forksForChannel != null) { forksForChannel.remove(clusterName); if (forksForChannel.isEmpty()) { FORK_STACKS_BY_CHANNEL_NAME.remove(mainChannelName); Protocol removed = this.mainChannel.getProtocolStack().removeProtocol(FORK.class); if (removed != null) { LOGGER.debug("FORK protocol removed from original channel stack for channel {0}", mainChannelName); } else { LOGGER.debug("FORK protocol not found in original channel stack for channel {0}", mainChannelName); } } } return true; } return false; } }
for(Protocol prot_to_remove: protocols) { try { Protocol removed=removeProtocol(prot_to_remove); if(removed != null) log.debug("removed protocol %s from stack", prot_to_remove.getName());