@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); } } }
public void setProperties(Properties p) { prot.setProperties(p); }
public boolean setProperties(Properties props) { if (!super.setProperties(props)) return false; String s=props.getProperty("debug"); debug="debug".equalsIgnoreCase(s); return true; }
public boolean setProperties(Properties props) { super.setProperties(props); if(!props.isEmpty()) { log.error("the following properties are not recognized: " + props); return false; } return true; }
public boolean setProperties(Properties props) { super.setProperties(props); if(!props.isEmpty()) { log.error("the following properties are not recognized: " + props); return false; } return true; }
public boolean setProperties(Properties props) { String str; super.setProperties(props); str=props.getProperty("name"); if(str != null) { name=str; props.remove("name"); } if(!props.isEmpty()) { log.error("DUMMY.setProperties(): these properties are not recognized: " + props); return false; } return true; }
public boolean setProperties(Properties props) { String str; super.setProperties(props); str=props.getProperty("avg_send_interval"); if(str != null) { avg_send_interval=Long.parseLong(str); props.remove("avg_send_interval"); } if(!props.isEmpty()) { log.error("these properties are not recognized: " + props); return false; } return true; }
public boolean setProperties(Properties props) { String str; super.setProperties(props); str=props.getProperty("max_close_time"); if(str != null) { max_close_time=Long.parseLong(str); props.remove("max_close_time"); } if(!props.isEmpty()) { log.error("these properties are not recognized: " + props); return false; } return true; }
public boolean setProperties(Properties props) { String str; super.setProperties(props); str=props.getProperty("use_multipoint_forwarding"); if(str != null) { use_multipoint_forwarding=Boolean.valueOf(str).booleanValue(); props.remove("use_multipoint_forwarding"); } if(!props.isEmpty()) { log.error("TCP.setProperties(): the following properties are not recognized: " + props); return false; } return true; }
/** * Setup the Protocol instance acording to the configuration string */ public boolean setProperties(Properties props) { String str; super.setProperties(props); str=props.getProperty("frag_size"); if(str != null) { frag_size=Integer.parseInt(str); props.remove("frag_size"); } if(!props.isEmpty()) { log.error("FRAG.setProperties(): the following properties are not recognized: " + props); return false; } return true; }
public boolean setProperties(Properties props) { super.setProperties(props); String str=props.getProperty("use_flush"); if(str != null) { log.warn("use_flush has been deprecated and its value will be ignored"); props.remove("use_flush"); } str=props.getProperty("flush_timeout"); if(str != null) { log.warn("flush_timeout has been deprecated and its value will be ignored"); props.remove("flush_timeout"); } if(!props.isEmpty()) { log.error("the following properties are not recognized: " + props); return false; } return true; }
public boolean setProperties(Properties props) { String str; super.setProperties(props); str=props.getProperty("seqno"); if(str != null) { seqno=Long.parseLong(str); props.remove("seqno"); } str=props.getProperty("duplicate"); if(str != null) { duplicate=Long.parseLong(str); props.remove("duplicate"); } if(!props.isEmpty()) { log.error("these properties are not recognized: " + props); return false; } return true; }
public boolean setProperties(Properties props) { String str; super.setProperties(props); str=props.getProperty("in_delay"); if(str != null) { in_delay=Integer.parseInt(str); props.remove("in_delay"); } str=props.getProperty("out_delay"); if(str != null) { out_delay=Integer.parseInt(str); props.remove("out_delay"); } if(!props.isEmpty()) { log.error("DELAY.setProperties(): these properties are not recognized: " + props); return false; } return true; }
/** * Setup the Protocol instance acording to the configuration string */ public boolean setProperties(Properties props) { String str; super.setProperties(props); str=props.getProperty("num_iterations"); if(str != null) { num_iterations=Integer.parseInt(str); props.remove("num_iterations"); } str=props.getProperty("frag_overhead"); if(str != null) { frag_overhead=Integer.parseInt(str); props.remove("frag_overhead"); } if(props.size() > 0) { log.error("AUTOCONF.setProperties(): the following properties are not recognized: " + props); return false; } return true; }
public boolean setProperties(Properties props) { String str; super.setProperties(props); str=props.getProperty("up"); if(str != null) { up=Double.parseDouble(str); props.remove("up"); } str=props.getProperty("down"); if(str != null) { down=Double.parseDouble(str); props.remove("down"); } str=props.getProperty("excludeitself"); if(str != null) { excludeItself=Boolean.valueOf(str).booleanValue(); props.remove("excludeitself"); } if(!props.isEmpty()) { log.error("DISCARD.setProperties(): these properties are not recognized: " + props); return false; } return true; }
public boolean setProperties(Properties props) { String str; super.setProperties(props); str=props.getProperty("timeout"); if(str != null) { timeout=Long.parseLong(str); props.remove("timeout"); } str=props.getProperty("interval"); if(str != null) { interval=Long.parseLong(str); props.remove("interval"); } str=props.getProperty("max_missed_hbs"); if(str != null) { max_missed_hbs=Integer.parseInt(str); props.remove("max_missed_hbs"); } if(!props.isEmpty()) { log.error("FD_SIMPLE.setProperties(): the following properties are not recognized: " + props); return false; } return true; }
public boolean setProperties(Properties props) { String str; super.setProperties(props); str=props.getProperty("timeout"); if(str != null) { timeout=Long.parseLong(str); props.remove("timeout"); } str=props.getProperty("max_tries"); // before suspecting a member if(str != null) { max_tries=Integer.parseInt(str); props.remove("max_tries"); } str=props.getProperty("shun"); if(str != null) { shun=Boolean.valueOf(str).booleanValue(); props.remove("shun"); } if(!props.isEmpty()) { log.error("the following properties are not recognized: " + props); return false; } return true; }
/** * Setup the Protocol instance acording to the configuration string */ public boolean setProperties(Properties props) {super.setProperties(props); String str; str=props.getProperty("print_msg"); if(str != null) { print_msg=Boolean.valueOf(str).booleanValue(); props.remove("print_msg"); } str=props.getProperty("raw_buffer"); if(str != null) { raw_buffer=Boolean.valueOf(str).booleanValue(); props.remove("raw_buffer"); } str=props.getProperty("min_size"); if(str != null) { min_size=Integer.parseInt(str); props.remove("min_size"); } if(!props.isEmpty()) { log.error("the following properties are not recognized: " + props); return false; } return true; }
public boolean setProperties(Properties props) { super.setProperties(props); timeout = Util.parseLong(props, "timeout", timeout); enable_reconciliation = Util.parseBoolean(props, "enable_reconciliation", enable_reconciliation); String str = props.getProperty("auto_flush_conf"); if (str != null) { log.warn("auto_flush_conf has been deprecated and its value will be ignored"); props.remove("auto_flush_conf"); } if (!props.isEmpty()) { log.error("the following properties are not recognized: " + props); return false; } return true; }
public boolean setProperties(Properties props) { String str; super.setProperties(props); str=props.getProperty("max_block_time"); if(str != null) { max_block_time=Long.parseLong(str); props.remove("max_block_time"); } str=props.getProperty("max_credits"); if(str != null) { max_credits=Long.parseLong(str); props.remove("max_credits"); } Util.checkBufferSize("SFC.max_credits", max_credits); MAX_CREDITS=new Long(max_credits); curr_credits_available=max_credits; if(!props.isEmpty()) { log.error("the following properties are not recognized: " + props); return false; } return true; }