Package org.jolokia.client

Examples of org.jolokia.client.J4pClient.execute()


    @Test void errorConnectionRefusedTest() throws J4pException, MalformedObjectNameException {
        try {
            final J4pReadRequest req = new J4pReadRequest(itSetup.getAttributeMBean(),"LongSeconds");
            J4pClient anotherClient = new J4pClient("http://localhost:27654/jolokia");
            anotherClient.execute(req);
            fail();
        } catch (J4pConnectException exp) {
            // all fine
        }
    }
View Full Code Here


    @Test void errorConnectionRefusedTest() throws J4pException, MalformedObjectNameException {
        try {
            final J4pReadRequest req = new J4pReadRequest(itSetup.getAttributeMBean(),"LongSeconds");
            J4pClient anotherClient = new J4pClient("http://localhost:27654/jolokia");
            anotherClient.execute(req);
            fail();
        } catch (J4pConnectException exp) {
            // all fine
        }
    }
View Full Code Here

                if (jolokia != null) {
                    System.out.println("   has jolokia client: " + jolokia + " from host: " + host + " URL: " + jolokia.getUri());
                    try {
                        ObjectName objectName = new ObjectName("java.lang:type=OperatingSystem");
                        J4pResponse<J4pReadRequest> results = jolokia.execute(new J4pReadRequest(objectName, "SystemCpuLoad"));
                        Object value = results.getValue();
                        System.out.println("  System CPU Load: " + value);
                    } catch (Exception e) {
                        LOG.error("Failed to look up attribute. " + e, 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.