/** * Creates a new FORK protocol, or returns the existing one, or throws an exception. Never returns null. */ protected static FORK getFORK(JChannel ch, ProtocolStack.Position position, Class<? extends Protocol> neighbor, boolean create_fork_if_absent) throws Exception { ProtocolStack stack=ch.getProtocolStack(); FORK fork=stack.findProtocol(FORK.class); if(fork == null) { if(!create_fork_if_absent) throw new IllegalArgumentException("FORK not found in main stack"); fork = new FORK(); fork.setProtocolStack(stack); stack.insertProtocol(fork, position, neighbor); } return fork; }
@Override public JChannel createChannel(String id) throws Exception { FORK fork = new FORK(); fork.enableStats(this.configuration.isStatisticsEnabled()); fork.setUnknownForkHandler(new UnknownForkHandler() {
/** * Creates a new FORK protocol, or returns the existing one, or throws an exception. Never returns null. */ protected static FORK getFORK(JChannel ch, ProtocolStack.Position position, Class<? extends Protocol> neighbor, boolean create_fork_if_absent) throws Exception { ProtocolStack stack=ch.getProtocolStack(); FORK fork=stack.findProtocol(FORK.class); if(fork == null) { if(!create_fork_if_absent) throw new IllegalArgumentException("FORK not found in main stack"); fork = new FORK(); fork.setProtocolStack(stack); stack.insertProtocol(fork, position, neighbor); } return fork; }
@Override public JChannel createChannel(String id) throws Exception { FORK fork = new FORK(); fork.enableStats(this.configuration.isStatisticsEnabled()); fork.setUnknownForkHandler(new UnknownForkHandler() {
if (!alreadyHasForkProtocol) { FORK fork = new FORK(); fork.setProtocolStack(stack); stack.insertProtocol(fork, ProtocolStack.ABOVE, topProtocol.getClass());
if (!alreadyHasForkProtocol) { FORK fork = new FORK(); fork.setProtocolStack(stack); stack.insertProtocol(fork, ProtocolStack.ABOVE, topProtocol.getClass());
FORK fork = new FORK(); fork.setUnknownForkHandler(unknownForkHandler); stack.addProtocol(fork);
gcb.transport().distributedSyncTimeout(30, TimeUnit.SECONDS); FORK fork = new FORK(); fork.setUnknownForkHandler(new UnknownForkHandler() { @Override