Package org.rhq.modules.plugins.jbossas7.json

Examples of org.rhq.modules.plugins.jbossas7.json.ReadAttribute


         for (MeasurementScheduleRequest req : metrics) {
            if (req.getName().equals("appuid")) {

                Address addr = new Address("core-service=platform-mbean,type=runtime");
                ReadAttribute op = new ReadAttribute(addr,"system-properties");
                ASConnection conn = parent.getASConnection();
                ComplexResult result = conn.executeComplex(op);

                if (result.isSuccess()) {
                    Map<String,Object> data = result.getResult();
View Full Code Here


    @SuppressWarnings("unchecked")
    public OperationResult invokeOperation(String name,
                                           Configuration parameters) throws  Exception {

        if (name.equals("get-all-thread-ids")) {
            Operation op = new ReadAttribute(getAddress(), "all-thread-ids");
            Result res = getASConnection().execute(op);
            OperationResult operationResult;
            if (res.isSuccess()) {
                List<Long> ids = (List<Long>) res.getResult();
                operationResult = new OperationResult(ids.toString());
View Full Code Here

        }
        return results;
    }

    private Result executeRead(ASConnection asConnection) {
        return asConnection.execute(new ReadAttribute(new Address("/"), "product-version"));
    }
View Full Code Here

        Address ejb3SubsystemAddress = new Address();
        ejb3SubsystemAddress.add("profile", "full");
        ejb3SubsystemAddress.add("subsystem", "ejb3");
        Result readAttributeResult = getDomainControllerASConnection().execute(
            new ReadAttribute(ejb3SubsystemAddress, "default-singleton-bean-access-timeout"));

        assertTrue(readAttributeResult.isSuccess(), readAttributeResult.getFailureDescription());

        Integer defaultSingletonBeanAccessTimeout = (Integer) readAttributeResult.getResult();
View Full Code Here

    }

    private boolean waitUntilReloaded() throws InterruptedException {
        boolean reloaded = false;
        while (!reloaded) {
            Operation op = new ReadAttribute(new Address(), "release-version");
            try {
                Result res = getASConnection().execute(op);
                if (res.isSuccess() && !res.isReloadRequired()) {
                    reloaded = true;
                }
View Full Code Here

        assertTrue(response.isSuccess(), getFailureMessage(response));

        Address ejb3SubsystemAddress = new Address();
        ejb3SubsystemAddress.add("subsystem", "ejb3");
        Result readAttributeResult = getStandaloneASConnection().execute(
            new ReadAttribute(ejb3SubsystemAddress, "default-singleton-bean-access-timeout"));

        assertTrue(readAttributeResult.isSuccess(), readAttributeResult.getFailureDescription());

        Integer defaultSingletonBeanAccessTimeout = (Integer) readAttributeResult.getResult();
View Full Code Here

    }

    public void testCompositeReadAttribute() throws Exception {
        Address a = new Address("profile=default,subsystem=web,connector=http");
        CompositeOperation cop = new CompositeOperation();
        Operation step1 = new ReadAttribute(a, "maxTime");
        cop.addStep(step1);
        Operation step2 = new ReadAttribute(a, "processingTime");
        cop.addStep(step2);

        ComplexResult res = getDomainControllerASConnection().executeComplex(cop);
        assertNotNull(res);
        assertTrue(res.isSuccess(), "Response outcome was failure.");
View Full Code Here

    private static final int MANAGEMENT_QUERY_TIMEOUT = 60;
    private static final String ENABLED_ATTRIBUTE = "enabled";

    @Override
    public Configuration loadResourceConfiguration() throws Exception {
        ReadAttribute readAttributeOp = new ReadAttribute(getAddress(), ENABLED_ATTRIBUTE);
        Result result = getASConnection().execute(readAttributeOp);
        if (!result.isSuccess()) {
            throw new Exception(result.getFailureDescription(), result.getRhqThrowable());
        }
        Configuration configuration = new Configuration();
View Full Code Here

            ComplexRequest complexRequest = null;
            Operation op;
            if (reqName.contains(":")) {
                complexRequest = ComplexRequest.create(reqName);
                op = new ReadAttribute(address, complexRequest.getProp());
            } else {
                op = new ReadAttribute(address, reqName);
            }

            Result res = getASConnection().execute(op);
            if (!res.isSuccess()) {
                if (LOG.isDebugEnabled()) {
View Full Code Here

    protected <R> R readAttribute(Address address, String name, Class<R> resultType) throws Exception {
        return readAttribute(address, name, resultType, 10);
    }

    protected <R> R readAttribute(Address address, String name, Class<R> resultType, int timeoutSec) throws Exception {
        Operation op = new ReadAttribute(address, name);
        Result res = getASConnection().execute(op, timeoutSec);

        if (!res.isSuccess()) {
            if (res.isTimedout()) {
                throw new TimeoutException("Read attribute operation timed out");
View Full Code Here

TOP

Related Classes of org.rhq.modules.plugins.jbossas7.json.ReadAttribute

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.