Examples of queryBeans()


Examples of org.mc4j.ems.connection.EmsConnection.queryBeans()

        if (null != webModuleMBeanName) {
            EmsConnection conn = getEmsConnection();
            if (null != conn) {
                ObjectNameQueryUtility queryUtility = new ObjectNameQueryUtility(webModuleMBeanName);
                List<EmsBean> mBeans = conn.queryBeans(queryUtility.getTranslatedQuery());
                // There should only be one mBean for this match.
                if (mBeans.size() == 1) {
                    result = mBeans.get(0);
                }
            }
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection.queryBeans()

        EmsConnection emsConnection = getEmsConnection();
        String query = QUERY_TEMPLATE_HOST;
        query = query.replace("%PATH%",
            getResourceContext().getPluginConfiguration().getSimpleValue(PROPERTY_CONTEXT_ROOT, ""));
        ObjectNameQueryUtility queryUtil = new ObjectNameQueryUtility(query);
        List<EmsBean> mBeans = emsConnection.queryBeans(queryUtil.getTranslatedQuery());
        return mBeans;
    }

    /**
     * Returns the name of the application.
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection.queryBeans()

        try {
            EmsConnection conn = getEmsConnection();
            if (conn == null) {
                return AvailabilityType.DOWN;
            }
            conn.queryBeans("java.lang:*"); // just make a request over the connection to make sure its valid
            return AvailabilityType.UP;
        } catch (Throwable t) {
            try {
                this.connection.close(); // try to clean up
            } catch (Throwable ignore) {
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection.queryBeans()

        // GlobalRequestProcessor MBeans must be fully deployed. If the mbeans aren't fully deployed then wait for
        // the next go around of the PC.
        EmsConnection connection = context.getParentResourceComponent().getEmsConnection();
        ObjectNameQueryUtility queryUtility = new ObjectNameQueryUtility(
            "Catalina:type=GlobalRequestProcessor,name=%name%");
        List<EmsBean> grpBeans = connection.queryBeans(queryUtility.getTranslatedQuery());

        if (grpBeans.size() != resourceDetails.size()) {
            if (log.isDebugEnabled())
                log.debug("Connector discovery pending jboss.web:type=GlobalRequestProcessor,name=* deployment...");
            return Collections.emptySet();
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection.queryBeans()

            // Get the query template, replacing the parent key variables with the values from the parent configuration
            ObjectNameQueryUtility queryUtility = new ObjectNameQueryUtility(objectNameQueryTemplate,
                (this.discoveryContext != null) ? this.discoveryContext.getParentResourceContext()
                    .getPluginConfiguration() : null);

            List<EmsBean> beans = connection.queryBeans(queryUtility.getTranslatedQuery());
            if (log.isDebugEnabled()) {
                log.debug("Found [" + beans.size() + "] mbeans for query [" + queryUtility.getTranslatedQuery() + "].");
            }
            for (EmsBean bean : beans) {
                if (queryUtility.setMatchedKeyValues(bean.getBeanName().getKeyProperties())) {
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection.queryBeans()

                // In some cases, this resource component may have been discovered by some means other than querying its
                // parent's EMSConnection (e.g. ApplicationDiscoveryComponent uses a filesystem to discover EARs and
                // WARs that are not yet deployed). In such cases, getBean() will return null, since EMS won't have the
                // bean in its cache. To cover such cases, make an attempt to query the underlying MBeanServer for the
                // bean before giving up.
                emsConnection.queryBeans(objectName);
                bean = emsConnection.getBean(objectName);
            }

            return bean;
        }
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection.queryBeans()

                // In some cases, this resource component may have been discovered by some means other than querying its
                // parent's EMSConnection (e.g. ApplicationDiscoveryComponent uses a filesystem to discover EARs and
                // WARs that are not yet deployed). In such cases, getBean() will return null, since EMS won't have the
                // bean in its cache. To cover such cases, make an attempt to query the underlying MBeanServer for the
                // bean before giving up.
                emsConnection.queryBeans(objectName);
                bean = emsConnection.getBean(objectName);
            }

            return bean;
        }
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection.queryBeans()

         * corresponding jboss.web:type=Connector,* primary connector MBeans.
         */
        EmsConnection connection = context.getParentResourceComponent().getEmsConnection();
        ObjectNameQueryUtility queryUtility = new ObjectNameQueryUtility(
            "jboss.web:type=GlobalRequestProcessor,name=%name%");
        List<EmsBean> beans = connection.queryBeans(queryUtility.getTranslatedQuery());

        // We can't populate the name and scheme in the plugin config if the GlobalRequestProcessor MBeans aren't
        // deployed yet, so just abort and try again the next time the PC calls us.
        if (beans.size() != resourceDetails.size()) {
            if (log.isDebugEnabled())
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection.queryBeans()

   public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) {
      boolean trace = log.isTraceEnabled();
      if (trace) log.trace("Get values metrics");
      EmsConnection conn = getEmsConnection();
      // First query them all so we don't have to do find them individually
      conn.queryBeans(namedCacheComponentPattern(cacheManagerName, cacheName, "*"));
      for (MeasurementScheduleRequest req : metrics) {
         if (trace) log.trace("Inspect metric " + req);
         String metric = req.getName();
         try {
            String metricBeanName = namedCacheComponentPattern(cacheManagerName, cacheName,
View Full Code Here

Examples of org.mc4j.ems.connection.EmsConnection.queryBeans()

      if (conn != null) {
         if (trace) log.trace("Connection to ems server established: " + conn);

         // Run query for manager_object
         ObjectNameQueryUtility queryUtility = new ObjectNameQueryUtility(objectName);
         List<EmsBean> beans = conn.queryBeans(queryUtility.getTranslatedQuery());
         if (trace) log.trace("Querying ["+queryUtility.getTranslatedQuery()+"] returned beans: " + beans);

         Set<DiscoveredResourceDetails> discoveredResources = new HashSet<DiscoveredResourceDetails>();
         for (EmsBean bean : beans) {
            // Filter out spurious beans
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.