Examples of ManagementContext


Examples of org.apache.servicemix.jbi.management.ManagementContext

        String key = EndpointSupport.getUniqueKey(endpoint);
        ComponentStats compStats = componentStats.get(endpoint.getComponentNameSpace().getName());
        EndpointStats stats = new EndpointStats(endpoint, compStats.getMessagingStats());
        endpointStats.putIfAbsent(key, stats);
        // Register MBean
        ManagementContext context = container.getManagementContext();
        try {
            context.registerMBean(context.createObjectName(context.createObjectNameProps(stats, true)),
                                  stats,
                                  EndpointStatsMBean.class);
        } catch (Exception e) {
            LOG.info("Unable to register endpoint statistics MBean: " + e.getMessage());
            if (LOG.isDebugEnabled()) {
View Full Code Here

Examples of org.apache.servicemix.jbi.management.ManagementContext

     */
    private void removeEndpointStats(JBIContainer containner, AbstractServiceEndpoint endpoint) {
        String key = EndpointSupport.getUniqueKey(endpoint);
        EndpointStats stats = endpointStats.remove(key);
        // Register MBean
        ManagementContext context = container.getManagementContext();
        try {
            context.unregisterMBean(context.createObjectName(context.createObjectNameProps(stats, true)));
        } catch (Exception e) {
            LOG.info("Unable to unregister endpoint statistics MBean: " + e.getMessage());
            if (LOG.isDebugEnabled()) {
                LOG.debug("Unable to unregister endpoint statistics MBean", e);
            }
View Full Code Here

Examples of org.apache.servicemix.jbi.management.ManagementContext

     */
    private void removeEndpointStats(JBIContainer containner, AbstractServiceEndpoint endpoint) {
        String key = EndpointSupport.getUniqueKey(endpoint);
        EndpointStats stats = endpointStats.remove(key);
        // Register MBean
        ManagementContext context = container.getManagementContext();
        try {
            context.unregisterMBean(context.createObjectName(context.createObjectNameProps(stats, true)));
        } catch (Exception e) {
            LOGGER.info("Unable to unregister endpoint statistics MBean: {}", e.getMessage());
            LOGGER.debug("Unable to unregister endpoint statistics MBean", e);
        }
    }
View Full Code Here

Examples of org.apache.servicemix.jbi.management.ManagementContext

    private void createComponentStats(JBIContainer container, ComponentMBeanImpl component) {
        String key = component.getName();
        ComponentStats stats = new ComponentStats(component);
        componentStats.putIfAbsent(key, stats);
        // Register MBean
        ManagementContext context = container.getManagementContext();
        try {
            context.registerMBean(context.createObjectName(context.createObjectNameProps(stats, true)),
                    stats,
                    ComponentStatsMBean.class);
        } catch (Exception e) {
            LOGGER.info("Unable to register component statistics MBean: {}", e.getMessage());
            LOGGER.debug("Unable to register component statistics MBean", e);
View Full Code Here

Examples of org.apache.servicemix.jbi.management.ManagementContext

        ComponentStats stats = componentStats.remove(key);
        if (stats == null) {
            return;
        }
        // Register MBean
        ManagementContext context = container.getManagementContext();
        try {
            context.unregisterMBean(context.createObjectName(context.createObjectNameProps(stats, true)));
        } catch (Exception e) {
            LOGGER.info("Unable to unregister component statistics MBean: {}", e);
            LOGGER.debug("Unable to unregister component statistics MBean", e);
        }
    }
View Full Code Here

Examples of org.apache.servicemix.jbi.management.ManagementContext

        String key = EndpointSupport.getUniqueKey(endpoint);
        ComponentStats compStats = componentStats.get(endpoint.getComponentNameSpace().getName());
        EndpointStats stats = new EndpointStats(endpoint, compStats.getMessagingStats());
        endpointStats.putIfAbsent(key, stats);
        // Register MBean
        ManagementContext context = container.getManagementContext();
        try {
            context.registerMBean(context.createObjectName(context.createObjectNameProps(stats, true)),
                                  stats,
                                  EndpointStatsMBean.class);
        } catch (Exception e) {
            LOGGER.info("Unable to register endpoint statistics MBean: {}", e.getMessage());
            LOGGER.debug("Unable to register endpoint statistics MBean", e);
View Full Code Here

Examples of org.exoplatform.management.ManagementContext

         {
            if (!STARTED)
            {
               addTriggers();
               ExoContainer container = ExoContainerContext.getTopContainer();
               ManagementContext ctx = null;
               if (container != null)
               {
                  ctx = container.getManagementContext();
               }
               if (ctx == null)
               {
                  LOG.warn("Cannot register the statistics");
               }
               else
               {
                  ctx.register(new JCRStatisticsManager());
               }
               STARTED = true;
            }
         }
      }
View Full Code Here

Examples of org.exoplatform.management.ManagementContext

         {
            if (!STARTED)
            {
               addTriggers();
               ExoContainer container = ExoContainerContext.getTopContainer();
               ManagementContext ctx = null;
               if (container != null)
               {
                  ctx = container.getManagementContext();
               }
               if (ctx == null)
               {
                  LOG.warn("Cannot register the statistics");
               }
               else
               {
                  ctx.register(new JCRStatisticsManager());
               }
               STARTED = true;
            }
         }
      }
View Full Code Here

Examples of org.exoplatform.management.ManagementContext

         {
            if (!STARTED)
            {
               addTriggers();
               ExoContainer container = ExoContainerContext.getTopContainer();
               ManagementContext ctx = null;
               if (container != null)
               {
                  ctx = container.getManagementContext();
               }
               if (ctx == null)
               {
                  LOG.warn("Cannot register the statistics");
               }
               else
               {
                  ctx.register(new JCRStatisticsManager());
               }
               STARTED = true;
            }
         }
      }
View Full Code Here

Examples of org.jclouds.management.ManagementContext


   @Test
   void testManagementLifecycle()  {
      //Test that the ManagementLifeCycle module properly listens for view creation events and context destruction.
      ManagementContext managementContext = createMock(ManagementContext.class);

      managementContext.register(anyObject(Compute.class));
      expectLastCall().once();
      managementContext.manage(anyObject(ComputeManagement.class), eq("testname"));
      expectLastCall().once();
      managementContext.unmanage(anyObject(ComputeManagement.class), eq("testname"));
      expectLastCall().once();
      managementContext.unregister(anyObject(Compute.class));
      expectLastCall().once();
      replay(managementContext);

      Compute compute = ContextBuilder.newBuilder(new JcloudsTestComputeProviderMetadata()).name("testname")
              .credentials("user", "password")
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.