/** Creates a fork-stack from the configuration, initializes all protocols (setting values), * sets the protocol stack as top protocol, connects the protocols and calls init() on them. Returns * the protocols in a list, from bottom to top */ protected static List<Protocol> createProtocols(ProtocolStack stack, List<ProtocolConfiguration> protocol_configs) throws Exception { return Configurator.createProtocols(protocol_configs,stack); }
List<Protocol> protocols=createProtocols(protocol_configs, st); if(protocols == null) return null;
/** Creates a fork-stack from the configuration, initializes all protocols (setting values), * sets the protocol stack as top protocol, connects the protocols and calls init() on them. Returns * the protocols in a list, from bottom to top */ protected static List<Protocol> createProtocols(ProtocolStack stack, List<ProtocolConfiguration> protocol_configs) throws Exception { return Configurator.createProtocols(protocol_configs,stack); }
public static void main(String args[]) { if(args.length != 1) { System.err.println("Configurator <string>"); System.exit(0); } String config_str=args[0]; Configurator conf=new Configurator(); Vector<ProtocolConfiguration> protocol_configs; Vector<Protocol> protocols=null; Protocol protocol_stack; try { protocol_configs=Configurator.parseConfigurations(config_str); protocols=Configurator.createProtocols(protocol_configs, null); if(protocols == null) return; protocol_stack=Configurator.connectProtocols(protocols); Thread.sleep(3000); Configurator.destroyProtocolStack(protocol_stack); // conf.stopProtocolStackInternal(protocol_stack); } catch(Exception e) { System.err.println(e); } System.err.println(protocols); }
protocols=createProtocols(protocol_configs, st); if(protocols == null) return null;
@Override public JChannel createChannel(String id) throws Exception { JGroupsLogger.ROOT_LOGGER.debugf("Creating fork channel %s from channel %s", id, this.channel.getClusterName()); String stackName = this.protocols.isEmpty() ? this.channel.getClusterName() : id; ProtocolStackConfiguration forkStack = new ForkProtocolStackConfiguration(stackName, this.parentFactory.getProtocolStackConfiguration(), this.protocols); List<Protocol> protocols = Configurator.createProtocols(JChannelFactory.createProtocols(forkStack, this.channel.getProtocolStack().getTransport().isMulticastCapable()), new ProtocolStack()); return new ForkChannel(this.channel, stackName, id, protocols.toArray(new Protocol[protocols.size()])); }
List<Protocol> protocols=createProtocols(protocol_configs, st); if(protocols == null) return null;