Package org.rhq.core.pluginapi.operation

Examples of org.rhq.core.pluginapi.operation.OperationServicesResult


                // job has completed than the one being waited on.
                while (!completedJobs.containsKey(jobId)) {
                    callbackLock.wait();
                }
            } catch (Exception e) {
                OperationServicesResult result = new OperationServicesResult(OperationServicesResultCode.FAILURE);
                result.setErrorStackTrace(StringUtil.getStackTrace(e));

                return result;
            }
        }

        OperationServicesResult result = completedJobs.get(jobId);
        completedJobs.remove(jobId);

        return result;
    }
View Full Code Here


        return result;
    }

    public void operationSucceeded(String jobId, Configuration result, long invocationTime, long completionTime) {
        OperationServicesResult operationServicesResult = new OperationServicesResult(
            OperationServicesResultCode.SUCCESS);
        operationServicesResult.setComplexResults(result);

        completedJobs.put(jobId, operationServicesResult);
        synchronized (callbackLock) {
            callbackLock.notifyAll();
        }
View Full Code Here

        }
    }

    public void operationFailed(String jobId, Configuration result, ExceptionPackage error, long invocationTime,
        long completionTime) {
        OperationServicesResult operationServicesResult = new OperationServicesResult(
            OperationServicesResultCode.FAILURE);
        operationServicesResult.setComplexResults(result);
        operationServicesResult.setErrorStackTrace(error.getStackTraceString());

        completedJobs.put(jobId, operationServicesResult);
        synchronized (callbackLock) {
            callbackLock.notifyAll();
        }
View Full Code Here

        }
    }

    public void operationCanceled(String jobId, Configuration result, ExceptionPackage error, long invocationTime,
        long canceledTime) {
        OperationServicesResult operationServicesResult = new OperationServicesResult(
            OperationServicesResultCode.CANCELED);
        operationServicesResult.setComplexResults(result);
        operationServicesResult.setErrorStackTrace(error.getStackTraceString());

        completedJobs.put(jobId, operationServicesResult);
        synchronized (callbackLock) {
            callbackLock.notifyAll();
        }
View Full Code Here

            callbackLock.notifyAll();
        }
    }

    public void operationTimedOut(String jobId, long invocationTime, long timeoutTime) {
        OperationServicesResult operationServicesResult = new OperationServicesResult(
            OperationServicesResultCode.TIMED_OUT);

        completedJobs.put(jobId, operationServicesResult);
        synchronized (callbackLock) {
            callbackLock.notifyAll();
View Full Code Here

        Configuration config = null;
        if (tokens.length > 2)
            config = createConfigurationFromString(tokens[2]);

        OperationServicesResult res = operationServices.invokeOperation(operationContext, tokens[1], config, 2000);
        if (res.getResultCode() == OperationServicesResultCode.FAILURE) {
            System.err.println("Failure executing the operation: \n" + res.getErrorStackTrace());
        } else if (res.getResultCode() == OperationServicesResultCode.TIMED_OUT) {
            System.err.println("Operation timed out ");
        } else if (res.getResultCode() == OperationServicesResultCode.CANCELED) {
            System.err.println("Operation was canceled ");
        } else {
            Configuration result = res.getComplexResults();
            if (result == null)
                System.out.println("Operation did not return a result");
            else
                System.out.println(result.getProperties());
        }
View Full Code Here

        if (serverComponent.getAvailability() == AvailabilityType.UP)
            code = OperationServicesResultCode.SUCCESS;
        else
            code = OperationServicesResultCode.FAILURE;

        OperationServicesResult result = new OperationServicesResult(code);

        return result;
    }
View Full Code Here

        if (serverComponent.getAvailability() == AvailabilityType.DOWN)
            code = OperationServicesResultCode.SUCCESS;
        else
            code = OperationServicesResultCode.FAILURE;

        OperationServicesResult result = new OperationServicesResult(code);

        return result;
    }
View Full Code Here

        this.serverComponent = serverComponent;
        this.operationServices = operationContext.getOperationServices();
    }

    public OperationServicesResult start() {
        OperationServicesResult result = operationServices.invokeOperation(operationContext, "start", null,
            CONTROL_ACTION_TIMEOUT);
        return result;
    }
View Full Code Here

    public OperationServicesResult stop() {
        if (!isRunning()) {
            throw new IllegalStateException("The server is not running.");
        }

        OperationServicesResult result = operationServices.invokeOperation(operationContext, "shutdown_via_jmx", null,
            CONTROL_ACTION_TIMEOUT);
        return result;
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.pluginapi.operation.OperationServicesResult

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.