Package com.webobjects.monitor._private

Examples of com.webobjects.monitor._private.MInstance


        sendCommandInstancesToWotaskds("STOP");
    }

    public void start(NSArray nsarray) {
        for(Enumeration enumeration = nsarray.objectEnumerator(); enumeration.hasMoreElements();) {
            MInstance minstance = (MInstance) enumeration.nextElement();
            if (minstance.state == MObject.DEAD
                    || minstance.state == MObject.STOPPING
                    || minstance.state == MObject.CRASHING
                    || minstance.state == MObject.UNKNOWN) {
                minstance.state = MObject.STARTING;
View Full Code Here


    public WOActionResults infoAction() {
        ERXResponse woresponse = new ERXResponse();
        String result = "";
        for (Enumeration enumeration = instances.objectEnumerator(); enumeration.hasMoreElements();) {
            MInstance minstance = (MInstance) enumeration.nextElement();
            result += (result.length() == 0 ? "" : ", \n");
            result += "{";
            result += "\"name\": \"" + minstance.applicationName() + "\", ";
            result += "\"id\": \"" + minstance.id() + "\", ";
            result += "\"host\": \"" + minstance.hostName() + "\", ";
            result += "\"port\": \"" + minstance.port() + "\", ";
            result += "\"state\": \"" + MObject.stateArray[minstance.state] + "\", ";
            result += "\"deaths\": \"" + minstance.deathCount() + "\", ";
            result += "\"refusingNewSessions\": " + minstance.isRefusingNewSessions() + ", ";
            result += "\"scheduled\": " + minstance.isScheduled() + ", ";
            result += "\"schedulingHourlyStartTime\": " + minstance.schedulingHourlyStartTime() + ", ";
            result += "\"schedulingDailyStartTime\": " + minstance.schedulingDailyStartTime() + ", ";
            result += "\"schedulingWeeklyStartTime\": " + minstance.schedulingWeeklyStartTime() + ", ";
            result += "\"schedulingType\": \"" + minstance.schedulingType() + "\", ";
            result += "\"schedulingStartDay\": " + minstance.schedulingStartDay() + ", ";
            result += "\"schedulingInterval\": " + minstance.schedulingInterval() + ", ";
            result += "\"transactions\": \"" + minstance.transactions() + "\", ";
            result += "\"activeSessions\": \"" + minstance.activeSessions() + "\", ";
            result += "\"averageIdlePeriod\": \"" + minstance.averageIdlePeriod() + "\", ";
            result += "\"avgTransactionTime\": \"" + minstance.avgTransactionTime() + "\",";
            result += "\"autoRecover\": \"" + minstance.isAutoRecovering() + "\"";
           
            String infoMode = (String) context().request().formValueForKey("info");
            if ("full".equalsIgnoreCase(infoMode)) {
                result += ", \"additionalArgs\": \"";
                if (minstance.additionalArgs() != null) {
                    result += minstance.additionalArgs().replace("\"", "\\\"");
                }
                result += "\"";
            }
            result += "}";
        }
View Full Code Here

            // ignore
          }
        }
        int instancesAlive = 0;
        for (Enumeration enumeration = instances.objectEnumerator(); enumeration.hasMoreElements();) {
            MInstance minstance = (MInstance) enumeration.nextElement();
            if (minstance.state == MObject.ALIVE) {
              instancesAlive++;
            }
        }
        if ((numberOfInstancesRequested == -1 && instancesAlive < instances.count()) || instancesAlive < numberOfInstancesRequested) {
View Full Code Here

    }

    public WOActionResults stoppedAction() {
        ERXResponse woresponse = new ERXResponse("YES");
        for (Enumeration enumeration = instances.objectEnumerator(); enumeration.hasMoreElements();) {
            MInstance minstance = (MInstance) enumeration.nextElement();
            if (minstance.state == MObject.DEAD)
                continue;
            woresponse.setContent("NO");
            woresponse.setStatus(ERXHttpStatusCodes.EXPECTATION_FAILED);
            break;
View Full Code Here

    protected void prepareInstances(NSArray<String> appNamesAndNumbers) {
        if (appNamesAndNumbers == null)
            throw new DirectActionException("at least one instance name needs to be specified for type ins", 406);
        for (Enumeration enumeration = appNamesAndNumbers.objectEnumerator(); enumeration.hasMoreElements();) {
            String s = (String) enumeration.nextElement();
            MInstance minstance = siteConfig().instanceWithName(s);
            if (minstance != null)
                instances.addObject(minstance);
            else
                throw new DirectActionException("Unknown instance " + s, 404);
        }
View Full Code Here

        }
        return false;
    }

    public String pathDiff() {
        MInstance myInstance = myInstance();
        MApplication myApplication = myInstance.application();
        MHost myHost = myInstance.host();
        String appPath = null;

        if (myHost.osType().equals("UNIX")) {
            appPath = myApplication.unixPath();
        } else if (myHost.osType().equals("WINDOWS")) {
            appPath = myApplication.winPath();
        } else if (myHost.osType().equals("MACOSX")) {
            appPath = myApplication.macPath();
        }

        if (!safeEquals(myInstance.path(), appPath)) {
            return _diffString;
        }
        return _emptyString;
    }
View Full Code Here

        }
        return _emptyString;
    }

    public String minDiff() {
        MInstance myInstance = myInstance();
        MApplication myApplication = myInstance.application();
        if (!safeEquals(myInstance.minimumActiveSessionsCount(), myApplication.minimumActiveSessionsCount())) {
            return _diffString;
        }
        return _emptyString;
    }
View Full Code Here

        }
        return _emptyString;
    }

    public String cachingDiff() {
        MInstance myInstance = myInstance();
        MApplication myApplication = myInstance.application();
        if (!safeEquals(myInstance.cachingEnabled(), myApplication.cachingEnabled())) {
            return _diffString;
        }
        return _emptyString;
    }
View Full Code Here

        }
        return _emptyString;
    }

    public String outputDiff() {
        MInstance myInstance = myInstance();
        MApplication myApplication = myInstance.application();
        MHost myHost = myInstance.host();
        String appOutputPath = null;

        if (myHost.osType().equals("UNIX")) {
            appOutputPath = myInstance.generateOutputPath(myApplication.unixOutputPath());
        } else if (myHost.osType().equals("WINDOWS")) {
            appOutputPath = myInstance.generateOutputPath(myApplication.winOutputPath());
        } else if (myHost.osType().equals("MACOSX")) {
            appOutputPath = myInstance.generateOutputPath(myApplication.macOutputPath());
        }

        if (!safeEquals(myInstance.outputPath(), appOutputPath)) {
            return _diffString;
        }
        return _emptyString;
    }
View Full Code Here

        }
        return _emptyString;
    }

    public String browserDiff() {
        MInstance myInstance = myInstance();
        MApplication myApplication = myInstance.application();
        if (!safeEquals(myInstance.autoOpenInBrowser(), myApplication.autoOpenInBrowser())) {
            return _diffString;
        }
        return _emptyString;
    }
View Full Code Here

TOP

Related Classes of com.webobjects.monitor._private.MInstance

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.