Package org.jolokia.client

Examples of org.jolokia.client.J4pClient


    }

    @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


            // Start the integration MBeans
            itSetup.start();
        } else {
            j4pUrl = testUrl;
        }
        j4pClient = new J4pClient(j4pUrl);
  }
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

            // Start the integration MBeans
            itSetup.start();
        } else {
            j4pUrl = testUrl;
        }
        j4pClient = new J4pClient(j4pUrl);
  }
View Full Code Here

  private final J4pClient j4pClient;
  private final MBeanOps mbeanOps;

  public RuntimeCommands() {
    j4pClient = new J4pClient("http://localhost:8778/jolokia/");
    mbeanOps = new MBeanOps(j4pClient);
    serverRunning = mbeanOps.ping();
  }
View Full Code Here

  private final MBeanOps mbeanOps;

  private static int jobCount;

  public AdminCommands() {
    j4pClient = new J4pClient("http://localhost:8778/jolokia/");
    mbeanOps = new MBeanOps(j4pClient);
    try {
      PropertyUtil.setTargetUrl("http://localhost:8081");
    } catch (ConfigurationException e) {}
  }
View Full Code Here

        for (PodSchema pod : pods) {
            String host = KubernetesHelper.getHost(pod);
            List<ManifestContainer> containers = KubernetesHelper.getContainers(pod);
            for (ManifestContainer container : containers) {
                System.out.println("pod " + pod.getId() + " container: " + container.getName() + " image: " + container.getImage());
                J4pClient jolokia = clients.jolokiaClient(host, container, pod);

                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

                    getLog().error(message);
                    throw new MojoExecutionException(message);
            }

            // now lets invoke the mbean
            J4pClient client = createJolokiaClient();

            if (upload && isIncludeArtifact()) {
                uploadDeploymentUnit(client, newUserAdded);
            } else {
                getLog().info("Uploading to the fabric8 maven repository is disabled");
View Full Code Here

TOP

Related Classes of org.jolokia.client.J4pClient

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.