Package javax.management.remote

Examples of javax.management.remote.JMXConnector


      return false;
    }
  }
 
  private int retrieveWGACoreStatus() {
    JMXConnector jmxc = null;
    try {
      int jmxPort = WGADesignerPlugin.getDefault().getPreferenceStore().getInt(PreferenceConstants.JMX_PORT);     
      JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://:" + jmxPort + "/jmxrmi");
          jmxc = JMXConnectorFactory.connect(url, null);
          MBeanServerConnection mbean = jmxc.getMBeanServerConnection();
      Object attribute = mbean.getAttribute(new ObjectName("de.innovationgate.WGAMonitor:context=WGAPublisher,name=Information"), "CoreStatus");
      if (attribute != null && attribute instanceof Integer) {       
        return (Integer) attribute;       
      } else {
        return -1;
      }
    } catch (AttributeNotFoundException e) {
      // this might be an wga version < 5.0 - we assume running state here
      return 50;
    } catch (Exception e) {
      // something wrong with jmx
      return -1;
    } finally {
      if (jmxc != null) {
        try {
          jmxc.close();
        } catch (IOException e) {
        }
      }
    }
  }
View Full Code Here


    public static void main(String[] args) {
        try {

            JMXServiceURL url = new JMXServiceURL(
                      "service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi/server");
            JMXConnector jmxc = JMXConnectorFactory.connect(url, null);

            mbsc = jmxc.getMBeanServerConnection();

            String domain = "org.objectweb.celtix.instrumentation";

            echo("\n The Celtix Management Demo MBeanServer has " + mbsc.getMBeanCount() + " MBeans");
            echo("\n There are :");
View Full Code Here

  private static AdministratorMBean getMBean() throws XException {
    try {
      JMXServiceURL url = new JMXServiceURL(
          "service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi");
      JMXConnector jmxc = JMXConnectorFactory.connect(url, null);

      MBeanServerConnection mbsc = jmxc.getMBeanServerConnection();

      ObjectName adaptor = new ObjectName("xBus:mbean=Administrator");

      AdministratorMBean mbeanProxy = JMX.newMBeanProxy(mbsc, adaptor,
          AdministratorMBean.class, true);
View Full Code Here

        }

        // Connect to the JMX server
        String url = "service:jmx:rmi:///jndi/rmi://localhost:" + rmiPort + "/EasyBeansConnector";
        JMXServiceURL jmxServiceURL = new JMXServiceURL(url);
        JMXConnector connector = JMXConnectorFactory.connect(jmxServiceURL);
        this.mBeanServerConnection = connector.getMBeanServerConnection();

        this.webTester.getTestContext().setBaseUrl("http://localhost:" + httpPort + "/");
    }
View Full Code Here

    public static void main(String[] args)
        throws Exception {

        JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:9999/testApp");
        JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
        MBeanServerConnection mbsc = jmxc.getMBeanServerConnection();
        mbsc.addNotificationListener(
                new ObjectName("jmanage:name=TimeNotificationBroadcaster"),
                new MyNotificationListener(), null, null);

        while(true){
View Full Code Here

            Hashtable env = new Hashtable();
            env.put(Context.SECURITY_PRINCIPAL, config.getUsername());
            env.put(Context.SECURITY_CREDENTIALS, config.getPassword());
            env.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
                    "weblogic.management.remote");
            JMXConnector jmxc = JMXConnectorFactory.connect(url, env);
            return new Weblogic9ServerConnection(jmxc, jmxc.getMBeanServerConnection());
        } catch (Throwable e) {
            throw new ConnectionFailedException(e);
        }
    }
View Full Code Here

                env.put(JSR160ApplicationConfig.JNDI_FACTORY, jndiFactory);
            if(jndiURL != null)
                env.put(JSR160ApplicationConfig.JNDI_URL, jndiURL);

            JMXServiceURL url = new JMXServiceURL(config.getURL());
            JMXConnector jmxc = JMXConnectorFactory.connect(url, env);
            return new JSR160ServerConnection(jmxc,
                    jmxc.getMBeanServerConnection());
        } catch (Throwable e) {
            throw new ConnectionFailedException(e);
        }
    }
View Full Code Here

        if (!localServerFound()) {
            try {
                // If no server was found, check for a remote server.
                JMXServiceURL url = new JMXServiceURL(PREFIX_JMX_URL + hostname + ":" + numPort + SUFFIX_JMX_URL);
                serverName = newJMXServerObjectName();
                JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
                mbsc = jmxc.getMBeanServerConnection();
                setServer((EZBServer) MBeanServerInvocationHandler.newProxyInstance(this.mbsc, this.serverName,
                                                                                    EZBServer.class, false));
                ObjectName deployerName = newJMXDeployerObjectName();
                this.rd = (IRemoteDeployer) MBeanServerInvocationHandler.newProxyInstance(this.mbsc, deployerName,
                                                                                          IRemoteDeployer.class, false);
View Full Code Here

   public static void main(String args[] ) throws Exception
   {
      String serverName = InetAddress.getLocalHost().getHostName();
      String serverURL = "service:jmx:rmi:///jndi/rmi://" + serverName +":1090/jmxrmi";
      JMXServiceURL url = new JMXServiceURL(serverURL);
      JMXConnector jmxc = JMXConnectorFactory.connect(url, new HashMap());
      MBeanServerConnection server1 = jmxc.getMBeanServerConnection();

      // TODO: get the port from binding service
      serverURL = "service:jmx:rmi:///jndi/rmi://" + serverName +":1190/jmxrmi";
      url = new JMXServiceURL(serverURL);
      jmxc = JMXConnectorFactory.connect(url, new HashMap());
      server2 = jmxc.getMBeanServerConnection();

      ObjectName testerName = new ObjectName("jboss.aop:name=CacheTester");

      int baseAge = 32;
     
View Full Code Here

         creds[1] = password;
         env.put(JMXConnector.CREDENTIALS, creds);
      }

      JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://"+getServerHostForURL()+":1090/jmxrmi");
      JMXConnector jmxc = JMXConnectorFactory.connect(url, env);
      MBeanServerConnection adaptor = jmxc.getMBeanServerConnection();
      return adaptor;
   }
View Full Code Here

TOP

Related Classes of javax.management.remote.JMXConnector

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.