Package mx4j.loading

Examples of mx4j.loading.MLetTag


         MLetParser parser = new MLetParser(this);
         List tags = parser.parse(content);

         for (int i = 0; i < tags.size(); ++i)
         {
            MLetTag tag = (MLetTag)tags.get(i);

            // Add the MBean's codebase to the MLet classloader
            String[] jars = tag.parseArchive();
            for (int j = 0; j < jars.length; ++j)
            {
               String jar = jars[j];
               URL codebase = handleCheck(tag, jar, mletFileURL, mbeans);
               URL archiveURL = tag.createArchiveURL(codebase, jar);
               addURL(archiveURL);
            }

            // Create and register the MBean
            Object obj = createMBean(tag);
View Full Code Here


         MLetParser parser = new MLetParser(this);
         List tags = parser.parse(content);

         for (int i = 0; i < tags.size(); ++i)
         {
            MLetTag tag = (MLetTag)tags.get(i);

            // Add the MBean's codebase to the MLet classloader
            String[] jars = tag.parseArchive();
            for (int j = 0; j < jars.length; ++j)
            {
               String jar = jars[j];
               URL codebase = handleCheck(tag, jar, mletFileURL, mbeans);
               URL archiveURL = tag.createArchiveURL(codebase, jar);
               addURL(archiveURL);
            }

            // Create and register the MBean
            Object obj = createMBean(tag);
View Full Code Here

      String codebase = ".";
      String content = "<MLET CODE=\"" + className + "\" NAME=\":name=test\" ARCHIVE=\"" + jar + "\" CODEBASE=\"" + codebase + "\"/>";
      MLetParser parser = new MLetParser();
      List tags = parser.parse(content);
      MLetTag tag = (MLetTag)tags.get(0);
      URL mletFileURL = new URL("http://mx4j.sourceforge.net/mlets/mbeans.mlet");
      URL codebaseURL = tag.normalizeCodeBase(mletFileURL);
      assertEquals(codebaseURL.toExternalForm(), "http://mx4j.sourceforge.net/mlets/");

      content = "<MLET CODE=\"" + className + "\" NAME=\":name=test\" ARCHIVE=\"" + jar + "\"/>";
      tags = parser.parse(content);
      tag = (MLetTag)tags.get(0);
      codebaseURL = tag.normalizeCodeBase(mletFileURL);
      assertEquals(codebaseURL.toExternalForm(), "http://mx4j.sourceforge.net/mlets/");

      codebase = "../lib";
      content = "<MLET CODE=\"" + className + "\" NAME=\":name=test\" ARCHIVE=\"" + jar + "\" CODEBASE=\"" + codebase + "\"/>";
      tags = parser.parse(content);
      tag = (MLetTag)tags.get(0);
      codebaseURL = tag.normalizeCodeBase(mletFileURL);
      assertEquals(codebaseURL.toExternalForm(), "http://mx4j.sourceforge.net/lib/");

      codebase = "ftp://mx4j.sourceforge.net/mbeans";
      content = "<MLET CODE=\"" + className + "\" NAME=\":name=test\" ARCHIVE=\"" + jar + "\" CODEBASE=\"" + codebase + "\"/>";
      tags = parser.parse(content);
      tag = (MLetTag)tags.get(0);
      codebaseURL = tag.normalizeCodeBase(mletFileURL);
      assertEquals(codebaseURL.toExternalForm(), codebase + "/");
   }
View Full Code Here

TOP

Related Classes of mx4j.loading.MLetTag

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.