Package javax.management

Examples of javax.management.MBeanServerConnection.queryNames()


                    "org.apache.qpid:" +
                    "type=VirtualHost.Exchange," +
                    "VirtualHost=" + ObjectName.quote(virHost) + "," +
                    "name=" + ObjectName.quote(exchName) + ",*");

            Set<ObjectName> exchanges = mbsc.queryNames(customExchangeObjectName, null);

            if(exchanges.size() == 0)
            {
                System.out.println("Exchange wasnt found: " + exchName);

View Full Code Here


    JMXConnector jmxConnector = null;
    try {
      jmxConnector = MxUtil.getCachedMBeanConnector(connectionProps);
      final MBeanServerConnection conn = jmxConnector
          .getMBeanServerConnection();
      final Set<ObjectName> result = conn.queryNames(patternOn, null);

      if (result.iterator().hasNext()) {
        return result.iterator().next().getCanonicalName();
      }
    } catch (IOException e) {
View Full Code Here

        // At the time of this writing, HBase didn't unregister the MBean of a replication source
        try {
            MBeanServerConnection connection = java.lang.management.ManagementFactory.getPlatformMBeanServer();
            ObjectName query = new ObjectName(MBEAN_NAME + NAME_WILDCARD);
            for (ObjectName name : connection.queryNames(query, null)) {
                connection.unregisterMBean(name);
            }
        } catch (Exception e) {
            throw new RuntimeException("Error removing replication source mbean", e);
        }
View Full Code Here

        table.close();

        // Using JMX, query the size of the queue of hlogs to be processed for each replication source
        MBeanServerConnection connection = java.lang.management.ManagementFactory.getPlatformMBeanServer();
        ObjectName replicationSources = new ObjectName(mbeanName);
        Set<ObjectName> mbeans = connection.queryNames(replicationSources, null);
        long tryUntil = System.currentTimeMillis() + timeout;
        nextMBean: for (ObjectName mbean : mbeans) {
            int logQSize = Integer.MAX_VALUE;
            while (logQSize > 0 && System.currentTimeMillis() < tryUntil) {
                logQSize = ((Number)connection.getAttribute(mbean, attrName)).intValue();
View Full Code Here

    }

    public int terminateZooKeeperConnections() throws Exception {
        MBeanServerConnection connection = java.lang.management.ManagementFactory.getPlatformMBeanServer();
        ObjectName replicationSources = new ObjectName("org.apache.ZooKeeperService:name0=*,name1=Connections,name2=*,name3=*");
        Set<ObjectName> mbeans = connection.queryNames(replicationSources, null);
        int connectionCount = mbeans.size();

        for (ObjectName name : mbeans) {
            connection.invoke(name, "terminateConnection", new Object[] {}, new String[] {});
        }
View Full Code Here

        MBeanServerConnection service;
        try
        {
            service = JMXMonitor.getServiceConnection();

            connectors = service.queryNames(new ObjectName("org.eclipse.jetty.nio:type=selectchannelconnector,*"), null);
            if (connectors != null && connectors.size() > 0)
            {
                Integer lowest = Integer.MAX_VALUE;
                for (final ObjectName connector : connectors) {
                    lowest = (Integer)service.getAttribute(connector, "port");
View Full Code Here

        throws IOException, MalformedObjectNameException
    {
        ObjectName[] result = null;
       
        MBeanServerConnection connection = JMXMonitor.getServiceConnection();
        Set names = connection.queryNames(param, null);
        if (names != null && names.size() > 0)
        {
            result = new ObjectName[names.size()];
           
            int idx = 0;
View Full Code Here

            double usedHeapMB = ((double)(Long)heapMemUsage.get("used")) / 1024d / 1024d;

            table.columns(address, version, String.valueOf(indexerMaster), maxHeapMB, usedHeapMB);

            ObjectName indexUpdaterPattern = new ObjectName("Lily:service=SEP,name=IndexUpdater_*");
            Set<ObjectName> indexUpdaterNames = connection.queryNames(indexUpdaterPattern, null);
            for (ObjectName indexUpdater : indexUpdaterNames) {
                Long lastSepTimestamp = (Long)connection.getAttribute(indexUpdater, "lastSepTimestamp");
                String indexName = indexUpdater.getKeyProperty("name").substring("IndexUpdater_".length());
                sepTimestampByIndexAndServer.get(indexName).put(server, lastSepTimestamp);
            }
View Full Code Here

 
  public boolean makeServerConnection(JMXConnector jmxConnector) throws IOException, MBeanException,
    AttributeNotFoundException, InstanceNotFoundException, ReflectionException, MalformedObjectNameException{
     
    MBeanServerConnection mBeanServerConnection = jmxConnector.getMBeanServerConnection();
        Set<ObjectName> mbeans = mBeanServerConnection.queryNames(new ObjectName("CoUGAR:name=healthChecker,*"), null);
        if (!mbeans.isEmpty()) {
            mBeanServerConnection.getAttribute(mbeans.iterator().next(), "SystemInService");
            return true;
        }
        return false;
View Full Code Here

        // connector server is bound to
        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

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.