Examples of RuntimeStatusList


Examples of com.sun.enterprise.admin.servermgmt.RuntimeStatusList

  }

    public int
  getstate()
  {
    final RuntimeStatusList rsl = getRuntimeStatus();
    int state = rsl.anyRunning() ?
      StateManageable.STATE_RUNNING : StateManageable.STATE_STOPPED;
    return state;
  }
View Full Code Here

Examples of com.sun.enterprise.admin.servermgmt.RuntimeStatusList

    public RuntimeStatusList stopCluster(String autoHadbOverride, String clusterName)
    throws InstanceException
    {
        boolean stopHadb = getAutoHadb(autoHadbOverride, clusterName);
       
        RuntimeStatusList ret = null;
       
        // stop cluster first -- then HADB
       
        ret = getClustersConfigBean().stopCluster(clusterName);
       
View Full Code Here

Examples of com.sun.enterprise.admin.servermgmt.RuntimeStatusList

    {
        try {                  
            ConfigContext configContext = getConfigContext();
            Target target = TargetBuilder.INSTANCE.createTarget(
                DOMAIN_TARGET, VALID_TYPES, targetName, configContext);     
            RuntimeStatusList result = new RuntimeStatusList()
            if (target.getType() == TargetType.NODE_AGENT) {
                //Get status for the specified node agent               
        result.add(getNodeAgentsConfigBean().getRuntimeStatus(
                    target.getNodeAgents()[0].getName()));
            } else if (target.getType() == TargetType.DOMAIN) {
                //Get status for all node agents and server instances in the domain
                final Server[] servers = target.getServers();
                final int numServers = servers.length;
                final NodeAgent[] agents = target.getNodeAgents();
                final int numAgents = agents.length;                           
                for (int i = 0; i < numServers; i++) {               
                    result.add(getServersConfigBean().getRuntimeStatus(
                        servers[i].getName()));
                }
                for (int i = 0; i < numAgents; i++) {
                    result.add(getNodeAgentsConfigBean().getRuntimeStatus(
                        agents[i].getName()));
                }
            } else {                       
                //Get status for the instance or instances in the specified cluster
                final Server[] servers = target.getServers();         
                final int numServers = servers.length;
                //Check for a zero length cluster as a special case we would like
                //to report a non-running status.
                if (numServers == 0 && target.getType() == TargetType.CLUSTER) {                   
                    result.add(getClustersConfigBean().getRuntimeStatus(
                        target.getClusters()[0].getName()));
                } else {                                  
                    for (int i = 0; i < numServers; i++) {               
                        result.add(getServersConfigBean().getRuntimeStatus(
                            servers[i].getName()));
                    }
                }
            }
            return result;
View Full Code Here

Examples of com.sun.enterprise.admin.servermgmt.RuntimeStatusList

            throw new InstanceException(e);
        }
    }
    private Map<String, List<Long>> getHealthFromJMX(final String cluster) throws InstanceException {
        try {
            final RuntimeStatusList list = invokeClusterMBeanForStatus(cluster);
            final Map<String, List<Long>> map = statusList2Map(list);
            return ( map );
        } catch(final Exception e) {
            throw new InstanceException(e);
        }
View Full Code Here

Examples of com.sun.enterprise.admin.servermgmt.RuntimeStatusList

    private RuntimeStatusList invokeClusterMBeanForStatus(final String cluster) throws Exception {
        final ObjectName on                     = EEConfigMBeanObjectNames.getClusterConfigMBeanObjectName(cluster);
        final MBeanServerConnection mbsc        = MBeanServerFactory.getMBeanServer();
        final String m                          = "getRuntimeStatus";
       
        final RuntimeStatusList l = (RuntimeStatusList) mbsc.invoke(on, m, null, null);
        return ( l );
    }
View Full Code Here

Examples of com.sun.enterprise.admin.servermgmt.RuntimeStatusList

       
        // get EEInstancesManager and get instances that currently physically
        // exist in repository
        HashMap hmInstances = new HashMap();

        RuntimeStatusList rtstatusList =
            eeInstancesManager.getRuntimeStatus(instanceConfig);
        RuntimeStatus rtstatus = null;
        for (int i = 0; i < rtstatusList.size(); i++) {
            rtstatus = rtstatusList.getStatus(i);
            hmInstances.put(rtstatus.getName(), rtstatus.getStatus());
        }
        return hmInstances;
    }
View Full Code Here

Examples of com.sun.enterprise.admin.servermgmt.RuntimeStatusList

        for (int i = 0; i < agents.length; i++) {
            tasks[i] = new GetRuntimeStatusTask(agents[i].getName());
        }
        Executor exec = new Executor(tasks);
        exec.run();
        RuntimeStatusList result = new RuntimeStatusList(agents.length);
        for (int i = 0; i < agents.length; i++) {
            result.add(tasks[i].getStatus());
        }
        return result;
    }
View Full Code Here

Examples of com.sun.enterprise.admin.servermgmt.RuntimeStatusList

                configContext);
            final NodeAgent[] agents = target.getNodeAgents();
            final int numAgents = agents.length;
            String[] result = new String[numAgents];
            String nodeAgentName = null;
            RuntimeStatusList statusList = null;
            if (andStatus) {
                //Fetch the status of all the node agents in parallel
                statusList = getRuntimeStatus(agents);
            }
            for (int i = 0; i < numAgents; i++) {
                nodeAgentName = agents[i].getName();
                if (andStatus) {
                    result[i] = stringMgr.getString("listAgentElement", nodeAgentName,
                        (statusList.getStatus(i)).toShortString());
                } else {
                    result[i] = nodeAgentName;
                }
            }
            return result;
View Full Code Here

Examples of com.sun.enterprise.admin.servermgmt.RuntimeStatusList

            int numClusters = result.length;
            for (int i = 0; i < numClusters; i++)
            {
                final String name = result[i];
                if (withStatus) {
                    final RuntimeStatusList statusList = getRuntimeStatus(name);
                    result[i] = stringMgr.getString("listInstanceElement", name,
                        statusList.toString());                               
                } else {
                    result[i] = name;
                }
            }
            return result;
View Full Code Here

Examples of com.sun.enterprise.admin.servermgmt.RuntimeStatusList

        }         
    }
       public RuntimeStatusList startCluster(String clusterName)
        throws InstanceException
    {
        RuntimeStatusList beforeStatus = getRuntimeStatus(clusterName);
        String[] servers = null;
        try {
            servers = getServersInCluster(clusterName);
        } catch (ConfigException ce) {
            throw new InstanceException(_strMgr.getString("configException", clusterName));
        }
        List<String> members = Arrays.asList(servers);
        if (beforeStatus.isEmpty()) {
            //no instances
            throw new InstanceException(_strMgr.getString("clusterIsEmpty",
                clusterName));
        } else if (beforeStatus.allRunning()) {
            //already started
            for (Object rso : beforeStatus)
            {
                RuntimeStatus rs = (RuntimeStatus)rso;
                rs.resetRecentErrorMessages();
            }
            return  beforeStatus;
        } else {
            ArrayList msgsList = new ArrayList();
            RuntimeStatusList afterStatus = null;
            try {
                announceClusterStartState(clusterName, INITIATED, members);
                doStartCluster(clusterName, servers, msgsList);
                afterStatus = getRuntimeStatus(clusterName);
            } finally {
                if (afterStatus != null && afterStatus.allRunning()) {
                    announceClusterStartState(clusterName, COMPLETED_SUCCESS, members);
                    for (int i = 0; i < afterStatus.size(); i++) {
                        // this will get us a special error message from RuntimeStatus.toString()
                        afterStatus.getStatus(i).setStartClusterFlag(beforeStatus.getStatus(i));
                    }
                } else {
                    announceClusterStartState(clusterName, COMPLETED_FAILED, getFailedMembers(afterStatus));
                    boolean bAny = afterStatus != null ? afterStatus.anyRunning() : false;
                    String msg = _strMgr.getString(bAny ? "clusterNotFullyStarted" : "clusterNotStarted", clusterName);
                    for (int i = 0; i < msgsList.size(); i++) {
                    msg = msg + "\n" + msgsList.get(i);
                }
                    if (bAny) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.