org.jgroups.util.Util.getProperty()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(215)

本文整理了Java中org.jgroups.util.Util.getProperty()方法的一些代码示例,展示了Util.getProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getProperty()方法的具体详情如下:
包路径:org.jgroups.util.Util
类名称:Util
方法名:getProperty

Util.getProperty介绍

[英]Returns a value associated wither with one or more system properties, or found in the props map
[中]返回与一个或多个系统属性关联的值,或在道具映射中找到的值

代码示例

代码示例来源:origin: wildfly/wildfly

  1. private static String _substituteVar(String val) {
  2. int start_index, end_index;
  3. start_index=val.indexOf("${");
  4. if(start_index == -1)
  5. return val;
  6. end_index=val.indexOf("}",start_index + 2);
  7. if(end_index == -1)
  8. throw new IllegalArgumentException("missing \"}\" in " + val);
  9. String tmp=getProperty(val.substring(start_index + 2,end_index));
  10. if(tmp == null)
  11. return val;
  12. StringBuilder sb = new StringBuilder();
  13. sb.append(val, 0, start_index).append(tmp).append(val.substring(end_index + 1));
  14. return sb.toString();
  15. }

代码示例来源:origin: wildfly/wildfly

  1. DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
  2. boolean validation = false;
  3. String tmp = Util.getProperty(new String[] { Global.XML_VALIDATION }, null, null, null);
  4. if (tmp != null) {
  5. validation =Boolean.valueOf(tmp);

代码示例来源:origin: wildfly/wildfly

  1. magic_number_file=Util.getProperty(new String[]{Global.MAGIC_NUMBER_FILE, "org.jgroups.conf.magicNumberFile"},
  2. null, null, MAGIC_NUMBER_FILE);
  3. protocol_id_file=Util.getProperty(new String[]{Global.PROTOCOL_ID_FILE, "org.jgroups.conf.protocolIDFile"},
  4. null, null, PROTOCOL_ID_FILE);

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. public Scheduler() {
  2. String tmp=Util.getProperty(new String[]{Global.SCHEDULER_MAX_THREADS}, null, null, false, "128");
  3. this.NUM_THREADS=Integer.parseInt(tmp);
  4. }

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. public static InetAddress parseBindAddress(Properties props, String property) throws UnknownHostException {
  2. InetAddress bind_addr=null;
  3. boolean ignore_systemprops=Util.isBindAddressPropertyIgnored();
  4. String str=Util.getProperty(new String[]{Global.BIND_ADDR, Global.BIND_ADDR_OLD}, props, "bind_addr",
  5. ignore_systemprops, null);
  6. if(str != null) {
  7. bind_addr=InetAddress.getByName(str);
  8. props.remove(property);
  9. }
  10. return bind_addr;
  11. }

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. private static String _substituteVar(String val) {
  2. int start_index, end_index;
  3. start_index=val.indexOf("${");
  4. if(start_index == -1)
  5. return val;
  6. end_index=val.indexOf("}",start_index + 2);
  7. if(end_index == -1)
  8. throw new IllegalArgumentException("missing \"}\" in " + val);
  9. String tmp=getProperty(val.substring(start_index + 2,end_index));
  10. if(tmp == null)
  11. return val;
  12. StringBuilder sb = new StringBuilder();
  13. sb.append(val.substring(0, start_index))
  14. .append(tmp).append(val.substring(end_index + 1));
  15. return sb.toString();
  16. }

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. private static String _substituteVar(String val) {
  2. int start_index, end_index;
  3. start_index=val.indexOf("${");
  4. if(start_index == -1)
  5. return val;
  6. end_index=val.indexOf("}", start_index+2);
  7. if(end_index == -1)
  8. throw new IllegalArgumentException("missing \"}\" in " + val);
  9. String tmp=getProperty(val.substring(start_index +2, end_index));
  10. if(tmp == null)
  11. return val;
  12. StringBuilder sb=new StringBuilder();
  13. sb.append(val.substring(0, start_index));
  14. sb.append(tmp);
  15. sb.append(val.substring(end_index+1));
  16. return sb.toString();
  17. }

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. public boolean setProperties(Properties props) {
  2. String str;
  3. this.props.putAll(props); // redundant
  4. str=props.getProperty("port_range"); // if member cannot be contacted on base port,
  5. if(str != null) { // how many times can we increment the port
  6. port_range=Integer.parseInt(str);
  7. if (port_range < 1) {
  8. port_range = 1;
  9. }
  10. props.remove("port_range");
  11. }
  12. str=Util.getProperty(new String[]{Global.TCPPING_INITIAL_HOSTS}, props, "initial_hosts", false, null);
  13. if(str != null) {
  14. props.remove("initial_hosts");
  15. try {
  16. initial_hosts=createInitialHosts(str);
  17. }
  18. catch(UnknownHostException e) {
  19. log.error("failed creating initial list of hosts", e);
  20. return false;
  21. }
  22. }
  23. return super.setProperties(props);
  24. }

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. String str=Util.getProperty(new String[]{Global.BIND_ADDR, Global.BIND_ADDR_OLD}, props, "bind_addr",
  2. ignore_systemprops, null);
  3. if(str != null) {

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. str=Util.getProperty(new String[]{Global.BIND_ADDR, Global.BIND_ADDR_OLD}, props, "bind_addr",
  2. ignore_systemprops, null);
  3. if(str != null) {

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
  2. boolean validation = false;
  3. String tmp = Util.getProperty(new String[] { Global.XML_VALIDATION }, null, null, null);
  4. if (tmp != null) {
  5. validation =Boolean.valueOf(tmp);

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. public boolean setProperties(Properties props) {
  2. boolean ignore_systemprops=Util.isBindAddressPropertyIgnored();
  3. String str=Util.getProperty(new String[]{Global.BIND_ADDR, Global.BIND_ADDR_OLD}, props, "bind_addr",
  4. ignore_systemprops, null);
  5. if(str != null) {
  6. str=Util.getProperty(new String[]{Global.MPING_MCAST_ADDR}, props, "mcast_addr", false, "230.5.6.7");
  7. if(str != null) {
  8. try {
  9. str=Util.getProperty(new String[]{Global.MPING_MCAST_PORT}, props, "mcast_port", false, "7555");
  10. if(str != null) {
  11. mcast_port=Integer.parseInt(str);
  12. str=Util.getProperty(new String[]{Global.MPING_IP_TTL}, props, "ip_ttl", false, "16");
  13. if(str != null) {
  14. ip_ttl=Integer.parseInt(str);

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. str=Util.getProperty(new String[]{Global.UDP_MCAST_ADDR, "jboss.partition.udpGroup"}, props,
  2. "mcast_addr", false, "228.8.8.8");
  3. if(str != null)
  4. mcast_addr_name=str;
  5. str=Util.getProperty(new String[]{Global.UDP_MCAST_PORT, "jboss.partition.udpPort"},
  6. props, "mcast_port", false, "7600");
  7. if(str != null)
  8. str=Util.getProperty(new String[]{Global.UDP_IP_TTL}, props, "ip_ttl", false, "64");
  9. if(str != null) {
  10. ip_ttl=Integer.parseInt(str);

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. public boolean setProperties(Properties props) {
  2. boolean ignore_systemprops=Util.isBindAddressPropertyIgnored();
  3. String str=Util.getProperty(new String[]{Global.BIND_ADDR, Global.BIND_ADDR_OLD}, props, "bind_addr",
  4. ignore_systemprops, null);
  5. if(str != null) {

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. String str=Util.getProperty(new String[]{Global.BIND_ADDR, Global.BIND_ADDR_OLD}, props, "bind_addr",
  2. ignore_systemprops, null);

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. String mnfile=Util.getProperty(new String[]{Global.MAGIC_NUMBER_FILE, "org.jgroups.conf.magicNumberFile"},
  2. null, null, false, null);
  3. if(mnfile != null) {

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. magic_number_file=Util.getProperty(new String[]{Global.MAGIC_NUMBER_FILE, "org.jgroups.conf.magicNumberFile"},
  2. null, null, MAGIC_NUMBER_FILE);
  3. protocol_id_file=Util.getProperty(new String[]{Global.PROTOCOL_ID_FILE, "org.jgroups.conf.protocolIDFile"},
  4. null, null, PROTOCOL_ID_FILE);

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. String tmp=Util.getProperty(new String[]{Global.CHANNEL_LOCAL_ADDR_TIMEOUT, "local_addr.timeout"},
  2. null, null, false, "30000");
  3. LOCAL_ADDR_TIMEOUT=Long.parseLong(tmp);

相关文章

Util类方法