Package com.sun.enterprise.admin.common

Examples of com.sun.enterprise.admin.common.Status


        String name,
        InstancesManager manager) throws InstanceException
    {               
        int status = manager.getInstanceStatus();         
        return new RuntimeStatus(name, manager.isRestartNeeded(),
            new Status(status, Status.getStatusString(status)),
            FileandSyslogHandler.getRecentErrorMessages());       
    }      
View Full Code Here


    {
        FileandSyslogHandler.clearRecentErrorMessages();
    }
   
    public RuntimeStatus() {        
        this ("", true, new Status(Status.kInstanceNotRunningCode,
            Status.kInstanceNotRunningMsg), new Vector());
    }
View Full Code Here

     public static String getStatusForDisplay(String objName){
                String status = null;
                try {
                    RuntimeStatus sts = (RuntimeStatus)JMXUtil.invoke(objName, "getRuntimeStatus", null, null);
                        boolean restartNeeded = ((RuntimeStatus)sts).isRestartNeeded();
                        Status s = ((RuntimeStatus)sts).getStatus();
                        int statusCode = s.getStatusCode();
                        String statusString = "";
                        String imageString = "";
                        switch (statusCode) {
                            case Status.kInstanceStartingCode: {
                                imageString = AMXUtil.getStatusImage(StateManageable.STATE_STARTING);
View Full Code Here

     public static int getRuntimeStatusCode(RuntimeStatus rsts) {
       int statusCode = -1;

  if(rsts != null) {
    Status status = rsts.getStatus();
    if(status != null) {
      statusCode = status.getStatusCode();
    }
  }
  return statusCode;

     }
View Full Code Here

     */   
    public synchronized RuntimeStatus getStatus(String instanceName) {
        RuntimeStatus result = (RuntimeStatus)get(instanceName);
        if (result == null) {
            result = new RuntimeStatus(instanceName);
            result.setStatus(new Status(Status.kInstanceNotRunningCode));
            put(result.getName(), result);
        }
        //If we are in the state of running or not running, then we need to ensure
        //that our internal state is in sync with that of the admin channel. We need to
        //avoid our internal state getting out of sync.
View Full Code Here

     */   
    public synchronized RuntimeStatus updateStatus(String instanceName,
        int statusCode)
    {
        RuntimeStatus result = getStatus(instanceName);
        result.setStatus(new Status(statusCode));
        return result;
    }
View Full Code Here

    {              
        RuntimeStatus result = getStatus(instanceName);
        if (result.getStatus().getStatusCode() != requiredStatusCode) {       
            return false;
        } else {
            result.setStatus(new Status(newStatusCode));        
            return true;
        }
    }
View Full Code Here

        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

            if (nodeController != null) {
                // get instances that currently reside in repository
                HashMap hmInstances=getInstancesAndStatus();
                Iterator serverIt=hmInstances.keySet().iterator();
                String instanceName=null;
                Status instanceStatus=null;
                ArrayList runningInstances = new ArrayList();
                //Get a list of the running server instances
                while(serverIt.hasNext()) {
                    // get instance name of server
                    instanceName=(String)serverIt.next();
                    instanceStatus=(Status)hmInstances.get(instanceName);
                    if (bDebug) System.out.println("Shutdown processing, " +
                      "seeing if need to shutdown - " + instanceName  +
                      " with status " + instanceStatus);
                  
                    if (instanceStatus != null &&
                        instanceStatus.getStatusCode() ==
                            Status.kInstanceRunningCode) {
                        // stop instance
                        if (bDebug) System.out.println("Shutdown processing, "
                                           + "shutting down - " + instanceName);
                        getLogger().log(Level.FINE,
View Full Code Here

    * @param instance name of the instance
    */
    private boolean isInstanceStarted(String instance) {
  try {
      HashMap h = getInstancesAndStatus();
      Status s = (Status) h.get(instance);
      if (s.getStatusCode() == Status.kInstanceRunningCode ||
          s.getStatusCode() == Status.kInstanceStoppingCode ||
          s.getStatusCode() == Status.kInstanceStartingCode ) {
          return true;
      }
  } catch(Exception e){
      //ignore
        }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.admin.common.Status

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.