Examples of JMXServiceURL


Examples of javax.management.remote.JMXServiceURL

     */
    public ServerConnection getServerConnection(ApplicationConfig config)
            throws ConnectionFailedException {

        try {
            JMXServiceURL url = new JMXServiceURL(config.getURL());

            Hashtable env = new Hashtable();
            env.put(Context.SECURITY_PRINCIPAL, config.getUsername());
            env.put(Context.SECURITY_CREDENTIALS, config.getPassword());
            env.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
View Full Code Here

Examples of javax.management.remote.JMXServiceURL

            if(jndiFactory != null)
                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

Examples of javax.management.remote.JMXServiceURL

     */
    public RemoteEasyBeansPluginServer(final String hostname, final int numPort) throws IOException {       
        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));
View Full Code Here

Examples of javax.management.remote.JMXServiceURL

   static MBeanServerConnection server2;
   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");
View Full Code Here

Examples of javax.management.remote.JMXServiceURL

         creds[0] = username;
         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

Examples of javax.management.remote.JMXServiceURL

   {
      super.setUp();
      // JBAS-8540
      String surl = "service:jmx:rmi://" + getServerHostForURL() + "/jndi/rmi://" + getServerHostForURL() + ":1090/jmxrmi";
      log.info("setup for JMXServiceURL = " + surl);
      JMXServiceURL url = new JMXServiceURL(surl);
      connector = JMXConnectorFactory.connect(url);
      server = connector.getMBeanServerConnection();
   }
View Full Code Here

Examples of javax.management.remote.JMXServiceURL

         HashMap env = new HashMap();
         if( securityDomain != null)
            env.put(RMIConnectorServer.AUTHENTICATOR, new JMXConnectorAuthenticator( securityDomain) );
         // note:  don't pass clientSocketFactory to RMIJRMPServerImpl ctor or JBAS-7933 regression will occur.
         rmiServer = new RMIJRMPServerImpl(rmiServerPort, null, serverSocketFactory, env);
         JMXServiceURL url = buildJMXServiceURL();
         adapter = new RMIConnectorServer(url, env, rmiServer, wrapMBeanServer(mbeanServer));
         adapter.start();
         url = adapter.getAddress();
         registry.rebind(RMI_BIND_NAME, rmiServer.toStub());
         registry.rebind(LEGACY_RMI_BIND_NAME, rmiServer.toStub());

         if(log.isDebugEnabled()) {
            log.debug("started JMXConnector (" + url.toString() + ")" +
               (securityDomain!=null ? " domain=" + securityDomain : "") );
         }

         // For legacy access, bind a JMXAdapter to the JNDI names
         Reference reference = new Reference(MBeanServerConnection.class.getName(), JMXAdapter.class.getName(), null);
         reference.add(new StringRefAddr("JMXServiceURL", url.toString()));
         Util.rebind(context, JNDI_BIND_NAME, reference);
         Util.rebind(context, LEGACY_BIND_NAME, reference);
         //Object test = Util.lookup(context, JNDI_BIND_NAME, MBeanServerConnection.class);
         //log.info("test = " + test);
         SecurityFactory.prepare();
View Full Code Here

Examples of javax.management.remote.JMXServiceURL

                                     // IPV6 literal addresses have one or more colons
                                     // IPV4 addresses/hostnames have no colons
         host = "[" + host + "]";
        
      }
      JMXServiceURL url = new JMXServiceURL("service:jmx:rmi://" + host);
      return url;
   }
View Full Code Here

Examples of javax.management.remote.JMXServiceURL

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

      JMXServiceURL url = new JMXServiceURL(serverURL);
      JMXConnector jmxc = JMXConnectorFactory.connect(url, env);
      MBeanServerConnection adaptor = jmxc.getMBeanServerConnection();

      ServerProxyHandler handler = new ServerProxyHandler(adaptor, serverJMXName);
      Class<?>[] ifaces = {JBossASServer.class};
View Full Code Here

Examples of javax.management.remote.JMXServiceURL

               creds[0] = username;
               creds[1] = password;
               env.put(JMXConnector.CREDENTIALS, creds);
            }
           
            JMXServiceURL url = new JMXServiceURL(serverURL);

            if (verbose )
            {
               log("will connect with JMXServiceURL = "+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.