Package javax.management

Examples of javax.management.MBeanServerConnection.queryNames()


        final MBeanServerConnection serverConn = getMBeanServerConnection();
       
        return  (Set<ObjectName>) AccessController.doPrivileged(
            new PrivilegedExceptionAction<Object>() {
                public Object run() throws IOException {
                    return serverConn.queryNames(derbyDomain, null);
               }  
            }
        );  
    }
   
View Full Code Here


    {
        MBeanServerConnection mbsc = serverRegistry.getServerConnection();
       
        //Detect if the ServerInformation MBean is present, and use it to retrieve the API version.
        ObjectName objName = new ObjectName(server.getDomain() + ":type="+ ServerInformation.TYPE + ",*");
        Set<ObjectName> objectInstances = mbsc.queryNames(objName, null);
       
        if(objectInstances.size() != 0)
        {
            for (Iterator<ObjectName> itr = objectInstances.iterator(); itr.hasNext();)
            {
View Full Code Here

       
        //Detect the value of the 'version' key property on the UserManagement MBean ObjectName.
        //If present, we have a v1.2 API server. If null, we have a v1.1 API server.
        //Use an ObjectName pattern (the ?) to match the 'type' and allow this to work for non-admin users
        objName = new ObjectName(server.getDomain() + ":type="+ "UserManagemen?" + ",*");
        objectInstances = mbsc.queryNames(objName, null);
       
        if(objectInstances.size() != 0)
        {
            for (Iterator<ObjectName> itr = objectInstances.iterator(); itr.hasNext();)
            {
View Full Code Here

        MBeanServerConnection connection = connector.getMBeanServerConnection();
       
        log.info(connection.getMBeanCount());


        Set set = connection.queryNames(new ObjectName(connection.getDefaultDomain() + ":*"), null);
        for (Iterator iter = set.iterator(); iter.hasNext();) {
            ObjectName name = (ObjectName)iter.next();
            log.info(name.toString());
            MBeanInfo info = connection.getMBeanInfo(name);
            MBeanAttributeInfo[] mia = info.getAttributes();
View Full Code Here

        jmx.getValue("NumOpenConnections")));

    cluster.shutdown();
    MBeanServerConnection mbsc = ManagementFactory.getPlatformMBeanServer();
    ObjectName query = new ObjectName("Hadoop:service=" + serviceName + ",*");
    Set<ObjectName> names = mbsc.queryNames(query, null);
    assertTrue("No beans should be registered for " + serviceName, names.isEmpty());
  }
 
  private static boolean checkPrintAllValues(JMXGet jmx) throws Exception {
    int size = 0;
View Full Code Here

    assertEquals(fileSize, Integer.parseInt(jmx.getValue("BytesWritten")));

    cluster.shutdown();
    MBeanServerConnection mbsc = ManagementFactory.getPlatformMBeanServer();
    ObjectName query = new ObjectName("Hadoop:service=" + serviceName + ",*");
    Set<ObjectName> names = mbsc.queryNames(query, null);
    assertTrue("No beans should be registered for " + serviceName, names.isEmpty());
  }
}
View Full Code Here

          if (!ex.getMessage().contentEquals("Connection closed"))
            KarafJMXPlugin.getLogger().warning(ex);
          return null;
        }
       
        final Set<ObjectName> queryNames = connection.queryNames(bundleStateQueryObjectName, null);
        for (ObjectName bundleStateObjectName : queryNames) {
          connection.addNotificationListener(bundleStateObjectName, listener, filter, handback);
          return null;
        }
        return null;
View Full Code Here

        } catch (IOException ex) {
          if (!ex.getMessage().contentEquals("Connection closed"))
            KarafJMXPlugin.getLogger().warning(ex);
          return null;
        }
        final Set<ObjectName> queryNames = connection.queryNames(bundleStateQueryObjectName, null);
        for (ObjectName bundleStateObjectName : queryNames) {
          try {
            connection.removeNotificationListener(bundleStateObjectName, listener, filter, handback);
          } catch (Exception ex) {
            KarafJMXPlugin.getLogger().warning(ex);
View Full Code Here

        } catch (IOException ex) {
          if (!ex.getMessage().contentEquals("Connection closed"))
            KarafJMXPlugin.getLogger().warning(ex);
          return null;
        }
        final Set<ObjectName> queryNames = connection.queryNames(bundleStateQueryObjectName, null);
        for (ObjectName bundleStateObjectName : queryNames) {
          BundleStateMBean BundleStateMBean = MBeanServerInvocationHandler.newProxyInstance(connection, bundleStateObjectName, BundleStateMBean.class, true);
          return callback.doWithBundleStateMBean(BundleStateMBean);
        }
        return null;
View Full Code Here

        } catch (IOException ex) {
          if (!ex.getMessage().contentEquals("Connection closed"))
            KarafJMXPlugin.getLogger().warning(ex);
          return null;
        }
        final Set<ObjectName> queryNames = connection.queryNames(serviceStateQueryObjectName, null);
        for (ObjectName ServiceStateObjectName : queryNames) {
          ServiceStateMBean serviceStateMBean = MBeanServerInvocationHandler.newProxyInstance(connection, ServiceStateObjectName, ServiceStateMBean.class, true);
          return callback.doWithServiceStateMBean(serviceStateMBean);
        }
        return null;
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.