@Override public boolean isStatisticsEnabled() { return this.parentStack.isStatisticsEnabled(); }
@Override public final P createProtocol(ProtocolStackConfiguration stackConfiguration) { // A "native" protocol is one that is not specified as a class name boolean nativeProtocol = this.moduleName.equals(AbstractProtocolResourceDefinition.Attribute.MODULE.getDefinition().getDefaultValue().asString()) && !this.name.startsWith(org.jgroups.conf.ProtocolConfiguration.protocol_prefix); String className = nativeProtocol ? String.join(".", org.jgroups.conf.ProtocolConfiguration.protocol_prefix, this.name) : this.name; try { Module module = this.loader.get().loadModule(this.moduleName); Class<? extends Protocol> protocolClass = module.getClassLoader().loadClass(className).asSubclass(Protocol.class); Map<String, String> properties = new HashMap<>(this.defaults.get().getProperties(protocolClass)); properties.putAll(this.properties); PrivilegedExceptionAction<Protocol> action = () -> { try { return protocolClass.newInstance().setProperties(properties); } catch (InstantiationException | IllegalAccessException e) { throw new IllegalStateException(e); } }; @SuppressWarnings("unchecked") P protocol = (P) WildFlySecurityManager.doUnchecked(action); this.accept(protocol); protocol.enableStats(this.statisticsEnabled != null ? this.statisticsEnabled : stackConfiguration.isStatisticsEnabled()); return protocol; } catch (Exception e) { throw new IllegalArgumentException(e); } } }
@Override public JChannel createChannel(String id) throws Exception { FORK fork = new FORK(); fork.enableStats(this.configuration.isStatisticsEnabled()); fork.setUnknownForkHandler(new UnknownForkHandler() { private final short id = ClassConfigurator.getProtocolId(RequestCorrelator.class);
@Override public boolean isStatisticsEnabled() { return this.parentStack.isStatisticsEnabled(); }
@Override public final P createProtocol(ProtocolStackConfiguration stackConfiguration) { // A "native" protocol is one that is not specified as a class name boolean nativeProtocol = this.moduleName.equals(AbstractProtocolResourceDefinition.Attribute.MODULE.getDefinition().getDefaultValue().asString()) && !this.name.startsWith(org.jgroups.conf.ProtocolConfiguration.protocol_prefix); String className = nativeProtocol ? String.join(".", org.jgroups.conf.ProtocolConfiguration.protocol_prefix, this.name) : this.name; try { Module module = this.loader.get().loadModule(this.moduleName); Class<? extends Protocol> protocolClass = module.getClassLoader().loadClass(className).asSubclass(Protocol.class); Map<String, String> properties = new HashMap<>(this.defaults.get().getProperties(protocolClass)); properties.putAll(this.properties); PrivilegedExceptionAction<Protocol> action = () -> { try { return protocolClass.newInstance().setProperties(properties); } catch (InstantiationException | IllegalAccessException e) { throw new IllegalStateException(e); } }; @SuppressWarnings("unchecked") P protocol = (P) WildFlySecurityManager.doUnchecked(action); this.accept(protocol); protocol.enableStats(this.statisticsEnabled != null ? this.statisticsEnabled : stackConfiguration.isStatisticsEnabled()); return protocol; } catch (Exception e) { throw new IllegalArgumentException(e); } } }
@Override public JChannel createChannel(String id) throws Exception { FORK fork = new FORK(); fork.enableStats(this.configuration.isStatisticsEnabled()); fork.setUnknownForkHandler(new UnknownForkHandler() { private final short id = ClassConfigurator.getProtocolId(RequestCorrelator.class);