Package javax.management

Examples of javax.management.MBeanServerConnection


      server.invoke(testerName, "testTypedef", params, sig);
   }

   public void testCFlow() throws Exception
   {
      MBeanServerConnection server = getServer();
      ObjectName testerName = new ObjectName("jboss.aop:name=AnnotatedTester");
      Object[] params = {};
      String[] sig = {};
      server.invoke(testerName, "testCFlow", params, sig);
   }
View Full Code Here


      server.invoke(testerName, "testCFlow", params, sig);
   }

   public void testPrepare() throws Exception
   {
      MBeanServerConnection server = getServer();
      ObjectName testerName = new ObjectName("jboss.aop:name=AnnotatedTester");
      Object[] params = {};
      String[] sig = {};
      server.invoke(testerName, "testPrepare", params, sig);
   }
View Full Code Here

      server.invoke(testerName, "testPrepare", params, sig);
   }

   public void testPrepareAtClassLevel() throws Exception
   {
      MBeanServerConnection server = getServer();
      ObjectName testerName = new ObjectName("jboss.aop:name=AnnotatedTester");
      Object[] params = {};
      String[] sig = {};
      server.invoke(testerName, "testPrepareAtClassLevel", params, sig);
   }
View Full Code Here

      server.invoke(testerName, "testPrepareAtClassLevel", params, sig);
   }

   public void testDynamicCFlow() throws Exception
   {
      MBeanServerConnection server = getServer();
      ObjectName testerName = new ObjectName("jboss.aop:name=AnnotatedTester");
      Object[] params = {};
      String[] sig = {};
      server.invoke(testerName, "testDynamicCFlow", params, sig);
   }
View Full Code Here

      server.invoke(testerName, "testDynamicCFlow", params, sig);
   }

   public void testAnnotationIntroduction() throws Exception
   {
      MBeanServerConnection server = getServer();
      ObjectName testerName = new ObjectName("jboss.aop:name=AnnotatedTester");
      Object[] params = {};
      String[] sig = {};
      server.invoke(testerName, "testAnnotationIntroduction", params, sig);
   }
View Full Code Here

      String[] sig = {};
      server.invoke(testerName, "testAnnotationIntroduction", params, sig);
   }
   public void testPrecedence() throws Exception
   {
      MBeanServerConnection server = getServer();
      ObjectName testerName = new ObjectName("jboss.aop:name=AnnotatedTester");
      Object[] params = {};
      String[] sig = {};
      server.invoke(testerName, "testPrecedence", params, sig);
   }
View Full Code Here

      getLog().debug("+++ testMBeanInfoMarshalling");
     
      initURLHandlers();
     
      InitialContext ctx = getInitialContext();
      MBeanServerConnection rmiAdaptor = (MBeanServerConnection)ctx.lookup("jmx/invoker/RMIAdaptor");
      Iterator it = rmiAdaptor.queryNames(null, null).iterator();
      getLog().debug("testMBeanInfoMarshalling:  rmiAdaptor = " + rmiAdaptor);
      while (it.hasNext())  
      {
         ObjectName objectName = (ObjectName)it.next();
         getLog().debug("testMBeanInfoMarshalling:  about to getMBeanInfo for objectName = " + objectName);        
         try
         {
            MBeanInfo mbeanInfo = rmiAdaptor.getMBeanInfo(objectName);
         }
         catch (Throwable t)
         {
            getLog().error("Caught exception getting MBeanInfo for: " + objectName, t);
            super.fail("Failed to get MBeanInfo for bean named: " + objectName);
View Full Code Here

   public void testCloseAll() throws Exception
   {
      getLog().debug("+++ testCloseAll");

      InitialContext ctx = getInitialContext();
      MBeanServerConnection rmiAdaptor = (MBeanServerConnection)ctx.lookup("jmx/invoker/RMIAdaptor");

      // the following should close rmiAdaptor
      org.jboss.system.server.jmx.JMXAdapter.closeAll();

      // the following should fail due to closed connection being used
      try {
         rmiAdaptor.getMBeanCount();
          super.fail("org.jboss.system.server.jmx.JMXAdapter.closeAll() didn't close the connection");
      }
      catch(Exception success) {
         getLog().debug("+++ testCloseAll succeeded (connection was closed)");
      }
View Full Code Here

     
      Thread.sleep(5 * 1000);
     
      assertEquals(1, status.queueFired());
     
      MBeanServerConnection server = getServer();
     
      ObjectName provider = null;
      ObjectName providerQuery = new ObjectName("jboss.j2ee:service=EJB,*");
      Iterator mbeans = server.queryMBeans(providerQuery, null).iterator();
      while (provider == null)
      {
         ObjectInstance providerInstance = (ObjectInstance)mbeans.next();
         String name = providerInstance.getObjectName().toString();
         if (name.contains("Mdb") && !name.contains("plugin"))
            provider = providerInstance.getObjectName();
      }
     
      Object[] params = {};
      String[] sig = {};
      Object success = server.invoke(provider, "stop", params, sig);
     
      ObjectName jmsContainerInvokerQuery = new ObjectName("jboss.j2ee:binding=my-message-driven-bean,*");
      Set mbeansSet = server.queryMBeans(jmsContainerInvokerQuery, null);
      assertEquals(1, mbeansSet.size());
      ObjectInstance jmsContainerInvokerInstance = (ObjectInstance)mbeansSet.iterator().next();
      ObjectName jmsContainerInvoker = jmsContainerInvokerInstance.getObjectName();
      //      int numActiveSessions = (Integer)server.getAttribute(jmsContainerInvoker, "NumActiveSessions");
      //      assertEquals(1, numActiveSessions);
      /*boolean forceClear = (Boolean)server.getAttribute(jmsContainerInvoker, "ForceClearOnShutdown");
      assertFalse(forceClear);
      int forceClearAttempts = (Integer)server.getAttribute(jmsContainerInvoker, "ForceClearAttempts");
      assertEquals(5, forceClearAttempts);
      long forceClearOnShutdownInterval = (Long)server.getAttribute(jmsContainerInvoker, "ForceClearOnShutdownInterval");
      assertEquals(30000, forceClearOnShutdownInterval); */
     
      Thread.sleep(2 * 1000);
     
      success = server.invoke(provider, "start", params, sig);

      Thread.sleep(60 * 1000);
     
      //      numActiveSessions = (Integer)server.getAttribute(jmsContainerInvoker, "NumActiveSessions");
      //      assertEquals(1, numActiveSessions);
View Full Code Here

   protected <T> T invokeMainDeployer(String methodName, Object[] args, String[] sig, Class<T> clazz) throws Exception
   {
      if (clazz == null)
         throw new IllegalArgumentException("Null class.");

      MBeanServerConnection server = getServer();
      Object result = server.invoke(MainDeployerMBean.OBJECT_NAME, methodName, args, sig);
      return clazz.cast(result);
   }
View Full Code Here

TOP

Related Classes of javax.management.MBeanServerConnection

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.