Package com.sun.enterprise.admin.servermgmt

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


                    Status.getStatusString(statusCode));
            }
        } catch (InstanceException ex) {
            ex.printStackTrace();           
        }       
        RuntimeStatus result = (RuntimeStatus)get(instanceName);
        if (result == null) {
            result = new RuntimeStatus(instanceName);           
            put(result.getName(), result);
       
        result.setStatus(new Status(newStatusCode));
        return result;
    }
View Full Code Here


              allTargets.addAll(standaloneSet);
              allTargets.addAll(clusterSet);
              Iterator<String> iter = allTargets.iterator();
              while(iter.hasNext()){
                   String targetName = iter.next();
          RuntimeStatus rsts = JMXUtil.getRuntimeStatus(targetName);
              int state = JMXUtil.getRuntimeStatusCode(rsts);
                  if(state == Status.kInstanceRunningCode){
                      targets.add(targetName);
                      if(instanceName.equals(targetName)){
                          notRunning = false;
View Full Code Here

                                //We can only restart a process that is in the running state...Currently we have
                                //a problem in that on Unix platforms instance that are stopped gracefully
                                //exit with a non-zero return code if pinged by the ProcessManagerMonitor
                                //before being completely stopped. This can be reproduced by reducing the sleep
                                //time in the montior and stopping an instance gracefully -- it will be restarted.
                                RuntimeStatus status = InstanceStatus.getInstance().getStatus(pInstance.getName());
                                if (status.isStopped()) {
                                    // set for observer to check status and to setChanged flag so notification will be sent
                                    String clusterName = NodeAgentMain.getClusterName(pInstance.getName());
                                    if (clusterName != null || !clusterName.equals("")) {
                                        HashMap gmsMap = NodeAgentMain.getGMSHandleMap();
                                        GroupManagementService gms = (GroupManagementService) gmsMap.get(clusterName);
                                        if (gms != null) {
                                            GroupHandle gh = gms.getGroupHandle();
                                            try {
                                                getLogger().log(Level.INFO, "GMS WATCHDOG notification to group:"+ clusterName + " that member:" +
                                                            pInstance.getName() + " has failed.");
                                                gh.announceWatchdogObservedFailure(pInstance.getName());
                                            } catch (Error e) {
                                                getLogger().log(Level.FINE, "Exception is ", e);
                                            }
                                        }
                                    }
                                    pInstance.setExitCode(iExit);
                                    // set process to null so ProcessManagerMonitor will
                                    // set notify the ProcessManager again
                                    // exitCode is already stored in ProcessInstance for restart check
                                    pInstance.setProcess(null);
                                    // notify the observers that something has changed after setting process to null
                                    // our jvm uses the same thread to perform notification which is not guarented sematics
                                    // but it was messing me up when it returned
                                    // TODO: Currently the notification & restart will be done on the polling thread, need to put on another
                                    // thread so in case of catastrophic failures, servers can be restarted faster ???
                                    pInstance.notifyObservers();
                                } else {
                                    getLogger().log(Level.FINE, "ProcessManager: did not restart" + pInstance.getName() +
                                        " since it is " + status.getStatus().getStatusString() + " and not running.");
                                }                               
                            } catch (IllegalThreadStateException itse) {
                                // ignore, because it will be the normal case that the process has
                                // not returned.
                                getLogger().log(Level.FINEST, "exitValue exception returned - " + itse.toString());                               
View Full Code Here

    }
    private Map<String, List<Long>> statusList2Map(final RuntimeStatusList list) throws Exception {
        final Map<String, List<Long>> map = new HashMap<String, List<Long>> ();
        int i = 0;
        for (final Object o : list) {
            final RuntimeStatus rs = list.getStatus(i);
            final String name = rs.getName();
            map.put(name, convert(rs));
            i++;
        }
        return ( map );
    }
View Full Code Here

        // 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

        } catch (Exception ex) {
            //Ignore any error indicating that the server is unreachable.
            //FIXTHIS: We could expect the proxy to do this for us as it
            //seems to be a common case.
            if (NodeAgentProxy.isUnreachable(ex)) {
                return new RuntimeStatus(agentName);
            } else {
                throw new AgentException(ex);
            }
        }
    }
View Full Code Here

        private RuntimeStatus _status;

        public GetRuntimeStatusTask(String agentName) {
            super(TIMEOUT_IN_MILLIS);
            _agentName = agentName;
            _status = new RuntimeStatus();
        }
View Full Code Here

            } catch (AgentException ex) {
                StringManagerBase sm = StringManagerBase.getStringManager(
                    getLogger().getResourceBundleName());
                getLogger().log(Level.WARNING,
                    sm.getString("nodeagent.listNodeAgents.Exception", _agentName), ex);
                _status = new RuntimeStatus();
            }
        }
View Full Code Here

                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;
View Full Code Here

        } catch (Exception ex) {
            //Ignore any error indicating that the server is unreachable.
            //FIXTHIS: We could expect the proxy to do this for us as it
            //seems to be a common case.
            if (InstanceProxy.isUnreachable(ex)) {
                return new RuntimeStatus(serverName);
            } else {
                throw new InstanceException(ex);                       
            }
        }
    }      
View Full Code Here

TOP

Related Classes of com.sun.enterprise.admin.servermgmt.RuntimeStatus

Copyright © 2018 www.massapicom. 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.