Package javax.management

Examples of javax.management.QueryExp


     * @param queryExpStr - query expression string
     * @return set of mbeans that matches the query
     * @throws IOException - if there is a problem querying the JMX context
     */
    protected List queryMBeans(ObjectName objName, String queryExpStr) throws IOException {
        QueryExp queryExp = createQueryExp(queryExpStr);

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

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

    public Set<ObjectInstance>
        queryMBeans(ObjectName name,
                    MarshalledObject query,
                    Subject delegationSubject)
        throws IOException {
        final QueryExp queryValue;
        final boolean debug=logger.debugOn();

        if (debug) logger.debug("queryMBeans",
                 "connectionId=" + connectionId
                 +" unwrapping query with defaultClassLoader.");
View Full Code Here

    public Set<ObjectName>
        queryNames(ObjectName name,
                   MarshalledObject query,
                   Subject delegationSubject)
        throws IOException {
        final QueryExp queryValue;
        final boolean debug=logger.debugOn();

        if (debug) logger.debug("queryNames",
                 "connectionId=" + connectionId
                 +" unwrapping query with defaultClassLoader.");
View Full Code Here

    controller.stopAndWait();
  }

  private boolean expireAppMasterZKSession(TwillController controller, long timeout, TimeUnit timeoutUnit) {
    MBeanServer mbeanServer = MBeanRegistry.getInstance().getPlatformMBeanServer();
    QueryExp query = Query.isInstanceOf(new StringValueExp(ConnectionMXBean.class.getName()));

    Stopwatch stopwatch = new Stopwatch();

    do {
      // Find the AM session and expire it
View Full Code Here

            MBeanServer server = getContext().getManagementStrategy().getManagementAgent().getMBeanServer();
            if (server != null) {
                // get all the processor mbeans and sort them accordingly to their index
                String prefix = getContext().getManagementStrategy().getManagementAgent().getIncludeHostName() ? "*/" : "";
                ObjectName query = ObjectName.getInstance("org.apache.camel:context=" + prefix + getContext().getManagementName() + ",type=processors,*");
                QueryExp queryExp = Query.match(new AttributeValueExp("RouteId"), new StringValueExp(getRouteId()));
                Set<ObjectName> names = server.queryNames(query, queryExp);
                for (ObjectName name : names) {
                    server.invoke(name, "reset", null, null);
                }
            }
View Full Code Here

  @SuppressWarnings("serial")
  public static List<MBeanInstance> getInstancesOf(final String mbeanInterface) {
    try {
      Set<ObjectInstance> beans = getMBeanServer().queryMBeans(null,
          new QueryExp() {

            MBeanServer s;

            @Override
            public boolean apply(ObjectName name) {
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));

View Full Code Here

            ObjectName on = new ObjectName("domain:type=Simple,pattern=" +
                                           ObjectName.quote(pattern) +
                                           ",name=" + i);
            Simple s = new Simple(data[i][0]);
            mbs.registerMBean(s, on);
            QueryExp q =
                Query.match(Query.attr("StringNumber"), Query.value(pattern));
            q.setMBeanServer(mbs);
            boolean r = q.apply(on);
            System.out.print("Attribute Value = " +
                mbs.getAttribute(on, "StringNumber"));
            if (r && "OK".equals(data[i][1])) {
                System.out.println(" OK");
            } else if (!r && "KO".equals(data[i][1])) {
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.