Package javax.management

Examples of javax.management.QueryExp


         ObjectName name = new ObjectName("Domain1:type=instance1");
         NumberTest bean1 = new NumberTest(1);
         NumberTest bean2 = new NumberTest(2);
         server1.registerMBean(bean1, name);
         server2.registerMBean(bean2, name);
         QueryExp query = Query.eq(Query.attr("Number"), Query.value(2));
         QueryThread thread1 = new QueryThread(server1, query, 0);
         QueryThread thread2 = new QueryThread(server2, query, 1);
         thread1.start();
         thread2.start();
         thread1.join(10000);
View Full Code Here


    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        try {
            MBeanServer beanServer = getMBeanServer();
            ObjectName name = getObjectName(request);
            QueryExp query = getQueryExp(request);

            JMXWriter writer = new JMXWriter(response.getWriter(), getManagementContext());

            String style = request.getParameter("style");
            String view = request.getParameter("view");
View Full Code Here

    public void setManagementContext(ManagementContext managementContext) {
        this.managementContext = managementContext;
    }

    protected QueryExp getQueryExp(HttpServletRequest request) throws ServletException {
        QueryExp answer = null;
        String value = request.getParameter("query");
        if (value != null) {
            try {
                answer = new ObjectName(value);
            }
View Full Code Here

        MBeanServer homeServer,
        ObjectName query,
        Domain domain)
    {
        //Retrieve a list of MBeans with object names that include           
        QueryExp queryExpr = null;
        Set mBeans = null;

        mBeans = homeServer.queryNames(query, queryExpr);

        Collection rval = new ArrayList(mBeans.size());
View Full Code Here

     */
    protected List queryMBeans(ObjectName objName, String queryExpStr) throws IOException {
        JMXConnector jmxConn = createJmxConnector();
        MBeanServerConnection server = jmxConn.getMBeanServerConnection();

        QueryExp queryExp = createQueryExp(queryExpStr);

        // Convert mbeans set to list to make it standard throughout the query filter
        List mbeans = new ArrayList(server.queryMBeans(objName, queryExp));

        jmxConn.close();
View Full Code Here

        // Was the topic created?
        String topicsQuery = "org.apache.activemq:BrokerName=localhost,Type=Queue,*";
        // listMBeans(conn, topicsQuery);

        // Use JMX query expressions
        QueryExp queryExp = Query
                .eq(Query.attr("Name"), Query.value(queueName));

        ObjectName objName;
        Set<ObjectInstance> mbeans = null;

View Full Code Here

        // Was the queue created?
        String topicsQuery =
            "org.apache.activemq:BrokerName=localhost,Type=Queue,*";

        // Use JMX query expressions
        QueryExp queryExp =
            Query.gt(Query.attr("QueueSize"), Query.value(queueSize));

        ObjectName objName;
        Set<ObjectInstance> mbeans = null;

View Full Code Here

        MBeanServer mbs = ManagementFactory.getMBeanServer();
        boolean areRequestsInService;
        long start = System.currentTimeMillis();
        do {
            // Check whether there are any processors which are currently in the SERVICE stage (3)
            QueryExp query = Query.eq(Query.attr("stage"), Query.value(3))// 3 = org.apache.coyote.Constants.STAGE_SERVICE
            Set set = mbs.queryNames(new ObjectName("Catalina:type=RequestProcessor,*"), query);
            if (set.size() > 0) {
                areRequestsInService = true;
                if (System.currentTimeMillis() - start > TIMEOUT) {
                    log.warn("Timeout occurred even though there are active connections.");
View Full Code Here

      return rmiServer.getMBeanServer().getObjectInstance(name);
   }

   public Set queryMBeans(ObjectName name, MarshalledObject query, Subject delegationSubject) throws IOException
   {
      QueryExp filter = (QueryExp) loadMarshalledObject(query);
      return rmiServer.getMBeanServer().queryMBeans(name, filter);
   }
View Full Code Here

      return loadMarshalledObject(null, object);
   }

   public Set queryNames(ObjectName name, MarshalledObject query, Subject delegationSubject) throws IOException
   {
      QueryExp filter = (QueryExp) loadMarshalledObject(query);
      return rmiServer.getMBeanServer().queryNames(name, filter);
   }
View Full Code Here

TOP

Related Classes of javax.management.QueryExp

Copyright © 2018 www.massapicom. 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.