FileDocCategorySizeDatePackage
Status.javaAPI DocGlassfish v2 API6053Fri May 04 22:33:18 BST 2007com.sun.enterprise.admin.common

Status

public class Status extends Object implements Serializable
Base class for status of a Server side entity. Entities with specific semantics for status are expected to extend this class.

Fields Summary
public static final long
serialVersionUID
public static final int
kInstanceRunningCode
public static final int
kInstanceStartingCode
public static final int
kInstanceStoppingCode
public static final int
kInstanceNotRunningCode
public static final int
kEntityEnabledCode
public static final int
kEntityDisabledCode
public static final int
kClusterPartiallyRunningCode
public static final int
kInstanceSynchronizingCode
public static final int
kInstanceFailedCode
public static final String
kInstanceRunningMsg
public static final String
kInstanceStartingMsg
public static final String
kInstanceStoppingMsg
public static final String
kInstanceNotRunningMsg
public static final String
kUnknownStateMsg
public static final String
kPartiallyRunningMsg
public static final String
kInstanceSynchronizingMsg
public static final String
kInstanceFailedMsg
protected int
mStatusCode
protected String
mStatusString
Constructors Summary
protected Status()
Create new status. The sub-classes must set protected instance variables mStatusCode and mStatusString appropriately.

   
    
    
        // use localized strings...
        String pre = "admin.common.status.";
        LocalStringsImpl ls = new LocalStringsImpl();
        
        kInstanceRunningMsg         = ls.get(pre + "0");
        kInstanceStartingMsg        = ls.get(pre + "1");
        kInstanceStoppingMsg        = ls.get(pre + "2");
        kInstanceNotRunningMsg      = ls.get(pre + "3");
        kUnknownStateMsg            = ls.get(pre + "4");
        kPartiallyRunningMsg        = ls.get(pre + "6");
        kInstanceSynchronizingMsg   = ls.get(pre + "7");
        kInstanceFailedMsg          = ls.get(pre + "8");
    
    
public Status(int code, String str)
Creates new Status.

        mStatusCode = code;
        mStatusString = str;
    
public Status(int code)

        mStatusCode = code;
        mStatusString = getStatusString(code);
    
Methods Summary
public intgetStatusCode()
Returns the status code for this Status.

return
status code

            return mStatusCode;
    
public java.lang.StringgetStatusString()
Returns the status string for this Status.

return
string representing status

            return mStatusString;
    
public static java.lang.StringgetStatusString(int code)

        String status = kUnknownStateMsg;
        switch (code)
        {
            case kInstanceNotRunningCode :
                status = kInstanceNotRunningMsg;
                break;
            case kInstanceRunningCode :
                status = kInstanceRunningMsg;
                break;
            case kInstanceStartingCode :
                status = kInstanceStartingMsg;
                break;
            case kInstanceFailedCode :
                status = kInstanceFailedMsg;
                break;
            case kInstanceStoppingCode :
                status = kInstanceStoppingMsg;
                break;
            case kClusterPartiallyRunningCode :
                status = kPartiallyRunningMsg;
                break;
            case kInstanceSynchronizingCode :
                status = kInstanceSynchronizingMsg;
                break;
            default :
                break;
        }
        return status;
    
public java.lang.StringtoString()
Returns statusCode : statusString

        return (mStatusCode + " : " + mStatusString);