Examples of MLet


Examples of javax.management.loading.MLet

      // the urls used here are relative to the location of the build.xml

      final URL MLET_URL = new URL(location, "etc/tests/UnexpectedEnd.mlet");

      MBeanServer server = MBeanServerFactory.createMBeanServer();
      MLet mlet = new MLet();
      ObjectName name = new ObjectName("test:name=mlet");
      try
      {
         server.registerMBean(mlet, name);
        
View Full Code Here

Examples of javax.management.loading.MLet

      // the urls used here are relative to the location of the build.xml

      final URL MLET_URL = new URL(location, "etc/tests/MissingEndTag.mlet");

      MBeanServer server = MBeanServerFactory.createMBeanServer();
      MLet mlet = new MLet();
      ObjectName name = new ObjectName("test:name=mlet");
      try
      {
         server.registerMBean(mlet, name);
        
View Full Code Here

Examples of javax.management.loading.MLet

   {
      // NOTE:
      // the urls used here are relative to the location of the build.xml

      MBeanServer server = MBeanServerFactory.newMBeanServer();
      MLet mlet = new MLet();
      ObjectName name = new ObjectName(":test=test");
     
      // mlet cl to DLR
      try
      {
         mlet.addURL(new URL(location, "lib/jmxcompliance-Test.jar"));
         server.registerMBean(mlet, name);
     
         server.instantiate("org.jboss.test.jmx.compliance.server.support.AClass");
      }
      finally
View Full Code Here

Examples of javax.management.loading.MLet

      {
         // NOTE:
         // the urls used here are relative to the location of the build.xml

         MBeanServer server = MBeanServerFactory.newMBeanServer();
         MLet mlet = new MLet();
     
         // mlet cl to DLR
         mlet.addURL("file:./output/etc/test/compliance/server/Test.jar");
         //server.registerMBean(mlet, new ObjectName(":test=test"));
     
         server.instantiate("org.jboss.test.jmx.compliance.server.support.AClass");
     
//
View Full Code Here

Examples of javax.management.loading.MLet

         // Wait for notifications threads to start
         sleep(1000);

         // Register a new MBean, it will generate a notification
         MLet mlet = new MLet();
         ObjectName name = new ObjectName(":mbean=mlet");
         server.registerMBean(mlet, name);

         // Wait for notifications to arrive
         sleep(1000);
View Full Code Here

Examples of javax.management.loading.MLet

   public void testChildMLetRegisteredBeforeParentMLet() throws Exception
   {
      // A test to be sure the MLet implementation does not recurse infinitely when loading classes.

      URL url = getClass().getProtectionDomain().getCodeSource().getLocation();
      MLet parent = new MLet(new URL[]{url}, ClassLoader.getSystemClassLoader().getParent());
      MLet child = new MLet(new URL[0], parent);

      ObjectName parentName = new ObjectName("MLet", "type", "parent");
      ObjectName childName = new ObjectName("MLet", "type", "child");

      MBeanServer server = newMBeanServer();
View Full Code Here

Examples of javax.management.loading.MLet

      }
   }

   public void testFindLibrary() throws Exception
   {
      MLet mlet = new MLet();
      Method method = mlet.getClass().getDeclaredMethod("findLibrary", new Class[]{String.class});
      method.setAccessible(true);
      String result = (String)method.invoke(mlet, new Object[]{"stat"});
      if (result != null) fail("MLet can load non-existing libraries");
   }
View Full Code Here

Examples of javax.management.loading.MLet

      fos.close();

      assertTrue(libraryFile.exists());
      assertTrue(libraryFile.length() > 0);

      MLet mlet = new MLet(new URL[]{libraryFile.getCanonicalFile().getParentFile().toURL()});
      Method method = mlet.getClass().getDeclaredMethod("findLibrary", new Class[]{String.class});
      method.setAccessible(true);
      String result = (String)method.invoke(mlet, new Object[]{library});

      assertNotNull(result);
      assertTrue(libraryFile.exists());
View Full Code Here

Examples of javax.management.loading.MLet

      fos.close();

      assertTrue(libraryFile.exists());
      assertTrue(libraryFile.length() > 0);

      MLet mlet = new MLet(new URL[]{libraryFile.getCanonicalFile().getParentFile().toURL()});

      // Set the library directory to some temp directory
      File temp = File.createTempFile("abc", null);
      temp.deleteOnExit();
      mlet.setLibraryDirectory(temp.getCanonicalFile().getParentFile().getCanonicalPath());

      Method method = mlet.getClass().getDeclaredMethod("findLibrary", new Class[]{String.class});
      method.setAccessible(true);
      String result = (String)method.invoke(mlet, new Object[]{library});

      assertNotNull(result);
      assertTrue(libraryFile.exists());
      assertTrue(libraryFile.length() > 0);

      File tempLibrary = new File(mlet.getLibraryDirectory(), libraryName);
      assertTrue(tempLibrary.exists());
      assertTrue(tempLibrary.length() > 0);
   }
View Full Code Here

Examples of javax.management.loading.MLet

      assertTrue(tempLibrary.length() > 0);
   }

   public void testDefaultMletName() throws Exception {
      MBeanServer mbServer = newMBeanServer();
      MLet mlet = new MLet();
      ObjectName mletName = new ObjectName(mbServer.getDefaultDomain(), "type", "MLet");
      assertFalse(mbServer.isRegistered(mletName));
      assertEquals(mletName, mbServer.registerMBean(mlet, null).getObjectName());
      assertTrue(mbServer.isRegistered(mletName));
   }
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.