Examples of JMXConnectorServer


Examples of javax.management.remote.JMXConnectorServer

      JMXServiceURL url = new JMXServiceURL("hessian+ssl", null, 8443, "/hessianssl");

      // Replace the value of the configuration with the file path of the configuration file
      Map serverEnv = new HashMap();
      serverEnv.put(HTTPConnectorServer.WEB_CONTAINER_CONFIGURATION, "<your-web-container-configuration>");
      JMXConnectorServer connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, serverEnv, server);
      connectorServer.start();

      System.out.println("Server up and running " + connectorServer + " on " + url);
   }
View Full Code Here

Examples of javax.management.remote.JMXConnectorServer

      String jndiPath = "/jmxconnector";
      JMXServiceURL url = new JMXServiceURL("service:jmx:rmi://localhost/jndi/rmi://localhost:" + namingPort + jndiPath);

      // Create and start the RMIConnectorServer
      JMXConnectorServer connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, null, server);
      connectorServer.start();

      System.out.println("Server up and running");
   }
View Full Code Here

Examples of javax.management.remote.JMXConnectorServer

   {
      // The address of the connector server
      JMXServiceURL url = new JMXServiceURL("rmi", "localhost", 0, "/jndi/jmx");

      // No need of environment variables or the MBeanServer at this point
      JMXConnectorServer cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, null, null);
      ObjectName cntorServerName = ObjectName.getInstance(":service=" + JMXConnectorServer.class.getName() + ",protocol=" + url.getProtocol());

      MBeanServer server = MBeanServerFactory.createMBeanServer("remote.notification.example");
      // Register the connector server as MBean
      server.registerMBean(cntorServer, cntorServerName);

      // The rmiregistry needed to bind the RMI stub
      NamingService naming = new NamingService();
      ObjectName namingName = ObjectName.getInstance(":service=" + NamingService.class.getName());
      server.registerMBean(naming, namingName);
      naming.start();

      // Start the connector server
      cntorServer.start();

      System.out.println("Server up and running");
   }
View Full Code Here

Examples of javax.management.remote.JMXConnectorServer

      // and for the naming server (the second), to indicate that this is not the rmiregistry
      // but the COS naming service.
      JMXServiceURL url = new JMXServiceURL("service:jmx:iiop://localhost/jndi/iiop://localhost:" + namingPort + jndiPath);

      // Create and start the RMIConnectorServer over IIOP
      JMXConnectorServer connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, null, server);
      connectorServer.start();

      System.out.println("Server up and running");
   }
View Full Code Here

Examples of javax.management.remote.JMXConnectorServer

      SSLContext context = createSSLContext();
      environment.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, new SSLRMIClientSocketFactory());
      environment.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, new SSLRMIServerSocketFactory(context));

      // Create and start the RMIConnectorServer
      JMXConnectorServer connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, environment, null);
      ObjectName connectorServerName = ObjectName.getInstance("connectors:protocol=" + url.getProtocol());
      server.registerMBean(connectorServer, connectorServerName);
      connectorServer.start();

      System.out.println("Server up and running");
   }
View Full Code Here

Examples of javax.management.remote.JMXConnectorServer

      Map environment = new HashMap();
      JMXAuthenticator authenticator = new PasswordAuthenticator(new File(PASSWORD_FILE));
      environment.put(JMXConnectorServer.AUTHENTICATOR, authenticator);

      // Create and register the connector server
      JMXConnectorServer cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, environment, null);
      ObjectName cntorServerName = ObjectName.getInstance(":service=" + JMXConnectorServer.class.getName() + ",protocol=" + url.getProtocol());
      MBeanServer server = MBeanServerFactory.createMBeanServer("remote.security.example");
      server.registerMBean(cntorServer, cntorServerName);

      // Setup the rmiregistry to bind in JNDI the RMIConnectorServer stub.
      NamingService naming = new NamingService();
      ObjectName namingName = ObjectName.getInstance(":service=" + NamingService.class.getName());
      server.registerMBean(naming, namingName);
      naming.start();

      // Setup the interception
      SubjectTrackingMBeanServer interceptor = new SubjectTrackingMBeanServer();
      cntorServer.setMBeanServerForwarder(interceptor);

      // Start the connector server
      cntorServer.start();

      System.out.println("Server up and running");
   }
View Full Code Here

Examples of javax.management.remote.JMXConnectorServer

      Map environment = new HashMap();
      JMXAuthenticator authenticator = new PasswordAuthenticator(new File(PASSWORD_FILE));
      environment.put(JMXConnectorServer.AUTHENTICATOR, authenticator);

      // Create and register the connector server
      JMXConnectorServer cntorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, environment, null);
      ObjectName cntorServerName = ObjectName.getInstance(":service=" + JMXConnectorServer.class.getName() + ",protocol=" + url.getProtocol());
      MBeanServer server = MBeanServerFactory.createMBeanServer("remote.security.example");
      server.registerMBean(cntorServer, cntorServerName);

      // Setup the rmiregistry to bind in JNDI the RMIConnectorServer stub.
      NamingService naming = new NamingService();
      ObjectName namingName = ObjectName.getInstance(":service=" + NamingService.class.getName());
      server.registerMBean(naming, namingName);
      naming.start();

      // Start the connector server
      cntorServer.start();

      System.out.println("Server up and running");
   }
View Full Code Here

Examples of javax.management.remote.JMXConnectorServer

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

      // Create and start the connector server
      // Jetty will listen on port 8080
      JMXConnectorServer connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url, null, server);
      connectorServer.start();

      System.out.println("Server up and running " + connectorServer);
   }
View Full Code Here

Examples of javax.management.remote.JMXConnectorServer

                catch (Throwable ignore) {
                }
                Thread t = new Thread("JMX connector") {
                    public void run() {
                        try {
                            JMXConnectorServer server = connectorServer;
                            if (started.get() && server != null) {
                                server.start();
                                log.info("JMX consoles can connect to " + server.getAddress());
                            }
                        }
                        catch (IOException e) {
                            log.warn("Failed to start jmx connector: " + e.getMessage());
                        }
View Full Code Here

Examples of javax.management.remote.JMXConnectorServer

        }
    }

    public void stop() throws IOException {
        if (started.compareAndSet(true, false)) {
            JMXConnectorServer server = connectorServer;
            connectorServer = null;
            if (server != null) {
                try {
                    server.stop();
                }
                catch (IOException e) {
                    log.warn("Failed to stop jmx connector: " + e.getMessage());
                }
                try {
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.