com.sun.enterprise.config.serverbeans.Server.getSystemProperty()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(9.2k)|赞(0)|评价(0)|浏览(239)

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

Server.getSystemProperty介绍

[英]Gets the value of the systemProperty property.

This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a set method for the systemProperty property.

For example, to add a new item, do as follows:

getSystemProperty().add(newItem);

Objects of the following type(s) are allowed in the list SystemProperty
[中]获取systemProperty属性的值。
此访问器方法返回对实时列表的引用,而不是快照。因此,对返回列表所做的任何修改都将出现在JAXB对象中。这就是为什么systemProperty属性没有set方法的原因。
例如,要添加新项目,请执行以下操作:

getSystemProperty().add(newItem);

list SystemProperty中允许以下类型的对象

代码示例

代码示例来源:origin: org.glassfish.main.core/kernel

private boolean serverHas(SystemProperty sp) {
  List<SystemProperty> ssps = server.getSystemProperty();
  return hasSystemProperty(ssps, sp);
}

代码示例来源:origin: org.glassfish.main.core/kernel

private SystemProperty getServerSystemProperty(String spName) {
  return getSystemProperty(server.getSystemProperty(), spName);
}

代码示例来源:origin: org.glassfish.main.admin/config-api

private void setSystemProperty(String name, String value) throws TransactionFailure, PropertyVetoException {
  SystemProperty sp = _server.getSystemProperty(name);
  if (sp == null) {
    SystemProperty newSP = _server.createChild(SystemProperty.class);
    newSP.setName(name);
    newSP.setValue(value);
    _server.getSystemProperty().add(newSP);
  } else {
    //Don't change the system property if it already exists - leave the original port assignment
    //sp.setName(name);
    //sp.setValue(value);
  }
}

代码示例来源:origin: org.glassfish.admin/config-api

private void setSystemProperty(String name, String value) throws TransactionFailure, PropertyVetoException {
  SystemProperty sp = _server.getSystemProperty(name);
  if (sp == null) {
    SystemProperty newSP = _server.createChild(SystemProperty.class);
    newSP.setName(name);
    newSP.setValue(value);
    _server.getSystemProperty().add(newSP);
  } else {
    //Don't change the system property if it already exists - leave the original port assignment
    //sp.setName(name);
    //sp.setValue(value);
  }
}

代码示例来源:origin: org.glassfish.main.admin/config-api

private static String translatePortOld(String portString, Server server, Config config) {
  if (!isToken(portString))
    return portString;
  // isToken returned true so we are NOT assuming anything below!
  String key = portString.substring(2, portString.length() - 1);
  // check cluster and the cluster's config if applicable
  // bnevins Jul 18, 2010 -- don't botehr this should never be called anymore
  SystemProperty prop = server.getSystemProperty(key);
  if (prop != null) {
    return prop.getValue();
  }
  prop = config.getSystemProperty(key);
  if (prop != null) {
    return prop.getValue();
  }
  return null;
}

代码示例来源:origin: org.glassfish.admin/config-api

private static String translatePortOld(String portString, Server server, Config config) {
  if (!isToken(portString))
    return portString;
  // isToken returned true so we are NOT assuming anything below!
  String key = portString.substring(2, portString.length() - 1);
  // check cluster and the cluster's config if applicable
  // bnevins Jul 18, 2010 -- don't botehr this should never be called anymore
  SystemProperty prop = server.getSystemProperty(key);
  if (prop != null) {
    return prop.getValue();
  }
  prop = config.getSystemProperty(key);
  if (prop != null) {
    return prop.getValue();
  }
  return null;
}

代码示例来源:origin: org.glassfish.admin/config-api

List<SystemProperty> sps = newServer.getSystemProperty();

代码示例来源:origin: org.glassfish.main.admin/config-api

List<SystemProperty> sps = newServer.getSystemProperty();

代码示例来源:origin: org.glassfish.cluster/cluster-admin

newServer.getSystemProperty().add(newSP);

代码示例来源:origin: org.glassfish.main.cluster/cluster-admin

newServer.getSystemProperty().add(newSP);

代码示例来源:origin: org.glassfish.admin/config-api

propVal = getPropertyValue(propName, _server.getSystemProperty());

代码示例来源:origin: org.glassfish.main.admin/config-api

propVal = getPropertyValue(propName, _server.getSystemProperty());

代码示例来源:origin: org.glassfish.main.admin/config-api

/**
 * Make sure all ports that are specified by the user make sense.
 * @param server The new Server element
 * @return null if all went OK.  Otherwise return a String with the error message.
 */
static void checkInternalConsistency(Server server) throws TransactionFailure {
  // Make sure all the system properties for ports have different numbers.
  List<SystemProperty> sysProps = server.getSystemProperty();
  Set<Integer> ports = new TreeSet<Integer>();
  for (SystemProperty sp : sysProps) {
    String name = sp.getName();
    if (PORTSLIST.contains(name)) {
      String val = sp.getValue();
      try {
        boolean wasAdded = ports.add(Integer.parseInt(val));
        if (!wasAdded) //TODO unit test
          throw new TransactionFailure(Strings.get("PortUtils.duplicate_port", val, server.getName()));
      }
      catch(TransactionFailure tf) {
        // don't re-wrap the same Exception type!
        throw tf;
      }
      catch (Exception e) {  //TODO unit test
        throw new TransactionFailure(Strings.get("PortUtils.non_int_port", val, server.getName()));
      }
    }
  }
  checkForLegalPorts(ports, server.getName());
}

代码示例来源:origin: org.glassfish.admin/config-api

/**
 * Make sure all ports that are specified by the user make sense.
 * @param server The new Server element
 * @return null if all went OK.  Otherwise return a String with the error message.
 */
static void checkInternalConsistency(Server server) throws TransactionFailure {
  // Make sure all the system properties for ports have different numbers.
  List<SystemProperty> sysProps = server.getSystemProperty();
  Set<Integer> ports = new TreeSet<Integer>();
  for (SystemProperty sp : sysProps) {
    String name = sp.getName();
    if (PORTSLIST.contains(name)) {
      String val = sp.getValue();
      try {
        boolean wasAdded = ports.add(Integer.parseInt(val));
        if (!wasAdded) //TODO unit test
          throw new TransactionFailure(Strings.get("PortUtils.duplicate_port", val, server.getName()));
      }
      catch(TransactionFailure tf) {
        // don't re-wrap the same Exception type!
        throw tf;
      }
      catch (Exception e) {  //TODO unit test
        throw new TransactionFailure(Strings.get("PortUtils.non_int_port", val, server.getName()));
      }
    }
  }
  checkForLegalPorts(ports, server.getName());
}

代码示例来源:origin: org.glassfish.admin/config-api

private void setupSupplemental(AdminCommandContext context, final Server instance) {
  if (clusterName != null) {
    InstanceRegisterInstanceCommandParameters cp = new InstanceRegisterInstanceCommandParameters();
    context.getActionReport().
        setResultType(InstanceRegisterInstanceCommandParameters.class, cp);
    Node instNode = domain.getNodeNamed(node);
    cp.config = instance.getConfigRef();
    cp.nodehost = instNode.getNodeHost();
    cp.nodedir = instNode.getNodeDir();
    cp.installdir = instNode.getInstallDir();
    List<SystemProperty> spList = instance.getSystemProperty();
    if (spList != null) {
      Properties p = new Properties();
      for (SystemProperty sp : spList) {
        p.put(sp.getName(), sp.getValue());
      }
      cp.systemProperties = p;
    }
  }
}

代码示例来源:origin: org.glassfish.main.admin/config-api

private void setupSupplemental(AdminCommandContext context, final Server instance) {
  if (clusterName != null) {
    InstanceRegisterInstanceCommandParameters cp = new InstanceRegisterInstanceCommandParameters();
    context.getActionReport().
        setResultType(InstanceRegisterInstanceCommandParameters.class, cp);
    Node instNode = domain.getNodeNamed(node);
    cp.config = instance.getConfigRef();
    cp.nodehost = instNode.getNodeHost();
    cp.nodedir = instNode.getNodeDir();
    cp.installdir = instNode.getInstallDir();
    List<SystemProperty> spList = instance.getSystemProperty();
    if (spList != null) {
      Properties p = new Properties();
      for (SystemProperty sp : spList) {
        p.put(sp.getName(), sp.getValue());
      }
      cp.systemProperties = p;
    }
  }
}

代码示例来源:origin: org.glassfish.admin/config-api

private void initialize(Cluster cluster, Config config, Domain domain, Server theServer) {
  List<SystemProperty> propList;
  server = theServer;
  // 0. domain
  propList = domain.getSystemProperty();
  addAll(propList);
  // 1. cluster
  if (cluster != null) {
    propList = cluster.getSystemProperty();
    addAll(propList);
  }
  // 2. config
  if (config != null) {
    propList = config.getSystemProperty();
    addAll(propList);
  }
  // 3. server
  propList = server.getSystemProperty();
  addAll(propList);
}

代码示例来源:origin: org.glassfish.main.admin/config-api

private void initialize(Cluster cluster, Config config, Domain domain, Server theServer) {
  List<SystemProperty> propList;
  server = theServer;
  // 0. domain
  propList = domain.getSystemProperty();
  addAll(propList);
  // 1. cluster
  if (cluster != null) {
    propList = cluster.getSystemProperty();
    addAll(propList);
  }
  // 2. config
  if (config != null) {
    propList = config.getSystemProperty();
    addAll(propList);
  }
  // 3. server
  propList = server.getSystemProperty();
  addAll(propList);
}

代码示例来源:origin: org.glassfish.main.core/kernel

private void setSystemPropertiesFromDomainXml() {
  // precedence order from high to low
  // 0. server
  // 1. cluster
  // 2. <server>-config or <cluster>-config
  // 3. domain
  // so we need to add System Properties in *reverse order* to get the
  // right precedence.
  List<SystemProperty> domainSPList = domain.getSystemProperty();
  List<SystemProperty> configSPList = getConfigSystemProperties();
  Cluster cluster = server.getCluster();
  List<SystemProperty> clusterSPList = null;
  if (cluster != null) {
    clusterSPList = cluster.getSystemProperty();
  }
  List<SystemProperty> serverSPList = server.getSystemProperty();
  setSystemProperties(
      domainSPList);
  setSystemProperties(
      configSPList);
  if (clusterSPList != null) {
    setSystemProperties(clusterSPList);
  }
  setSystemProperties(serverSPList);
}

代码示例来源:origin: org.glassfish.main.admin/config-api

gmsListenerPortProp.setName(propName);
gmsListenerPortProp.setValue(dasGmsPortProp.getValue());
instance.getSystemProperty().add(gmsListenerPortProp);

相关文章