Examples of JMXConnectorServer


Examples of javax.management.remote.JMXConnectorServer

   
    try {
      LocateRegistry.createRegistry( 1099 );
      MBeanServer server = ManagementFactory.getPlatformMBeanServer();
      String url = "service:jmx:rmi:///jndi/rmi://localhost/jmxrmi";
      JMXConnectorServer connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(
                                             new JMXServiceURL( url ), null, server );
      connectorServer.start();

      KillMBeanImpl maze = new KillMBeanImpl();
      server.registerMBean( maze, name );
    } catch (Exception e) {
      throw new RuntimeException(e);
View Full Code Here

Examples of javax.management.remote.JMXConnectorServer

                }
                Thread t = new Thread("JMX connector") {
                    @Override
                    public void run() {
                        try {
                            JMXConnectorServer server = connectorServer;
                            if (started.get() && server != null) {
                                LOG.debug("Starting JMXConnectorServer...");
                                connectorStarting.set(true);
                                try {
                                  server.start();
                                } finally {
                                  connectorStarting.set(false);
                                }
                                LOG.info("JMX consoles can connect to " + server.getAddress());
                            }
                        } catch (IOException e) {
                            LOG.warn("Failed to start jmx connector: " + e.getMessage());
                            LOG.debug("Reason for failed jms connector start", e);
                        }
View Full Code Here

Examples of javax.management.remote.JMXConnectorServer

                        mbeanServer.unregisterMBean(name);
                   
                }
            }
            registeredMBeanNames.clear();
            JMXConnectorServer server = connectorServer;
            connectorServer = null;
            if (server != null) {
                try {
                  if (!connectorStarting.get()) {
                    server.stop();
                  }
                } catch (IOException e) {
                    LOG.warn("Failed to stop jmx connector: " + e.getMessage());
                }
                try {
View Full Code Here

Examples of javax.management.remote.JMXConnectorServer

                    serverName, url.toString()), e);
            return null;
        }
       
        // Start the JMX server with the connection string
        JMXConnectorServer cs = null;
        try {
            cs = JMXConnectorServerFactory.newJMXConnectorServer(
                    serviceUrl, theEnv, theMBeanServer);
            cs.start();
            log.info(sm.getString("jmxRemoteLifecycleListener.start",
                    Integer.toString(theRmiRegistryPort),
                    Integer.toString(theRmiServerPort), serverName));
        } catch (IOException e) {
            log.error(sm.getString(
View Full Code Here

Examples of javax.management.remote.JMXConnectorServer

        //      The address of the connector server
        JMXServiceURL address = new JMXServiceURL("service:jmx:rmi://" + host
                + "/jndi/rmi://" + host + ":" + rmiPort + "/jipletagent");
       
        //         Create the JMXCconnectorServer
        JMXConnectorServer connector = JMXConnectorServerFactory
                .newJMXConnectorServer(address, null, agent);

        //         Start the JMXConnectorServer
        connector.start();

        JipletLogger
                .info("RMI MBean server started at " + host + ":" + rmiPort);
    }
View Full Code Here

Examples of javax.management.remote.JMXConnectorServer

              + server);
    } else {
      try {
        // Create a new MBeanServer with the given serviceUrl
        server = MBeanServerFactory.newMBeanServer();
        JMXConnectorServer connector = JMXConnectorServerFactory
                .newJMXConnectorServer(new JMXServiceURL(jmxConfig.serviceUrl),
                        null, server);
        connector.start();
        LOG.info("JMX monitoring is enabled at " + jmxConfig.serviceUrl);
      } catch (Exception e) {
        // Release the reference
        server = null;
        throw new RuntimeException("Could not start JMX monitoring ", e);
View Full Code Here

Examples of javax.management.remote.JMXConnectorServer

                }
                Thread t = new Thread("JMX connector") {
                    @Override
                    public void run() {
                        try {
                            JMXConnectorServer server = connectorServer;
                            if (started.get() && server != null) {
                                LOG.debug("Starting JMXConnectorServer...");
                                connectorStarting.set(true);
                                try {
                                  server.start();
                                } finally {
                                  connectorStarting.set(false);
                                }
                                LOG.info("JMX consoles can connect to " + server.getAddress());
                            }
                        } catch (IOException e) {
                            LOG.warn("Failed to start jmx connector: " + e.getMessage());
                            LOG.debug("Reason for failed jms connector start", e);
                        }
View Full Code Here

Examples of javax.management.remote.JMXConnectorServer

                        mbeanServer.unregisterMBean(name);
                   
                }
            }
            registeredMBeanNames.clear();
            JMXConnectorServer server = connectorServer;
            connectorServer = null;
            if (server != null) {
                try {
                  if (!connectorStarting.get()) {
                    server.stop();
                  }
                } catch (IOException e) {
                    LOG.warn("Failed to stop jmx connector: " + e.getMessage());
                }
                try {
View Full Code Here

Examples of javax.management.remote.JMXConnectorServer

                    serverName, url.toString()), e);
            return null;
        }
       
        // Start the JMX server with the connection string
        JMXConnectorServer cs = null;
        try {
            cs = JMXConnectorServerFactory.newJMXConnectorServer(
                    serviceUrl, theEnv, theMBeanServer);
            cs.start();
            log.info(sm.getString("jmxRemoteLifecycleListener.start",
                    Integer.toString(theRmiRegistryPort),
                    Integer.toString(theRmiServerPort), serverName));
        } catch (IOException e) {
            log.error(sm.getString(
View Full Code Here

Examples of javax.management.remote.JMXConnectorServer

      MBeanServer server = MBeanServerFactory.createMBeanServer();

      // Pass null as the host name to tell JMXServiceURL to default to InetAddress.getLocalHost().getHostName()
      JMXServiceURL url = new JMXServiceURL("hessian", null, 8080, "/hessian");

      JMXConnectorServer connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, null, server);
      connectorServer.start();

      System.out.println("Server up and running " + connectorServer + " on " + url);
   }
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.