Package javax.management

Examples of javax.management.ObjectName$PatternProperty


      }
   }

   public void testGetCacheObjectName() throws Exception
   {
      ObjectName on = new ObjectName("jboss.cache:test=SetCacheObjectName");
      String str = on.getCanonicalName();
      CacheJmxWrapper<String, String> wrapper = createWrapper(createConfiguration());
      wrapper.setCacheObjectName(str);

      assertEquals("Setter and getter match", str, wrapper.getCacheObjectName());

      // Go back to the default
      wrapper.setCacheObjectName(null);
      assertEquals("Got default ObjectName", JmxRegistrationManager.REPLICATED_CACHE_PREFIX + clusterName, wrapper.getCacheObjectName());

      registerWrapper(wrapper);
      assertEquals("Returns standard name", mBeanName, new ObjectName(wrapper.getCacheObjectName()));
   }
View Full Code Here


      m_server = MBeanServerFactory.createMBeanServer();

      Object cacheMBean = createCacheAndJmxWrapper();

      //    bind manually for now.
      ObjectName mgmt = getWrapperObjectName();

      m_server.registerMBean(cacheMBean, mgmt);
   }
View Full Code Here

      destroyCache();

      if (m_server != null)
      {
         ObjectName mgmt = getWrapperObjectName();
         if (m_server.isRegistered(mgmt))
            m_server.unregisterMBean(mgmt);
      }
   }
View Full Code Here

      }
   }

   protected ObjectName getWrapperObjectName() throws Exception
   {
      return new ObjectName(JmxRegistrationManager.REPLICATED_CACHE_PREFIX + CLUSTER_NAME);
   }
View Full Code Here

   public void testNotifications() throws Exception
   {
      assertNotNull("MBeanServer is null.", m_server);
      assertNotNull("Cache is null.", cache);

      ObjectName mgmt = getWrapperObjectName();
      MyListener listener = new MyListener(mgmt);


      m_server.addNotificationListener(mgmt, listener, null, null);
View Full Code Here

   {
      // undo setup
      cleanup();

      CacheJmxWrapper<Object, Object> wrapper = new CacheJmxWrapper<Object, Object>();
      ObjectName mgmt = getWrapperObjectName();
      m_server.registerMBean(wrapper, mgmt);
      MyListener listener = new MyListener(mgmt);
      m_server.addNotificationListener(mgmt, listener, null, null);

      cache = createCache(CLUSTER_NAME);
View Full Code Here

      // start the cache before registering listener
      cache.start();

      try
      {
         ObjectName mgmt = getWrapperObjectName();
         MyListener listener = new MyListener(mgmt);

         m_server.addNotificationListener(mgmt, listener, null, null);

         // add a node - this will trigger NodeCreated, NodeModify(pre/post) and NodeModified
View Full Code Here

   public void testListenerRemoval() throws Exception
   {
      assertNotNull("MBeanServer is null.", m_server);
      assertNotNull("Cache is null.", cache);

      ObjectName mgmt = getWrapperObjectName();
      MyListener listener = new MyListener(mgmt);

      m_server.addNotificationListener(mgmt, listener, null, null);

      // start the cache after registering listener - this will trigger CacheStarted
View Full Code Here

        long threadID = ServletRequestUtils.getLongParameter(request, "id", -1);
        String threadName = ServletRequestUtils.getStringParameter(request, "name", null);

        List stack = null;
        MBeanServer mBeanServer = new Registry().getMBeanServer();
        ObjectName threadingOName = new ObjectName("java.lang:type=Threading");


        if (threadID == -1 && threadName != null) {
            // find thread by name
            long[] allIds = (long[]) mBeanServer.getAttribute(threadingOName, "AllThreadIds");
View Full Code Here

    public void setWrapper(Wrapper wrapper) {
        if (wrapper != null) {
            host = (Host) wrapper.getParent().getParent();
            try {
                deployerOName = new ObjectName(host.getParent().getName() + ":type=Deployer,host=" + host.getName());
            } catch (MalformedObjectNameException e) {
                // do nothing here
            }
            host.getPipeline().addValve(valve);
            mBeanServer = Registry.getRegistry(null, null).getMBeanServer();
View Full Code Here

TOP

Related Classes of javax.management.ObjectName$PatternProperty

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.