Package javax.management

Examples of javax.management.MBeanServerConnection.queryMBeans()


  }
 
  private void printListenersStatus() throws Exception
  {
    MBeanServerConnection conn = getMBeanServerConnection();
    Iterator listenerInstances = conn.queryMBeans(new ObjectName("FFMQ:type=Listeners,listener=*"), null).iterator();
    while (listenerInstances.hasNext())
    {
      ObjectInstance listenerInstance = (ObjectInstance)listenerInstances.next();
      String listenerName = (String)conn.getAttribute(listenerInstance.getObjectName(),"Name");
     
View Full Code Here


  }
 
  private void printEnginesStatus() throws Exception
  {
    MBeanServerConnection conn = getMBeanServerConnection();
    Iterator engineInstances = conn.queryMBeans(new ObjectName("FFMQ:type=Engines,engine=*"), null).iterator();
    while (engineInstances.hasNext())
    {
      ObjectInstance engineInstance = (ObjectInstance)engineInstances.next();
      String engineName = (String)conn.getAttribute(engineInstance.getObjectName(),"Name");
     
View Full Code Here

  }
 
  private void printEngineQueues(String engineName,String indent) throws Exception
  {
    MBeanServerConnection conn = getMBeanServerConnection();
    Iterator queueInstances = conn.queryMBeans(new ObjectName("FFMQ:type=Engines,engine="+engineName+",children=queues,name=*"), null).iterator();
    while (queueInstances.hasNext())
    {
      ObjectInstance queueInstance = (ObjectInstance)queueInstances.next();
      String queueName = (String)conn.getAttribute(queueInstance.getObjectName(),"Name");
     
View Full Code Here

  }

  private void printEngineTopics(String engineName,String indent) throws Exception
  {
    MBeanServerConnection conn = getMBeanServerConnection();
    Iterator topicInstances = conn.queryMBeans(new ObjectName("FFMQ:type=Engines,engine="+engineName+",children=topics,name=*"), null).iterator();
    while (topicInstances.hasNext())
    {
      ObjectInstance topicInstance = (ObjectInstance)topicInstances.next();
      String topicName = (String)conn.getAttribute(topicInstance.getObjectName(),"Name");
     
View Full Code Here

   public void testQueryMBeansNullNull() throws Exception
   {
      MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());

      Set mbeans = mbsc.queryMBeans(null, null);
      assertNotNull(mbeans);
      if (mbeans.size() < 1) fail();
   }

   public void testQueryMBeansObjectNameNull() throws Exception
View Full Code Here

   public void testQueryMBeansObjectNameNull() throws Exception
   {
      MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());

      Set mbeans = mbsc.queryMBeans(ObjectName.getInstance("JMImplementation:*"), null);
      assertNotNull(mbeans);
      if (mbeans.size() < 1) fail();
   }

   public void testQueryMBeansObjectNameQueryExp() throws Exception
View Full Code Here

   public void testQueryMBeansObjectNameQueryExp() throws Exception
   {
      MBeanServerConnection mbsc = getMBeanServerConnection(newMBeanServer());

      Set mbeans = mbsc.queryMBeans(ObjectName.getInstance("JMImplementation:*"), new ObjectName("*:type=MBeanServerDelegate"));
      assertNotNull(mbeans);
      if (mbeans.size() != 1) fail();
   }

   public void testSetAttribute() throws Exception
View Full Code Here

    {
        List<ManagedBean> mbeans = new ArrayList<ManagedBean>();

        MBeanServerConnection mbsc = serverRegistry.getServerConnection();
        ObjectName objName = new ObjectName(domain + ":*");
        Set objectInstances = mbsc.queryMBeans(objName, null);

        for (Iterator itr = objectInstances.iterator(); itr.hasNext();)
        {
            ObjectInstance instance = (ObjectInstance)itr.next();
            ManagedBean obj = new JMXManagedObject(instance.getObjectName());
View Full Code Here

    {
        List<ManagedBean> mbeans = new ArrayList<ManagedBean>();
        JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(server);
        MBeanServerConnection mbsc = serverRegistry.getServerConnection();
        ObjectName objName = new ObjectName(domain + ":*");
        Set objectInstances = mbsc.queryMBeans(objName, null);

        for (Iterator itr = objectInstances.iterator(); itr.hasNext();)
        {
            ObjectInstance instance = (ObjectInstance)itr.next();
            ManagedBean obj = new JMXManagedObject(instance.getObjectName());
View Full Code Here

                Thread.sleep(100);
            }
            MBeanServerConnection mbsc = getMBeanServerConnection();
            if (mbsc != null) {
                LOG.info("Query name: " + beanName);
                mbeans = mbsc.queryMBeans(beanName, null);
                if (mbeans != null) {
                    count = mbeans.size();
                }
            }
        } while ((mbeans == null || mbeans.isEmpty()) && expiryTime > System.currentTimeMillis());
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.