Examples of ProcessInfoSnapshot


Examples of org.rhq.core.system.ProcessInfo.ProcessInfoSnapshot

            Thread.sleep(SECONDS.toMillis(2));
        }
    }

    private ProcessInfoSnapshot getProcessInfoSnapshot() {
        ProcessInfoSnapshot processInfoSnapshot = (processInfo == null) ? null : processInfo.freshSnapshot();
        if (processInfoSnapshot == null || !processInfoSnapshot.isRunning()) {
            processInfo = getResourceContext().getNativeProcess();
            // Safe to get prior snapshot here, we've just recreated the process info instance
            processInfoSnapshot = (processInfo == null) ? null : processInfo.priorSnaphot();
        }
        return processInfoSnapshot;
View Full Code Here

Examples of org.rhq.core.system.ProcessInfo.ProcessInfoSnapshot

        processInfo = null;
        super.stop();
    }

    public AvailabilityType getAvailability() {
        ProcessInfoSnapshot processInfoSnapshot = getProcessInfoSnapshot();
        return (processInfoSnapshot != null && processInfoSnapshot.isRunning()) ? UP : DOWN;
    }
View Full Code Here

Examples of org.rhq.core.system.ProcessInfo.ProcessInfoSnapshot

        ProcessInfoSnapshot processInfoSnapshot = getProcessInfoSnapshot();
        return (processInfoSnapshot != null && processInfoSnapshot.isRunning()) ? UP : DOWN;
    }

    private ProcessInfoSnapshot getProcessInfoSnapshot() {
        ProcessInfoSnapshot processInfoSnapshot = (processInfo == null) ? null : processInfo.freshSnapshot();
        if (processInfoSnapshot == null || !processInfoSnapshot.isRunning()) {
            processInfo = getResourceContext().getNativeProcess();
            // Safe to get prior snapshot here, we've just recreated the process info instance
            processInfoSnapshot = (processInfo == null) ? null : processInfo.priorSnaphot();
        }
        return processInfoSnapshot;
View Full Code Here

Examples of org.rhq.core.system.ProcessInfo.ProcessInfoSnapshot

    }

    @Override
    public AvailabilityType getAvailability() {
        try {
            ProcessInfoSnapshot snapshot = getFreshSnapshot();
            return (snapshot != null && snapshot.isRunning()) ? UP : DOWN;
        } catch (Exception e) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("Failed to get process info", e);
            }
            return DOWN;
View Full Code Here

Examples of org.rhq.core.system.ProcessInfo.ProcessInfoSnapshot

            return DOWN;
        }
    }

    private ProcessInfoSnapshot getFreshSnapshot() throws Exception {
        ProcessInfoSnapshot snapshot = (process == null) ? null : process.freshSnapshot();
        if (snapshot == null || !snapshot.isRunning()) {
            process = findProcess(processComponentConfig, resourceContext.getSystemInformation());
            // Safe to get prior snapshot here, we've just recreated the process info instance
            snapshot = (process == null) ? null : process.priorSnaphot();
        }
        return snapshot;
View Full Code Here

Examples of org.rhq.core.system.ProcessInfo.ProcessInfoSnapshot

        }
    }

    @Override
    public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) {
        ProcessInfoSnapshot snapshot;
        try {
            snapshot = getFreshSnapshot();
            if (snapshot == null || !snapshot.isRunning()) {
                return;
            }
        } catch (Exception e) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("Failed to get process info", e);
View Full Code Here

Examples of org.rhq.core.system.ProcessInfo.ProcessInfoSnapshot

    @Override
    public AvailabilityType getAvailability() {
        try {
            // Get a fresh snapshot of the process
            ProcessInfoSnapshot processInfoSnapshot = (this.processInfo == null) ? null : this.processInfo
                .freshSnapshot();
            if (processInfoSnapshot == null || !processInfoSnapshot.isRunning()) {
                this.processInfo = getSSHDProcess();
                // Safe to get prior snapshot here, we've just recreated the process info instance
                processInfoSnapshot = (this.processInfo == null) ? null : this.processInfo.priorSnaphot();
            }
            return (this.processInfo != null && processInfoSnapshot.isRunning()) ? AvailabilityType.UP
                : AvailabilityType.DOWN;
        } catch (Exception e) {
            if (log.isDebugEnabled()) {
                log.debug("failed to get availability: " + ThrowableUtil.getAllMessages(e));
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.