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

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

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

Server.getConfig介绍

[英]Gets the value of the configRef property. Points to a named config. Needed for stand-alone servers. If server instance is part of a cluster, then it points to the cluster config
[中]获取configRef属性的值。指向一个命名的配置。需要独立服务器。如果服务器实例是集群的一部分,那么它将指向集群配置

代码示例

代码示例来源:origin: org.glassfish.main.resourcebase.resources/nucleus-resources

private List<ResourceRef> getResourceRefs() {
  //Instead of injecting ResourceRef[] config array (which will inject all resource-refs in domain.xml
  //including the ones in other server instances), get appropriate instance's resource-refs alone.
  Server server = getServerBean();
  List<ResourceRef> resourceRefs = new ArrayList<ResourceRef>(server.getResourceRef());
  // MAC 10/2012 -- If not in cluster, add config refs 
  Config config = server.getConfig();
  if (config != null) {
    resourceRefs.addAll(config.getResourceRef());
  }
  return resourceRefs;
}

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

if ("domain".equals(target) || target.equals(domainName)) {
  for (Server s : domain.getServers().getServer()) {
    Config config = s.getConfig();
    Cluster cluster = s.getCluster();
    if (!s.containsProperty(propName) && !config.containsProperty(propName)) {

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

void initRest() {
  InputStream is = null;
  try {
    NetworkListener nl = domain.getServerNamed("server").getConfig().getNetworkConfig()
        .getNetworkListener("admin-listener");
    SecureAdmin secureAdmin = habitat.getService(SecureAdmin.class);
    URL url = new URL(
        (SecureAdmin.Util.isEnabled(secureAdmin) ? "https" : "http"),
        nl.getAddress(),
        Integer.parseInt(nl.getPort()),
        "/management/domain");
    URLConnection conn = url.openConnection();
    is = conn.getInputStream();
    isRestStarted = true;
  } catch (Exception ex) {
    logger.log(Level.FINE, null, ex);
  } finally {
    if (is != null) {
      try {
        is.close();
      } catch (IOException ex1) {
        logger.log(Level.FINE, null, ex1);
      }
    }
  }
}

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

protected void decorate() {
  Server server = habitat.getService(Server.class, env.getInstanceName());
  if (server == null) {
    LogRecord lr = new LogRecord(Level.SEVERE,
        badEnv);
    lr.setLoggerName(getClass().getName());
    EarlyLogHandler.earlyMessages.add(lr);
    return;
  }
  ServiceLocatorUtilities.addOneConstant(habitat, server,
      ServerEnvironment.DEFAULT_INSTANCE_NAME, Server.class);
  server.getConfig().addIndex(habitat, ServerEnvironment.DEFAULT_INSTANCE_NAME);
  Cluster c = server.getCluster();
  if (c != null) {
    ServiceLocatorUtilities.addOneConstant(habitat, c,
        ServerEnvironment.DEFAULT_INSTANCE_NAME, Cluster.class);
  }
}

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

/**
   * Returns if the SystemJMXConnector is secure or not
   *
   * @param instance
   * @return
   */
  public boolean isSecureJMX(String instance) {
    String isSecure = "false";
    if (domain.getServerNamed(instance) != null) {
      if (domain.getServerNamed(instance).getConfig().getAdminService().getSystemJmxConnector() != null) {
        isSecure = domain.getServerNamed(instance).getConfig().getAdminService().getSystemJmxConnector().getSecurityEnabled();
      }
    }
    return Boolean.parseBoolean(isSecure);

  }
}

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

private Config getConfigForName(String name) {
    if (domain.getConfigNamed(name) != null) return domain.getConfigNamed(name);
    if (domain.getServerNamed(name) != null) return domain.getServerNamed(name).getConfig();
    return null;
  }
}

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

private List<Config> createConfigList() {
  // 1. no target specified
  if (!StringUtils.ok(target))
    return allConfigs.getConfig();
  Config c = domain.getConfigNamed(target);
  if (c != null) {
    List<Config> cl = new LinkedList<Config>();
    cl.add(c);
    return cl;
  }
  ReferenceContainer rc = domain.getReferenceContainerNamed(target);
  if (rc == null) return null;
  if (rc.isServer()) {
    Server s =((Server) rc);
    List<Config> cl = new LinkedList<Config>();
    cl.add(s.getConfig());
    return  cl;
  }
  else if (rc.isCluster()) {
    Cluster cluster = (Cluster) rc;
    List<Config> cl = new LinkedList<Config>();
    cl.add(domain.getConfigNamed(cluster.getConfigRef()));
    return cl;
  }
  else return null;
}

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

private List<Config> createConfigList() {
  // 1. no target specified
  if (!StringUtils.ok(target))
    return allConfigs.getConfig();
  Config c = domain.getConfigNamed(target);
  if (c != null) {
    List<Config> cl = new LinkedList<Config>();
    cl.add(c);
    return cl;
  }
  ReferenceContainer rc = domain.getReferenceContainerNamed(target);
  if (rc == null) return null;
  if (rc.isServer()) {
    Server s =((Server) rc);
    List<Config> cl = new LinkedList<Config>();
    cl.add(s.getConfig());
    return  cl;
  }
  else if (rc.isCluster()) {
    Cluster cluster = (Cluster) rc;
    List<Config> cl = new LinkedList<Config>();
    cl.add(domain.getConfigNamed(cluster.getConfigRef()));
    return cl;
  }
  else return null;
}

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

String configOsgiSP = null;
String configDebugSP = null;
for (SystemProperty sp : s.getConfig().getSystemProperty()) {
  if (sp.getName().equals(ADMIN)) {
    configAdminSP = sp.getValue();

代码示例来源:origin: org.glassfish.connectors/connectors-runtime

public void postConstruct() {
  String instanceName = serverEnvironment.getInstanceName();
  Server server = domain.getServerNamed(instanceName);
  Config config = server.getConfig();
  if (config != null) {
    MonitoringService monitoringService = config.getMonitoringService();
    if (monitoringService != null) {
      ModuleMonitoringLevels monitoringLevel = monitoringService.getModuleMonitoringLevels();
      if (monitoringLevel != null) {
        this.monitoringLevel = monitoringLevel;
        ObservableBean bean = (ObservableBean) ConfigSupport.getImpl((ConfigBeanProxy) monitoringLevel);
        bean.addListener(this);
        jdbcPoolMonitoringEnabled = !monitoringLevel.getJdbcConnectionPool().equalsIgnoreCase("OFF");
        connectorPoolMonitoringEnabled = !monitoringLevel.getConnectorConnectionPool().equalsIgnoreCase("OFF");
      }
    }
  }
}

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

String configOsgiSP = null;
String configDebugSP = null;
for (SystemProperty sp : s.getConfig().getSystemProperty()) {
  if (sp.getName().equals(ADMIN)) {
    configAdminSP = sp.getValue();

代码示例来源:origin: org.glassfish.main.resourcebase.resources/nucleus-resources

private void removeListenerForServer() {
  Server server = domain.getServerNamed(environment.getInstanceName());
  ObservableBean bean = (ObservableBean) ConfigSupport.getImpl(server);
  bean.removeListener(this);
  Config config = server.getConfig();
  if (config != null) {
    ((ObservableBean)ConfigSupport.getImpl(config)).removeListener(this);
  }
}

代码示例来源:origin: org.glassfish.main.resourcebase.resources/nucleus-resources

private void addListenerToServer() {
  Server server = domain.getServerNamed(environment.getInstanceName());
  ObservableBean bean = (ObservableBean) ConfigSupport.getImpl(server);
  bean.addListener(this);
  Config config = server.getConfig();
  if (config != null) {
    ((ObservableBean)ConfigSupport.getImpl(config)).addListener(this);
  }
}

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

Set<String> clusterNoReplication = new HashSet<String>();
for (Server s : allInstances) {
  String dynRecfg = s.getConfig().getDynamicReconfigurationEnabled();
  if (Boolean.TRUE.equals(Boolean.valueOf(dynRecfg))) {
    instancesForReplication.add(s);

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

Set<String> clusterNoReplication = new HashSet<String>();
for (Server s : allInstances) {
  String dynRecfg = s.getConfig().getDynamicReconfigurationEnabled();
  if (Boolean.TRUE.equals(Boolean.valueOf(dynRecfg))) {
    instancesForReplication.add(s);

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

if (cluster != null && cluster.containsProperty(propName))
  defs++;
if (server.getConfig().containsProperty(propName))
  defs++;

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

Config scfg = svr.getConfig();
if (!Boolean.valueOf(scfg.getDynamicReconfigurationEnabled())) {

相关文章