Package com.sun.enterprise.util

Examples of com.sun.enterprise.util.LocalStringsImpl


        //  "not-started" == !kInstanceRunningCode
        final int afterCode = getStatus().getStatusCode();
        final int beforeCode = beforeRTStatus.getStatus().getStatusCode();
        final boolean beforeStarted =  (beforeCode == Status.kInstanceRunningCode);
        final boolean afterStarted  =  (afterCode == Status.kInstanceRunningCode);
        LocalStringsImpl stringy = new LocalStringsImpl();
        final String name = getName();
        final String beforeString = beforeRTStatus.getStatus().getStatusString();
        final String afterString = getStatus().getStatusString();
        String result = "";

        if(beforeStarted && afterStarted)
        {
            // normal -- instance was already running
            result = stringy.get("runtimeStatusToStringStartCluster.alreadyStarted", name);
        }
       
        else if(!beforeStarted && afterStarted)
        {
            // normal -- instance was stopped and is now running
            result = stringy.get("runtimeStatusToStringStartCluster.success", name);
        }
        else if(beforeStarted && !afterStarted)
        {
            // this can't happen...
            result = stringy.get("runtimeStatusToStringStartCluster.startedToStopped",
                    name, afterString);
           
            // there is no logger available in this file
            System.err.println(result);
            // Log error
            Vector messages = getRecentErrorMessages();
            for (int i = 0; i < messages.size(); i++) {
                 result += "\n" + stringy.get("error") + " " + i + " " + (String)messages.get(i);
            }
        }
        else if(!beforeStarted && !afterStarted)
        {
            // a "normal" error -- the instance could not be Started.
            result = stringy.get("runtimeStatusToStringStartCluster.error", name, beforeString, afterString);
           
            // Log error
            Vector messages = getRecentErrorMessages();
            for (int i = 0; i < messages.size(); i++) {
                 result += "\n" + stringy.get("error") + " " + i + " " + (String)messages.get(i);
            }
           
        }
       
        return result;
View Full Code Here


        //  "not-stopped" == !kInstanceNotRunningCode
        final int afterCode = getStatus().getStatusCode();
        final int beforeCode = beforeRTStatus.getStatus().getStatusCode();
        final boolean beforeStopped =  (beforeCode == Status.kInstanceNotRunningCode);
        final boolean afterStopped  =  (afterCode == Status.kInstanceNotRunningCode);
        LocalStringsImpl stringy = new LocalStringsImpl();
        final String name = getName();
        final String beforeString = beforeRTStatus.getStatus().getStatusString();
        final String afterString = getStatus().getStatusString();
        String result = "";

        if(beforeStopped && afterStopped)
        {
            // normal -- instance was already stopped
            result = stringy.get("runtimeStatusToStringStopCluster.alreadyStopped", name);
        }
       
        else if(!beforeStopped && afterStopped)
        {
            // normal -- instance was running and was stopped.
            result = stringy.get("runtimeStatusToStringStopCluster.success", name);
        }
        else if(beforeStopped && !afterStopped)
        {
            // this can't happen...
            result = stringy.get("runtimeStatusToStringStopCluster.stoppedToRunning",
                    name, afterString);
           
            // there is no logger available in this file
            System.err.println(result);
        }
        else if(!beforeStopped && !afterStopped)
        {
            // a "normal" error -- the instance could not be stopped.
           
            result = stringy.get("runtimeStatusToStringStopCluster.error", name,
                    beforeString, afterString);
        }
       
    Vector messages = getRecentErrorMessages();
        for (int i = 0; i < messages.size(); i++) {
            result += "\n" + stringy.get("error") + " " + i + " " + (String)messages.get(i);
        }

        return result;
    }
View Full Code Here

        return result;
    }

    private String toStringRegular()
    {
        LocalStringsImpl stringy = new LocalStringsImpl();
        String result = stringy.get("runtimeStatusToString", getName(), getStatus().getStatusString());
        if (isRestartNeeded()) {
            result += ", " + stringy.get("requiresRestartYes");
        } else {
            result += ", " + stringy.get("requiresRestartNo");
        }
       
        Vector messages = getRecentErrorMessages();
        for (int i = 0; i < messages.size(); i++) {
            result += "\n" + stringy.get("error") + " " + i + " " + (String)messages.get(i);
        }

        return result;
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.util.LocalStringsImpl

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.