Package javax.management.loading

Examples of javax.management.loading.MLet


            // XXX Not very clean...  Just a workaround
            if( ! loaderLoaded ) {
                // Register a loader that will be find ant classes.
                ObjectName defaultLoader= new ObjectName("modeler",
                        "loader", "modeler");
                MLet mlet=new MLet( new URL[0], this.getClass().getClassLoader());
                server.registerMBean(mlet, defaultLoader);
                loaderLoaded=true;
            }
       
            // Process nodes
View Full Code Here


                server=MBeanServerFactory.createMBeanServer();

                // Register a loader that will be find ant classes.
                ObjectName defaultLoader= new ObjectName("modeler-ant",
                        "loader", "ant");
                MLet mlet=new MLet( new URL[0], this.getClass().getClassLoader());
                server.registerMBean(mlet, defaultLoader);

                if( log.isDebugEnabled())
                    log.debug("Creating mbean server and loader "+ mlet +
                            " " + this.getClass().getClassLoader());
View Full Code Here

   */
  if (mletEnabled())  {
      try  {
                ObjectName mletName = new ObjectName(MQMLET_MBEAN_NAME);

          mqMLet = new MLet();
          agentRegisterMBean(mqMLet, mletName);
                logger.log(Logger.INFO,
            "MLET: Registering MLet MBean");
      } catch (Exception e)  {
          String name = "MQMLet";
View Full Code Here

                server=MBeanServerFactory.createMBeanServer();

                // Register a loader that will be find ant classes.
                ObjectName defaultLoader= new ObjectName("modeler-ant",
                        "loader", "ant");
                MLet mlet=new MLet( new URL[0], this.getClass().getClassLoader());
                server.registerMBean(mlet, defaultLoader);

                if( log.isDebugEnabled())
                    log.debug("Creating mbean server and loader "+ mlet +
                            " " + this.getClass().getClassLoader());
View Full Code Here

      //          "org.jboss.mx.server.registry.ManagedMBeanRegistry");

      ObjectName registry = new ObjectName(ServerConstants.MBEAN_REGISTRY);

      MBeanServer server = MBeanServerFactory.createMBeanServer();
      MLet mlet = new MLet();
      ObjectName name = new ObjectName("test:name=mlet");
      server.registerMBean(mlet, name);

      // Repeat to call the getMBeansFromURL method

      server.invoke(name, "getMBeansFromURL",
      new Object[] { MLET_URL1 },
      new String[] { String.class.getName() }
      );

      server.invoke(name, "getMBeansFromURL",
      new Object[] { MLET_URL2 },
      new String[] { String.class.getName() }
      );

      try
      {
         List versions1 =
               (List) server.invoke(registry, "getValue",
                                    new Object[]
                                    {
                                       new ObjectName("test:name=Trivial"),
                                       MBeanInstaller.VERSIONS
                                    },
                                    new String[]
                                    {
                                       ObjectName.class.getName(),
                                       String.class.getName()
                                    }
               );
         List versions2 =
               (List) server.invoke(registry, "getValue",
                                    new Object[]
                                    {
                                       new ObjectName("test:name=Trivial2"),
                                       MBeanInstaller.VERSIONS
                                    },
                                    new String[]
                                    {
                                       ObjectName.class.getName(),
                                       String.class.getName()
                                    }
               );

         assertTrue("Trivial1 version=" + versions1, ((String)versions1.get(0)).equals("1.1"));
         assertTrue("Trivial2 version=" + versions2, ((String)versions2.get(0)).equals("2.1"));
       }
      catch (MBeanException e)
      {
         e.printStackTrace();
         assertTrue(false);
      }

      try
      {
         assertTrue(server.isRegistered(new ObjectName("test:name=Trivial")));
         assertTrue(server.isRegistered(new ObjectName("test:name=Trivial2")));
      }
      catch (AssertionFailedError e)
      {
         URL[] urls = mlet.getURLs();
         fail("FAILS IN RI: SUN JMX RI builds a malformed URL from an MLet text file URL '" +
              MLET_URL1 + "' resulting into MLET codebase URL '" + urls[0] + "' and therefore fails " +
              "to load the required classes from the Java archive (MyMBeans.jar)");
      }
View Full Code Here

      }
     
      try
      {
         MBeanServer server = MBeanServerFactory.createMBeanServer();
         MLet mlet1 = new MLet();
         MLet mlet2 = new MLet();
         ObjectName m1Name = new ObjectName(":name=mlet1");
         ObjectName m2Name = new ObjectName(":name=mlet2");
        
         server.registerMBean(mlet1, m1Name);
         server.registerMBean(mlet2, m2Name);
View Full Code Here

   {
      // 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("file:./output/etc/test/compliance/server/Test.jar");
         server.registerMBean(mlet, name);
     
         Object o = server.instantiate("test.compliance.server.support.AClass");
      }
      finally
View Full Code Here

      {
         // 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"));
     
         Object o = server.instantiate("test.compliance.server.support.AClass");
     
//
View Full Code Here

   }

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

         // expected
      }

      MBeanServer server = MBeanServerFactory.createMBeanServer();
      ObjectName name = new ObjectName("test:name=mlet");
      MLet mlet = new MLet(new URL[] { new URL(MBEANS_URL)} );
     
      // make sure the class is not available
      try
      {
         DefaultLoaderRepository.loadClass("test.compliance.loading.support.Trivial");
View Full Code Here

TOP

Related Classes of javax.management.loading.MLet

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.