Examples of RepositoryClassLoader


Examples of org.jboss.mx.loading.RepositoryClassLoader

         }
         // We have to clear Blacklist caches or the class will never
         // be found
         //((UnifiedClassLoader)dcl).clearBlacklists();
         // To be backward compatible
         RepositoryClassLoader rcl = (RepositoryClassLoader) getClassLoader();
         rcl.clearClassBlackList();
         rcl.clearResourceBlackList();

         // Now load the class through the cl
         dynClass = getClassLoader().loadClass(cc.getName());
      }
      catch (Exception ex)
View Full Code Here

Examples of org.jboss.mx.loading.RepositoryClassLoader

   }

   // FIXME: JBAOP-107 REMOVE THIS HACK
   public boolean isValid()
   {
      RepositoryClassLoader cl = (RepositoryClassLoader) getClassLoader();
      if (cl == null)
         return false;
      return cl.getLoaderRepository() != null;
   }
View Full Code Here

Examples of org.jboss.mx.loading.RepositoryClassLoader

      ClassLoader classloader = getClassLoader();
      if (classloader == null)
         throw new IllegalStateException("ClassLoader no longer exists: " + classLoaderString);
      if (classloader instanceof RepositoryClassLoader == false)
         throw new IllegalStateException("ClassLoader is not an instanceof RepositoryClassLoader " + classLoaderString);
      RepositoryClassLoader repositoryClassLoader = (RepositoryClassLoader) classloader;
      LoaderRepository loaderRepository = repositoryClassLoader.getLoaderRepository();
      if (loaderRepository == null)
         throw new IllegalStateException("ClassLoader has been undeployed: " + classLoaderString);
      if (loaderRepository instanceof HeirarchicalLoaderRepository3 == false)
         throw new IllegalStateException("Repository " + loaderRepository + " for classlaoder " + classLoaderString + " is not an HeirarchicalLoaderRepository3");
      return (HeirarchicalLoaderRepository3) loaderRepository;
View Full Code Here

Examples of org.jboss.mx.loading.RepositoryClassLoader

   }
  
   private ClassLoader getTopLevelJBossClassLoader()
   {
      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      RepositoryClassLoader topRcl = null;
      while (loader != null)
      {
         if (loader instanceof RepositoryClassLoader)
         {
            topRcl = (RepositoryClassLoader)loader;
View Full Code Here

Examples of org.jboss.mx.loading.RepositoryClassLoader

      try
      {
         URL tmpURL = tempdir.toURI().toURL();
         URL tmpCP = new URL(tmpURL, "?dynamic=true");

         RepositoryClassLoader ucl = (RepositoryClassLoader) cl;

         // We may be undeploying.
         if (ucl.getLoaderRepository() != null)
         {
            ucl.addURL(tmpCP);
         }
        
         return tmpCP;
      }
      catch(Exception e)
View Full Code Here

Examples of org.jboss.mx.loading.RepositoryClassLoader

         fail("test.implementation.loading.support.Trivial is already visible");
      }
      catch (ClassNotFoundException expected) {}

      // Add the URL to the repository twice
      RepositoryClassLoader ucl1 = lr.newClassLoader(url, true);
      RepositoryClassLoader ucl2 = lr.newClassLoader(url, true);

      // Should be able to load the class
      lr.loadClass("test.implementation.loading.support.Trivial");

      // Remove one
      ucl1.unregister();

      // Should still be able to load the class
      lr.loadClass("test.implementation.loading.support.Trivial");

      // Remove the other
      ucl2.unregister();
   }
View Full Code Here

Examples of org.jboss.mx.loading.RepositoryClassLoader

                  if (c == null)
                  {
                     continue;
                  }
                  log.debug("found class in repository " + name);
                  RepositoryClassLoader cl = (RepositoryClassLoader) c.getClassLoader();
                  classDefinition = loadByteCode(cl, className);
               }
               catch (Exception e)
               {
                  log.debug("unable to get class from " + name + ": " + e.getMessage(), e);
View Full Code Here

Examples of org.jboss.mx.loading.RepositoryClassLoader

   private ClassLoader initBootLibrariesOld() throws Exception
   {
      List<URL> list = getBootURLs();
     
      // Create loaders for each URL
      RepositoryClassLoader loader = null;
      for (URL url : list)
      {
         log.debug("Creating loader for URL: " + url);

         // This is a boot URL, so key it on itself.
         Object[] args = {url, Boolean.TRUE};
         String[] sig = {"java.net.URL", "boolean"};
         loader = (RepositoryClassLoader) mbeanServer.invoke(DEFAULT_LOADER_NAME, "newClassLoader", args, sig);
      }
      bootstrapUCLName = loader.getObjectName();
      mbeanServer.registerMBean(loader, bootstrapUCLName);
      return loader;
   }
View Full Code Here

Examples of org.jboss.mx.loading.RepositoryClassLoader

   protected ObjectName registerClassLoader(DeploymentInfo di) throws DeploymentException
   {
      ObjectName uclName = null;
      try
      {
         RepositoryClassLoader ucl = di.ucl;
         uclName = ucl.getObjectName();
         if (server.isRegistered(uclName) == false)
         {
            server.registerMBean(di.ucl, uclName);
            registeredClassLoader = true;
         }
View Full Code Here

Examples of org.jboss.mx.loading.RepositoryClassLoader

   protected void unregisterClassLoader(DeploymentInfo di)
   {
      ObjectName uclName = null;
      try
      {
         RepositoryClassLoader ucl = di.ucl;
         if (ucl != null)
         {
            uclName = ucl.getObjectName();
            if (registeredClassLoader && server.isRegistered(uclName))
            {
               server.unregisterMBean(uclName);
               registeredClassLoader = false;
            }
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.