@Override public ProtocolStackConfiguration getProtocolStackConfiguration() { ProtocolStackConfiguration parentStack = this.parentFactory.getProtocolStackConfiguration(); return new ForkProtocolStackConfiguration(this.channel.getClusterName(), parentStack, Stream.concat(parentStack.getProtocols().stream(), this.protocols.stream()).collect(Collectors.toList())); }
List<Protocol> protocols = new ArrayList<>(transports.size() + this.configuration.getProtocols().size() + relays.size() + 1); for (List<ProtocolConfiguration<? extends Protocol>> protocolConfigs : Arrays.asList(transports, this.configuration.getProtocols(), relays)) { for (ProtocolConfiguration<? extends Protocol> protocolConfig : protocolConfigs) { protocols.add(protocolConfig.createProtocol(this.configuration));
@Override public Protocol findProtocol(OperationContext context) throws ClassNotFoundException, ModuleLoadException { PathAddress address = context.getCurrentAddress(); String channelName = address.getParent().getLastElement().getValue(); String protocolName = address.getLastElement().getValue(); ServiceRegistry registry = context.getServiceRegistry(true); JChannel channel = new PassiveServiceSupplier<JChannel>(registry, JGroupsRequirement.CHANNEL.getServiceName(context, channelName)).get(); if (channel != null) { ChannelFactory factory = new PassiveServiceSupplier<ChannelFactory>(registry, JGroupsRequirement.CHANNEL_SOURCE.getServiceName(context, channelName)).get(); if (factory != null) { ProtocolStackConfiguration configuration = factory.getProtocolStackConfiguration(); ProtocolConfiguration<? extends TP> transport = configuration.getTransport(); if (transport.getName().equals(protocolName)) { Class<? extends Protocol> protocolClass = transport.createProtocol(configuration).getClass(); return channel.getProtocolStack().findProtocol(protocolClass); } for (ProtocolConfiguration<? extends Protocol> protocol : configuration.getProtocols()) { if (protocol.getName().equals(protocolName)) { Class<? extends Protocol> protocolClass = protocol.createProtocol(configuration).getClass(); return channel.getProtocolStack().findProtocol(protocolClass); } } } } return null; }
@Override public Protocol findProtocol(OperationContext context) throws ClassNotFoundException, ModuleLoadException { PathAddress address = context.getCurrentAddress(); String channelName = address.getElement(address.size() - 3).getValue(); String forkName = address.getElement(address.size() - 2).getValue(); String protocolName = address.getElement(address.size() - 1).getValue(); ServiceRegistry registry = context.getServiceRegistry(true); JChannel channel = new PassiveServiceSupplier<JChannel>(registry, JGroupsRequirement.CHANNEL.getServiceName(context, channelName)).get(); if (channel != null) { FORK fork = (FORK) channel.getProtocolStack().findProtocol(FORK.class); if (fork != null) { ChannelFactory factory = new PassiveServiceSupplier<ChannelFactory>(registry, JGroupsRequirement.CHANNEL_FACTORY.getServiceName(context, channelName)).get(); if (factory != null) { ProtocolStackConfiguration configuration = factory.getProtocolStackConfiguration(); ProtocolConfiguration<? extends TP> transport = configuration.getTransport(); if (transport.getName().equals(protocolName)) { Class<? extends Protocol> protocolClass = transport.createProtocol(configuration).getClass(); return channel.getProtocolStack().findProtocol(protocolClass); } for (ProtocolConfiguration<? extends Protocol> protocol : configuration.getProtocols()) { if (protocol.getName().equals(protocolName)) { Class<? extends Protocol> protocolClass = protocol.createProtocol(configuration).getClass(); return fork.get(forkName).getProtocolStack().findProtocol(protocolClass); } } } } } return null; }
@Override public ProtocolStackConfiguration getProtocolStackConfiguration() { ProtocolStackConfiguration parentStack = this.parentFactory.getProtocolStackConfiguration(); return new ForkProtocolStackConfiguration(this.channel.getClusterName(), parentStack, Stream.concat(parentStack.getProtocols().stream(), this.protocols.stream()).collect(Collectors.toList())); }
List<Protocol> protocols = new ArrayList<>(transports.size() + this.configuration.getProtocols().size() + relays.size() + 1); for (List<ProtocolConfiguration<? extends Protocol>> protocolConfigs : Arrays.asList(transports, this.configuration.getProtocols(), relays)) { for (ProtocolConfiguration<? extends Protocol> protocolConfig : protocolConfigs) { protocols.add(protocolConfig.createProtocol(this.configuration));
@Override public Protocol findProtocol(OperationContext context) throws ClassNotFoundException, ModuleLoadException { PathAddress address = context.getCurrentAddress(); String channelName = address.getParent().getLastElement().getValue(); String protocolName = address.getLastElement().getValue(); ServiceRegistry registry = context.getServiceRegistry(true); JChannel channel = new PassiveServiceSupplier<JChannel>(registry, JGroupsRequirement.CHANNEL.getServiceName(context, channelName)).get(); if (channel != null) { ChannelFactory factory = new PassiveServiceSupplier<ChannelFactory>(registry, JGroupsRequirement.CHANNEL_SOURCE.getServiceName(context, channelName)).get(); if (factory != null) { ProtocolStackConfiguration configuration = factory.getProtocolStackConfiguration(); ProtocolConfiguration<? extends TP> transport = configuration.getTransport(); if (transport.getName().equals(protocolName)) { Class<? extends Protocol> protocolClass = transport.createProtocol(configuration).getClass(); return channel.getProtocolStack().findProtocol(protocolClass); } for (ProtocolConfiguration<? extends Protocol> protocol : configuration.getProtocols()) { if (protocol.getName().equals(protocolName)) { Class<? extends Protocol> protocolClass = protocol.createProtocol(configuration).getClass(); return channel.getProtocolStack().findProtocol(protocolClass); } } } } return null; }
@Override public Protocol findProtocol(OperationContext context) throws ClassNotFoundException, ModuleLoadException { PathAddress address = context.getCurrentAddress(); String channelName = address.getElement(address.size() - 3).getValue(); String forkName = address.getElement(address.size() - 2).getValue(); String protocolName = address.getElement(address.size() - 1).getValue(); ServiceRegistry registry = context.getServiceRegistry(true); JChannel channel = new PassiveServiceSupplier<JChannel>(registry, JGroupsRequirement.CHANNEL.getServiceName(context, channelName)).get(); if (channel != null) { FORK fork = (FORK) channel.getProtocolStack().findProtocol(FORK.class); if (fork != null) { ChannelFactory factory = new PassiveServiceSupplier<ChannelFactory>(registry, JGroupsRequirement.CHANNEL_FACTORY.getServiceName(context, channelName)).get(); if (factory != null) { ProtocolStackConfiguration configuration = factory.getProtocolStackConfiguration(); ProtocolConfiguration<? extends TP> transport = configuration.getTransport(); if (transport.getName().equals(protocolName)) { Class<? extends Protocol> protocolClass = transport.createProtocol(configuration).getClass(); return channel.getProtocolStack().findProtocol(protocolClass); } for (ProtocolConfiguration<? extends Protocol> protocol : configuration.getProtocols()) { if (protocol.getName().equals(protocolName)) { Class<? extends Protocol> protocolClass = protocol.createProtocol(configuration).getClass(); return fork.get(forkName).getProtocolStack().findProtocol(protocolClass); } } } } } return null; }