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; } }
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)); } } }
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()); } } }
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)); } } }
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()); } } }
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; }
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; }
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; }
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; }
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; }
/** * 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; } }
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;
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; } /*
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 "
String host = null; Server targetServer = domain.getServerNamed(target); if (targetServer != null && ! targetServer.isDas()) { port = JmsRaUtil.getJMSPropertyValue(targetServer); host = domain.getNodeNamed(targetServer.getNodeRef()).getNodeHost();
deploymentParams.command = DeployCommandParameters.Command.startup_server; if (domain.isAppReferencedByPaaSTarget(appName)) { if (server.isDas()) {
serverDom.getHabitat().getComponent(ServerEnvironment.class); if (server.isDas()) { if (env.isDas()) {
serverDom.getHabitat().getService(ServerEnvironment.class); if (server.isDas()) { if (env.isDas()) {
new UndeployCommandParameters(); if (server.isDas()) { commandParams.origin = Origin.unload; } else {