Package org.jboss.classloading.spi.dependency

Examples of org.jboss.classloading.spi.dependency.Module


      ScopedClassPool pool = null;
     
      if (cl instanceof RealClassLoader)
      {
         Module module = registry.getModule(cl);
         if (module != null && module.getDeterminedParentDomainName() != null)
         {
            //It is scoped
            ClassLoaderSystem sys = ClassLoaderSystem.getInstance();
            ClassLoaderDomain domain = sys.getDomain(module.getDeterminedDomainName());
            boolean parentFirst = module.isJ2seClassLoadingCompliance();
            ClassPool parentDomainPool = getParentUnitClassPool(cl);
            pool = new ScopedJBoss5ClassPool(cl, parent, parentDomainPool, repository, getTempURL(module), parentFirst, domain);
         }
         else
         {
View Full Code Here


      }
   }

   public void undeploy(DeploymentUnit unit, ClassLoadingMetaData deployment)
   {
      Module module = unit.removeAttachment(Module.class);
      if (module != null && classLoading != null)
         classLoading.removeModule(module);
   }
View Full Code Here

      if (classLoading == null)
         throw new IllegalStateException("The classLoading has not been set");
      if (system == null)
         throw new IllegalStateException("The system has not been set");

      Module module = unit.getAttachment(Module.class);
      if (module == null)
      {
         if (isTopLevelOnly())
            throw new IllegalStateException("No module for top level deployment " + unit.getName());
         else
            return unit.getParent().getClassLoader();
      }

      if (module instanceof ClassLoaderPolicyModule == false)
         throw new IllegalStateException("Module is not an instance of " + ClassLoaderPolicyModule.class.getName() + " actual=" + module.getClass().getName());
      ClassLoaderPolicyModule classLoaderPolicyModule = (ClassLoaderPolicyModule) module;

      boolean explicitTopLevel = false;
      ClassLoadingMetaData clmd = unit.getAttachment(ClassLoadingMetaData.class);
      if (clmd != null && clmd.isTopLevelClassLoader())
         explicitTopLevel = true;
     
      if (unit.isTopLevel() || module.getParentDomainName() != null || explicitTopLevel)
      {
         // Top level, just create the classloader
         return classLoaderPolicyModule.registerClassLoaderPolicy(system);
      }
      else
View Full Code Here

   }

   @Override
   public void removeClassLoader(DeploymentUnit unit) throws Exception
   {
      Module module = unit.getAttachment(Module.class);
      if (module == null)
         return;

      ClassLoader classLoader = unit.getClassLoader();
      try
      {
         try
         {
            // Remove the classloader
            system.unregisterClassLoader(classLoader);
         }
         finally
         {
            // Try to tidy up empty domains
            String domainName = module.getDeterminedDomainName();
            if (ClassLoaderSystem.DEFAULT_DOMAIN_NAME.equals(domainName) == false)
            {
               ClassLoaderDomain domain = system.getDomain(domainName);
               if (domain.hasClassLoaders() == false)
                  system.unregisterDomain(domain);
            }
         }
      }
      finally
      {
         cleanup(unit, module);
         module.reset();
      }
  }
View Full Code Here

      if (pool instanceof JBossClDelegatingClassPool == false)
      {
         throw new IllegalStateException("Not an instance of JBossClDelegatingClassPool: " + pool.getClass().getName());
      }
     
      Module module = getModuleForPool(pool);
      boolean trace = logger.isTraceEnabled();
     
      for (String pkg : module.getPackageNames())
      {
         Set<DelegatingClassPool> pools = poolsByPackage.get(pkg);
         if (pools == null)
         {
            pools = new LinkedHashSet<DelegatingClassPool>();
View Full Code Here

   @Override
   protected synchronized void removeClassPool(DelegatingClassPool pool)
   {
      super.removeClassPool(pool);
  
      Module module = getModuleForPool(pool);
      boolean trace = logger.isTraceEnabled();

      for (String pkg : module.getPackageNames())
      {
         Set<DelegatingClassPool> pools = poolsByPackage.get(pkg);
         if (pools != null)
         {
            pools.remove(pool);
View Full Code Here

      {
         if (trace) logger.trace(this + " isPrimitive " + classname);
      }
      else
      {
         Module module = getModuleForPool(initiatingPool);
         if (module != null && module.isImportAll())
         {
            //Use the old "big ball of mud" model
            if (trace) logger.trace(this + " isImportAll");
            return super.getCachedOrCreate(initiatingPool, classname, resourceName, create, trace);
         }
View Full Code Here

   {
      if (pool == null)
      {
         return null;
      }
      Module module = ((JBossClDelegatingClassPool)pool).getModule();
      if (logger.isTraceEnabled()) logger.trace(this + " got module " + module + " for " + pool);
      return module;
   }
View Full Code Here

      return new ArrayList<DelegatingClassPool>(poolSet);
   }

   private CtClass getCtClassFromModule(final Module module, final String classname, boolean trace)
   {
      Module found = null;
      try
      {
         found = AccessController.doPrivileged(new PrivilegedExceptionAction<Module>()
         {
        
View Full Code Here

   {
      ClassPool parent = getCreateParentClassPools(cl, src, repository);
     
      if (cl instanceof RealClassLoader)
      {
         Module module = registry.getModule(cl);
         if (module == null)
         {
            module = getModuleForClassLoader(cl);
         }
         registerModuleCallback.registerModule(module);
View Full Code Here

TOP

Related Classes of org.jboss.classloading.spi.dependency.Module

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.