@Override public ModelNode execute(ExpressionResolver expressionResolver, ModelNode operation, ChannelFactory factory) throws OperationFailedException { // Create a temporary channel, but don't connect it try (JChannel channel = factory.createChannel(UUID.randomUUID().toString())) { // ProtocolStack.printProtocolSpecAsXML() is very hacky and only works on an uninitialized stack List<Protocol> protocols = channel.getProtocolStack().getProtocols(); Collections.reverse(protocols); ProtocolStack stack = new ProtocolStack(); stack.addProtocols(protocols); return new ModelNode(stack.printProtocolSpecAsXML()); } catch (Exception e) { throw new OperationFailedException(e); } } },
@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 protected void initChannel() { try { this.channel = this.factory.createChannel(this.configuration.globalJmxStatistics().cacheManagerName()); this.channel.setDiscardOwnMessages(false); } catch (Exception e) { throw new CacheException(e); } } }
@Override public JChannel get() { try { JChannel channel = this.factory.get().createChannel(this.name); if (JGroupsLogger.ROOT_LOGGER.isTraceEnabled()) { JGroupsLogger.ROOT_LOGGER.tracef("JGroups channel %s created with configuration:%n %s", this.name, channel.getProtocolStack().printProtocolSpec(true)); } channel.stats(this.statisticsEnabled); if (this.server != null) { try { JmxConfigurator.registerChannel(channel, this.server.get(), this.name); } catch (Exception e) { JGroupsLogger.ROOT_LOGGER.debug(e.getLocalizedMessage(), e); } } channel.connect(this.cluster.get()); return channel; } catch (Exception e) { throw new IllegalStateException(e); } }
@Override public ModelNode execute(ExpressionResolver expressionResolver, ModelNode operation, ChannelFactory factory) throws OperationFailedException { // Create a temporary channel, but don't connect it try (JChannel channel = factory.createChannel(UUID.randomUUID().toString())) { // ProtocolStack.printProtocolSpecAsXML() is very hacky and only works on an uninitialized stack List<Protocol> protocols = channel.getProtocolStack().getProtocols(); Collections.reverse(protocols); ProtocolStack stack = new ProtocolStack(); stack.addProtocols(protocols); return new ModelNode(stack.printProtocolSpecAsXML()); } catch (Exception e) { throw new OperationFailedException(e); } } },
@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 protected void initChannel() { try { this.channel = this.factory.createChannel(this.configuration.globalJmxStatistics().cacheManagerName()); this.channel.setDiscardOwnMessages(false); } catch (Exception e) { throw new CacheException(e); } } }
@Override public JChannel get() { try { JChannel channel = this.factory.get().createChannel(this.name); if (JGroupsLogger.ROOT_LOGGER.isTraceEnabled()) { JGroupsLogger.ROOT_LOGGER.tracef("JGroups channel %s created with configuration:%n %s", this.name, channel.getProtocolStack().printProtocolSpec(true)); } channel.stats(this.statisticsEnabled); if (this.server != null) { try { JmxConfigurator.registerChannel(channel, this.server.get(), this.name); } catch (Exception e) { JGroupsLogger.ROOT_LOGGER.debug(e.getLocalizedMessage(), e); } } channel.connect(this.cluster.get()); return channel; } catch (Exception e) { throw new IllegalStateException(e); } }