Examples of LoaderRepository


Examples of org.jboss.mx.loading.LoaderRepository

   {
      if (cl != null)
      {
         if (cl instanceof RepositoryClassLoader)
         {
            LoaderRepository repository = ((RepositoryClassLoader)cl).getLoaderRepository();
            repository.removeClassLoader(cl);
         }
      }
   }
View Full Code Here

Examples of org.jboss.mx.loading.LoaderRepository

      }

      aspect = super.getSuperPerVmAspect(def);
      if (aspect != null)
      {
         LoaderRepository loadingRepository = getAspectRepository(aspect);
         LoaderRepository myRepository = getScopedRepository();
         if (loadingRepository == myRepository)
         {
            //The parent does not load this class
            myPerVMAspects.put(def, aspect);
         }
         else
         {
            //The class has been loaded by a parent classloader, find out if we also have a copy
            try
            {
               Class<?> clazz = myRepository.loadClass(aspect.getClass().getName());
               if (clazz == aspect.getClass())
               {
                  notMyPerVMAspects.put(def, Boolean.TRUE);
               }
               else
View Full Code Here

Examples of org.jboss.mx.loading.LoaderRepository

      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.LoaderRepository

   public static boolean isScopedClassLoader(ClassLoader loader)
   {
      boolean scoped = false;
      if (loader instanceof RepositoryClassLoader)
      {
         LoaderRepository repository = ((RepositoryClassLoader)loader).getLoaderRepository();
         if (repository instanceof HeirarchicalLoaderRepository3)
         {
            scoped = true;
            //HeirarchicalLoaderRepository3 hlr = (HeirarchicalLoaderRepository3)repository;
            //boolean parentFirst = hlr.getUseParentFirst();
View Full Code Here

Examples of org.jboss.mx.loading.LoaderRepository

      return new NonDelegatingClassPool(cl, parent, repository, true);
   }

   private ClassPoolDomain getDomain(RepositoryClassLoader cl)
   {
      LoaderRepository loaderRepository = cl.getLoaderRepository();
      ClassPoolDomainRegistry registry = ClassPoolDomainRegistry.getInstance();
      ClassPoolDomain domain = registry.getDomain(loaderRepository);
      if (domain == null)
      {
         if (loaderRepository instanceof HeirarchicalLoaderRepository3)
View Full Code Here

Examples of org.jboss.mx.loading.LoaderRepository

   {
      if (cl != null)
      {
         if (cl instanceof RepositoryClassLoader)
         {
            LoaderRepository repository = ((RepositoryClassLoader)cl).getLoaderRepository();
            repository.removeClassLoader(cl);
         }
      }
   }
View Full Code Here

Examples of org.jboss.mx.loading.LoaderRepository

      // the urls used here are relative to the location of the build.xml
      final URL url = new URL("file:./output/etc/test/implementation/loading/MyMBeans.jar");

      // Retrieve the loader repository
      MBeanServer server = MBeanServerFactory.createMBeanServer();
      LoaderRepository lr = (LoaderRepository)server.getClassLoaderRepository();

      // Should not be able to load the class
      try
      {
         lr.loadClass("test.implementation.loading.support.Trivial");
         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.LoaderRepository

               log.debug("searching repository " + name);
              
               try
               {
                  Object o =  server.getAttribute(name, "Instance");
                  LoaderRepository repository = (LoaderRepository) o;
                  Class c = repository.getCachedClass(className);
                  if (c == null)
                  {
                     continue;
                  }
                  log.debug("found class in repository " + name);
View Full Code Here

Examples of org.jboss.mx.loading.LoaderRepository

      }

      aspect = super.getSuperPerVmAspect(def);
      if (aspect != null)
      {
         LoaderRepository loadingRepository = getAspectRepository(aspect);
         LoaderRepository myRepository = getScopedRepository();
         if (loadingRepository == myRepository)
         {
            //The parent does not load this class
            myPerVMAspects.put(def, aspect);
         }
         else
         {
            //The class has been loaded by a parent classloader, find out if we also have a copy
            try
            {
               Class clazz = myRepository.loadClass(aspect.getClass().getName());
               if (clazz == aspect.getClass())
               {
                  notMyPerVMAspects.put(def, Boolean.TRUE);
               }
               else
View Full Code Here

Examples of org.jboss.mx.loading.LoaderRepository

      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
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.