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

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

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

Server.isDas介绍

暂无

代码示例

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

private boolean loadAppOnDAS(String appName) {
    if (server.isDas()) {
      List<String> targets = domain.getAllReferencedTargetsForApplication(appName);
      for (String target : targets) {
        if (!DeploymentUtils.isDASTarget(target)) {
          // if application is referenced by any non-DAS target 
          // we need to partially load it on DAS
          return true;
        }
      }
    } 
    return false;
  }
}

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

private void createLocalServerList() {
  for (Server server : allServers) {
    if (server.isDas())
      serversOnHost.add(new ServerPorts(domain, server));
    else if (NetUtils.isThisHostLocal(server.getAdminHost())) {
      serversOnHost.add(new ServerPorts(domain, server));
    }
  }
}

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

public HealthHistory(Cluster cluster) {
  healthMap = new ConcurrentHashMap<String, InstanceHealth>(
    cluster.getInstances().size());
  for (Server server : cluster.getInstances()) {
    if (server.isDas()) {
      continue;
    }
    if (GMSBS_LOGGER.isLoggable(LogLevel.FINE)) {
      GMSBS_LOGGER.log(LogLevel.FINE, String.format(
        "instance name in HealthHistory constructor %s",
        server.getName()));
    }
    if (healthMap.putIfAbsent(server.getName(),
      new InstanceHealth(STATE.NOT_RUNNING, NOTIME)) != null) {
      GMSBS_LOGGER.log(LogLevel.WARNING, GMS_DUPLICATE_INSTANCE, server.getName());
    }
  }
}

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

private void createLocalServerList() {
  for (Server server : allServers) {
    if (server.isDas())
      serversOnHost.add(new ServerPorts(domain, server));
    else if (NetUtils.isThisHostLocal(server.getAdminHost())) {
      serversOnHost.add(new ServerPorts(domain, server));
    }
  }
}

代码示例来源:origin: eclipse-ee4j/glassfish

public HealthHistory(Cluster cluster) {
  healthMap = new ConcurrentHashMap<String, InstanceHealth>(
    cluster.getInstances().size());
  for (Server server : cluster.getInstances()) {
    if (server.isDas()) {
      continue;
    }
    if (GMSBS_LOGGER.isLoggable(LogLevel.FINE)) {
      GMSBS_LOGGER.log(LogLevel.FINE, String.format(
        "instance name in HealthHistory constructor %s",
        server.getName()));
    }
    if (healthMap.putIfAbsent(server.getName(),
      new InstanceHealth(STATE.NOT_RUNNING, NOTIME)) != null) {
      GMSBS_LOGGER.log(LogLevel.WARNING, GMS_DUPLICATE_INSTANCE, server.getName());
    }
  }
}

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

private boolean isCurrentInstanceMatchingTarget(Object parent) {
  // DAS receive all the events, so we need to figure out 
  // whether we should take action on DAS depending on the event
  if (parent instanceof ApplicationRef) {
    Object grandparent = ((ApplicationRef)parent).getParent();
    if (grandparent instanceof Server) {
      Server gpServer = (Server)grandparent;      
      if ( ! server.getName().equals(gpServer.getName())) {
        return false; 
      }
    } else if (grandparent instanceof Cluster) {
      if (server.isDas()) {
        return false; 
      }
    }
  }
  return true;
}

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

private boolean loadOnCurrentInstance(DeploymentContext context) {
  final DeployCommandParameters commandParams = context.getCommandParameters(DeployCommandParameters.class);
  final Properties appProps = context.getAppProps();
  if (commandParams.enabled) {
    // if the current instance match with the target
    if (domain.isCurrentInstanceMatchingTarget(commandParams.target, commandParams.name(), server.getName(), context.getTransientAppMetaData(DeploymentProperties.PREVIOUS_TARGETS, List.class))) {
      return true;
    }
    if (server.isDas()) {
      String objectType = 
        appProps.getProperty(ServerTags.OBJECT_TYPE);
      if (objectType != null) {
        // if it's a system application needs to be loaded on DAS
        if (objectType.equals(DeploymentProperties.SYSTEM_ADMIN) || 
          objectType.equals(DeploymentProperties.SYSTEM_ALL)) {
          return true;
        }
      }
    }
  }
  return false;
}

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

public Set<String> getTargetsReferringResourceRef(String refName) {
  Set<String> targets = new HashSet<String>();
  List<Server> servers = domain.getServers().getServer();
  for(Server server: servers){
    if(server.getResourceRef(refName) != null){
      if(server.getCluster() != null){
        targets.add(server.getCluster().getName());
      }else if(server.isDas()){
        targets.add(SystemPropertyConstants.DAS_SERVER_NAME);
      }else if(server.isInstance()){
        targets.add(server.getName());
      }
    }
  }
  return targets;
}

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

public Set<String> getTargetsReferringResourceRef(String refName) {
  Set<String> targets = new HashSet<String>();
  List<Server> servers = domain.getServers().getServer();
  for(Server server: servers){
    if(server.getResourceRef(refName) != null){
      if(server.getCluster() != null){
        targets.add(server.getCluster().getName());
      }else if(server.isDas()){
        targets.add(SystemPropertyConstants.DAS_SERVER_NAME);
      }else if(server.isInstance()){
        targets.add(server.getName());
      }
    }
  }
  return targets;
}

代码示例来源:origin: fujitsu/launcher

private boolean loadOnCurrentInstance(DeploymentContext context) {
  final DeployCommandParameters commandParams = context.getCommandParameters(DeployCommandParameters.class);
  final Properties appProps = context.getAppProps();
  if (commandParams.enabled) {
    // if the current instance match with the target
    if (domain.isCurrentInstanceMatchingTarget(commandParams.target, commandParams.name(), server.getName(), context.getTransientAppMetaData(DeploymentProperties.PREVIOUS_TARGETS, List.class))) {
      return true;
    }
    if (server.isDas()) {
      String objectType = 
        appProps.getProperty(ServerTags.OBJECT_TYPE);
      if (objectType != null) {
        // if it's a system application needs to be loaded on DAS
        if (objectType.equals(DeploymentProperties.SYSTEM_ADMIN) || 
          objectType.equals(DeploymentProperties.SYSTEM_ALL)) {
          return true;
        }
      }
    }
  }
  return false;
}

代码示例来源:origin: org.glassfish.main.deployment/dol

/**
   * Copy from ApplicationLifeCycle.java
   */
  private boolean loadOnCurrentInstance() {
    final DeployCommandParameters commandParams = dc.getCommandParameters(DeployCommandParameters.class);
    final Properties appProps = dc.getAppProps();
    if (commandParams.enabled) {
      // if the current instance match with the target
      if (domain.isCurrentInstanceMatchingTarget(commandParams.target, commandParams.name(), server.getName(),
          dc.getTransientAppMetaData(DeploymentProperties.PREVIOUS_TARGETS, List.class))) {
        return true;
      }
      if (server.isDas()) {
        String objectType =
            appProps.getProperty(ServerTags.OBJECT_TYPE);
        if (objectType != null) {
          // if it's a system application needs to be loaded on DAS
          if (objectType.equals(DeploymentProperties.SYSTEM_ADMIN) ||
              objectType.equals(DeploymentProperties.SYSTEM_ALL)) {
            return true;
          }
        }
      }
    }
    return false;
  }
}

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

if (server.isDas() && !configRef.equals(SystemPropertyConstants.DAS_SERVER_CONFIG)) {
  logger.warning(ConfigApiLoggerInfo.configRefDASconfig);
  return false;
if (!server.isDas() && configRef.equals(SystemPropertyConstants.DAS_SERVER_CONFIG)) {
  logger.warning(ConfigApiLoggerInfo.configRefServerconfig);
  return false;

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

protected CommandTarget getTypeForTarget(String target){
  Domain domain = Globals.get(Domain.class);
  Config config = domain.getConfigNamed(target);
  if (config != null)
    return CommandTarget.CONFIG;
  Server targetServer = domain.getServerNamed(target);
  if (targetServer!=null) {
    // Clusters clusters = domain.getClusters();
    // List clustersList = clusters.getCluster();
    //if (JmsRaUtil.isServerClustered(clustersList, target))
     //  return CommandTarget.CLUSTERED_INSTANCE;
    if (targetServer.isDas())
      return CommandTarget.DAS;
    else return CommandTarget.STANDALONE_INSTANCE;
  }//end if (targetServer!=null)
  Cluster cluster =domain.getClusterNamed(target);
  if (cluster!=null) {
    return CommandTarget.CLUSTER;
  }
  return CommandTarget.DAS;
}
  /*

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

if (server.isDas() && !configRef.equals(SystemPropertyConstants.DAS_SERVER_CONFIG)) {
  logger.warning(localStrings.getLocalString("configref.dasconfig",
      "The configuration of the Domain Administration Server "
if (!server.isDas() && configRef.equals(SystemPropertyConstants.DAS_SERVER_CONFIG)) {
  logger.warning(localStrings.getLocalString("configref.serverconfig",
      "The configuration of the Domain Administration Server "

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

String host = null;
Server targetServer = domain.getServerNamed(target);
  if (targetServer != null && ! targetServer.isDas()) {
    port = JmsRaUtil.getJMSPropertyValue(targetServer);
    host = domain.getNodeNamed(targetServer.getNodeRef()).getNodeHost();

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

deploymentParams.command = DeployCommandParameters.Command.startup_server;
if (domain.isAppReferencedByPaaSTarget(appName)) {
  if (server.isDas()) {

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

serverDom.getHabitat().getComponent(ServerEnvironment.class);
if (server.isDas()) {
  if (env.isDas()) {

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

serverDom.getHabitat().getService(ServerEnvironment.class);
if (server.isDas()) {
  if (env.isDas()) {

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

new UndeployCommandParameters();
if (server.isDas()) {
  commandParams.origin = Origin.unload;
} else {

相关文章