Package org.jboss.classloading.spi.dependency

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


   }

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

      ClassLoader classLoader = unit.getClassLoader();
      if (classLoader instanceof InterceptionClassLoader)
      {
         InterceptionClassLoader icl = (InterceptionClassLoader)classLoader;
         classLoader = icl.getDelegate();
      }

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


      }
   }

   protected TestResourceVisitor visit(DeploymentUnit unit) throws Exception
   {
      Module module = unit.getAttachment(Module.class);
      if (module == null)
         fail("Expected " + unit + " to have a module");
     
      TestResourceVisitor visitor = new TestResourceVisitor();
      module.visit(visitor);
     
      getLog().debug(unit.getName() + " found: " + visitor.resources);
     
      return visitor;
   }
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();
     
      lockWrite();
      try
      {
         for (String pkg : module.getPackageNames())
         {
            Set<DelegatingClassPool> pools = poolsByPackage.get(pkg);
            if (pools == null)
            {
               pools = new LinkedHashSet<DelegatingClassPool>();
View Full Code Here

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

      lockWrite();
      try
      {
         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

      }
   }

   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

      AbstractClassPool pool = null;
     
      if (cl instanceof RealClassLoader)
      {
         Module module = registry.getModule(cl);
         if (module != null && module.getDeterminedParentDomainName() != null)
         {
            //It is scoped
            ClassLoaderSystem sys = registry.getSystem();
            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

      {
         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

      }

      if (unit.isTopLevel() || unit.getParent().getClassLoader() != unit.getClassLoader())
      {
         //Only bother doing all this if we are a different loader from the parent unit
         Module module = getModuleRecursively(unit);
        
         ScopedVFSClassLoaderDomain domain = getDomain(registry, unit); //THis might be wrong
         if (domain == null)
         {
            domain = createDomain(registry, unit.getClassLoader(), module, unit);
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.