Package javax.management.remote

Examples of javax.management.remote.JMXConnector.connect()


        }
        String urlS = targetConfig.getUrl();
        JMXServiceURL url = new JMXServiceURL(urlS);
        Map<String,Object> env = prepareEnv(targetConfig.getEnv());
        JMXConnector ret = JMXConnectorFactory.newJMXConnector(url,env);
        ret.connect();
        return ret;
    }

    private void releaseConnector(JMXConnector pConnector) throws IOException {
        pConnector.close();
View Full Code Here


            {
               holder.set(notification);
            }
         }, null, null);

         cntor.connect(getEnvironment());

         JMXConnectionNotification notification = (JMXConnectionNotification) holder.get();
         assertEquals(notification.getType(), JMXConnectionNotification.OPENED);
      } catch (Exception x)
      {
View Full Code Here

            {
               holder.set(notification);
            }
         }, null, null);

         cntor.connect(getEnvironment());
         cntor.close();

         JMXConnectionNotification notification = (JMXConnectionNotification) holder.get();
         assertEquals(notification.getType(), JMXConnectionNotification.CLOSED);
      } catch (Exception x)
View Full Code Here

         }, null, null);

         Map clientEnv = getEnvironment();
         clientEnv.put(MX4JRemoteConstants.CONNECTION_HEARTBEAT_PERIOD, new Long(period));
         clientEnv.put(MX4JRemoteConstants.CONNECTION_HEARTBEAT_RETRIES, new Integer(retries));
         cntor.connect(clientEnv);

         JMXConnectionNotification notification = (JMXConnectionNotification) holder.get();
         assertEquals(notification.getType(), JMXConnectionNotification.OPENED);
         holder.set(null);
      } catch (Exception x)
View Full Code Here

         ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
         ObjectInputStream ois = new ObjectInputStream(bais);
         cntor = (JMXConnector)ois.readObject();
         ois.close();

         cntor.connect();
         MBeanServerConnection mbsc = cntor.getMBeanServerConnection();
         mbsc.getDefaultDomain();

         // Again
         cntor = JMXConnectorFactory.connect(cntorServer.getAddress(), getEnvironment());
View Full Code Here

         bais = new ByteArrayInputStream(baos.toByteArray());
         ois = new ObjectInputStream(bais);
         cntor = (JMXConnector)ois.readObject();
         ois.close();

         cntor.connect();
         mbsc = cntor.getMBeanServerConnection();
         mbsc.getDefaultDomain();
      }
      finally
      {
View Full Code Here

      }

      JMXConnector cntor = JMXConnectorFactory.newJMXConnector(url, getEnvironment());
      try
      {
         cntor.connect(environment);
         fail();
      }
      catch (IllegalArgumentException x)
      {
      }
View Full Code Here

    }

    public void testMoveMessages() throws Exception {
        JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:1199/jmxrmi");
        JMXConnector connector = JMXConnectorFactory.connect(url, null);
        connector.connect();
        MBeanServerConnection connection = connector.getMBeanServerConnection();
        ObjectName name = new ObjectName("org.apache.activemq:type=Broker,brokerName=localhost," +
                "destinationType=Queue,destinationName=TEST.Q");
        QueueViewMBean queueMbean = MBeanServerInvocationHandler.newProxyInstance(connection, name, QueueViewMBean.class, true);
        String msgId = queueMbean.sendTextMessage("test", "system", "manager");
View Full Code Here

    }

    public void testBrowseExpiredMessages() throws Exception {
        JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:1199/jmxrmi");
        JMXConnector connector = JMXConnectorFactory.connect(url, null);
        connector.connect();
        MBeanServerConnection connection = connector.getMBeanServerConnection();
        ObjectName name = new ObjectName("org.apache.activemq:type=Broker,brokerName=localhost," +
                "destinationType=Queue,destinationName=TEST.Q");
        QueueViewMBean queueMbean = MBeanServerInvocationHandler.newProxyInstance(connection, name, QueueViewMBean.class, true);
        HashMap<String, String> headers = new HashMap<String, String>();
View Full Code Here

        Exception exception = null;
        for (JMXServiceURL url : jmxUrls) {
            try {
                JMXConnector connector = JMXConnectorFactory.connect(url, env);
                connector.connect();
                MBeanServerConnection connection = connector.getMBeanServerConnection();

                Set<ObjectName> brokers = findBrokers(connection);
                if (brokers.size() > 0) {
                    LOG.info("Connected via JMX to the broker at " + 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.