本文整理了Java中org.jgroups.util.Util.getProperty()
方法的一些代码示例,展示了Util.getProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getProperty()
方法的具体详情如下:
包路径:org.jgroups.util.Util
类名称:Util
方法名:getProperty
[英]Returns a value associated wither with one or more system properties, or found in the props map
[中]返回与一个或多个系统属性关联的值,或在道具映射中找到的值
代码示例来源:origin: wildfly/wildfly
private static String _substituteVar(String val) {
int start_index, end_index;
start_index=val.indexOf("${");
if(start_index == -1)
return val;
end_index=val.indexOf("}",start_index + 2);
if(end_index == -1)
throw new IllegalArgumentException("missing \"}\" in " + val);
String tmp=getProperty(val.substring(start_index + 2,end_index));
if(tmp == null)
return val;
StringBuilder sb = new StringBuilder();
sb.append(val, 0, start_index).append(tmp).append(val.substring(end_index + 1));
return sb.toString();
}
代码示例来源:origin: wildfly/wildfly
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
boolean validation = false;
String tmp = Util.getProperty(new String[] { Global.XML_VALIDATION }, null, null, null);
if (tmp != null) {
validation =Boolean.valueOf(tmp);
代码示例来源:origin: wildfly/wildfly
magic_number_file=Util.getProperty(new String[]{Global.MAGIC_NUMBER_FILE, "org.jgroups.conf.magicNumberFile"},
null, null, MAGIC_NUMBER_FILE);
protocol_id_file=Util.getProperty(new String[]{Global.PROTOCOL_ID_FILE, "org.jgroups.conf.protocolIDFile"},
null, null, PROTOCOL_ID_FILE);
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
public Scheduler() {
String tmp=Util.getProperty(new String[]{Global.SCHEDULER_MAX_THREADS}, null, null, false, "128");
this.NUM_THREADS=Integer.parseInt(tmp);
}
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
public static InetAddress parseBindAddress(Properties props, String property) throws UnknownHostException {
InetAddress bind_addr=null;
boolean ignore_systemprops=Util.isBindAddressPropertyIgnored();
String str=Util.getProperty(new String[]{Global.BIND_ADDR, Global.BIND_ADDR_OLD}, props, "bind_addr",
ignore_systemprops, null);
if(str != null) {
bind_addr=InetAddress.getByName(str);
props.remove(property);
}
return bind_addr;
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
private static String _substituteVar(String val) {
int start_index, end_index;
start_index=val.indexOf("${");
if(start_index == -1)
return val;
end_index=val.indexOf("}",start_index + 2);
if(end_index == -1)
throw new IllegalArgumentException("missing \"}\" in " + val);
String tmp=getProperty(val.substring(start_index + 2,end_index));
if(tmp == null)
return val;
StringBuilder sb = new StringBuilder();
sb.append(val.substring(0, start_index))
.append(tmp).append(val.substring(end_index + 1));
return sb.toString();
}
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
private static String _substituteVar(String val) {
int start_index, end_index;
start_index=val.indexOf("${");
if(start_index == -1)
return val;
end_index=val.indexOf("}", start_index+2);
if(end_index == -1)
throw new IllegalArgumentException("missing \"}\" in " + val);
String tmp=getProperty(val.substring(start_index +2, end_index));
if(tmp == null)
return val;
StringBuilder sb=new StringBuilder();
sb.append(val.substring(0, start_index));
sb.append(tmp);
sb.append(val.substring(end_index+1));
return sb.toString();
}
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
public boolean setProperties(Properties props) {
String str;
this.props.putAll(props); // redundant
str=props.getProperty("port_range"); // if member cannot be contacted on base port,
if(str != null) { // how many times can we increment the port
port_range=Integer.parseInt(str);
if (port_range < 1) {
port_range = 1;
}
props.remove("port_range");
}
str=Util.getProperty(new String[]{Global.TCPPING_INITIAL_HOSTS}, props, "initial_hosts", false, null);
if(str != null) {
props.remove("initial_hosts");
try {
initial_hosts=createInitialHosts(str);
}
catch(UnknownHostException e) {
log.error("failed creating initial list of hosts", e);
return false;
}
}
return super.setProperties(props);
}
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
String str=Util.getProperty(new String[]{Global.BIND_ADDR, Global.BIND_ADDR_OLD}, props, "bind_addr",
ignore_systemprops, null);
if(str != null) {
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
str=Util.getProperty(new String[]{Global.BIND_ADDR, Global.BIND_ADDR_OLD}, props, "bind_addr",
ignore_systemprops, null);
if(str != null) {
代码示例来源:origin: org.jboss.eap/wildfly-client-all
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
boolean validation = false;
String tmp = Util.getProperty(new String[] { Global.XML_VALIDATION }, null, null, null);
if (tmp != null) {
validation =Boolean.valueOf(tmp);
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
public boolean setProperties(Properties props) {
boolean ignore_systemprops=Util.isBindAddressPropertyIgnored();
String str=Util.getProperty(new String[]{Global.BIND_ADDR, Global.BIND_ADDR_OLD}, props, "bind_addr",
ignore_systemprops, null);
if(str != null) {
str=Util.getProperty(new String[]{Global.MPING_MCAST_ADDR}, props, "mcast_addr", false, "230.5.6.7");
if(str != null) {
try {
str=Util.getProperty(new String[]{Global.MPING_MCAST_PORT}, props, "mcast_port", false, "7555");
if(str != null) {
mcast_port=Integer.parseInt(str);
str=Util.getProperty(new String[]{Global.MPING_IP_TTL}, props, "ip_ttl", false, "16");
if(str != null) {
ip_ttl=Integer.parseInt(str);
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
str=Util.getProperty(new String[]{Global.UDP_MCAST_ADDR, "jboss.partition.udpGroup"}, props,
"mcast_addr", false, "228.8.8.8");
if(str != null)
mcast_addr_name=str;
str=Util.getProperty(new String[]{Global.UDP_MCAST_PORT, "jboss.partition.udpPort"},
props, "mcast_port", false, "7600");
if(str != null)
str=Util.getProperty(new String[]{Global.UDP_IP_TTL}, props, "ip_ttl", false, "64");
if(str != null) {
ip_ttl=Integer.parseInt(str);
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
public boolean setProperties(Properties props) {
boolean ignore_systemprops=Util.isBindAddressPropertyIgnored();
String str=Util.getProperty(new String[]{Global.BIND_ADDR, Global.BIND_ADDR_OLD}, props, "bind_addr",
ignore_systemprops, null);
if(str != null) {
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
String str=Util.getProperty(new String[]{Global.BIND_ADDR, Global.BIND_ADDR_OLD}, props, "bind_addr",
ignore_systemprops, null);
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
String mnfile=Util.getProperty(new String[]{Global.MAGIC_NUMBER_FILE, "org.jgroups.conf.magicNumberFile"},
null, null, false, null);
if(mnfile != null) {
代码示例来源:origin: org.jboss.eap/wildfly-client-all
magic_number_file=Util.getProperty(new String[]{Global.MAGIC_NUMBER_FILE, "org.jgroups.conf.magicNumberFile"},
null, null, MAGIC_NUMBER_FILE);
protocol_id_file=Util.getProperty(new String[]{Global.PROTOCOL_ID_FILE, "org.jgroups.conf.protocolIDFile"},
null, null, PROTOCOL_ID_FILE);
代码示例来源:origin: org.jgroups/com.springsource.org.jgroups
String tmp=Util.getProperty(new String[]{Global.CHANNEL_LOCAL_ADDR_TIMEOUT, "local_addr.timeout"},
null, null, false, "30000");
LOCAL_ADDR_TIMEOUT=Long.parseLong(tmp);
内容来源于网络,如有侵权,请联系作者删除!