Package org.jboss.classloading.spi.dependency

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


      {
         // no BaseClassLoader found, perhaps this is top-level
         return cl;
      }

      Module module = SecurityActions.getModuleForClassLoader(firstBaseClassLoader);
      if (module == null || (module instanceof AbstractDeploymentClassLoaderPolicyModule == false))
      {
         return cl;
      }
View Full Code Here


    * @param classLoader the ClassLoader
    * @return            a classpath that contains a list of the archives visible to ClassLoader
    */
   public Classpath create(ClassLoader classLoader)
   {
      Module module = SecurityActions.getModuleForClassLoader(classLoader);
      ClassLoaderDomain domain = null;
      ClassLoaderSystem cls = getSystem(); // intialize system
      // TODO -- why this check for a parent domain name?
      if (module != null && module.getDeterminedParentDomainName() != null)
      {
         domain = cls.getDomain(module.getDeterminedDomainName());
      }
      return getClasspath(domain);
   }
View Full Code Here

      try
      {
         if (hasCp || hasWB)
         {
            VFSDeploymentUnit moduleUnit = unit;
            Module module = moduleUnit.getAttachment(Module.class);
            while (moduleUnit != null && module == null)
            {
               moduleUnit = moduleUnit.getParent();
               module = moduleUnit.getAttachment(Module.class);
            }
            if (module == null)
               throw new DeploymentException("No module in deployment unit's hierarchy: " + unit.getName());

            ArchiveInfo archive = moduleUnit.getAttachment(ArchiveInfo.class);
            if (archive == null)
               throw new IllegalStateException("Archive attachment expected for unit " + unit);

            WeldDiscoveryEnvironment environment = archive.getEnvironment();
            if (hasCp)
            {
               URL[] urls = new URL[cpFiles.size()];
               int i = 0;
               for (VirtualFile file : cpFiles)
               {
                  urls[i++] = file.toURL();
               }
               WBDiscoveryVisitor visitor = new WBDiscoveryVisitor(environment);
               module.visit(visitor, ClassFilter.INSTANCE, null, urls);
            }
            if (hasWB)
            {
               for (VirtualFile file : wbFiles)
                  environment.addWeldXmlURL(file.toURL());
View Full Code Here

               environment.addWeldXmlURL(file.toURL());
         }

         if (hasCp)
         {
            Module module = unit.getAttachment(Module.class);
            if (module == null)
            {
               VFSDeploymentUnit parent = unit.getParent();
               while (parent != null && module == null)
               {
                  module = parent.getAttachment(Module.class);
                  parent = parent.getParent();
               }
               if (module == null)
                  throw new DeploymentException("No module in deployment unit's hierarchy: " + unit.getName());
            }

            URL[] urls = new URL[cpFiles.size()];
            int i = 0;
            for (VirtualFile file : cpFiles)
            {
               urls[i++] = file.toURL();
            }

            WBDiscoveryVisitor visitor = new WBDiscoveryVisitor(environment);
            module.visit(visitor, ClassFilter.INSTANCE, null, urls);
         }
      }
      catch (Exception e)
      {
         throw DeploymentException.rethrowAsDeploymentException("Cannot build WB env.", e);
View Full Code Here

                  // the env
                  WeldDiscoveryEnvironment environment = archiveInfo.getEnvironment();
                  // fill in the Weld classes
                  // the WBDiscoveryVisitor from ArchiveDiscoveryDeployer...
                  ResourceVisitor visitor = environment.visitor();
                  Module module = entry.getKey();

                  for (VirtualFile child : files)
                  {
                     URL beansXmlURL = child.getChild(provider.getResourceName()).toURL();
                     environment.addWeldXmlURL(beansXmlURL);

                     module.visit(visitor, ClassFilter.INSTANCE, null, child.toURL());
                  }
               }
            }
         }
         checked.set(true);
View Full Code Here

      unit.getMutableMetaData().addAnnotation(output.getScopeAnnotation());
   }
  
   private String getDomainName(VFSDeploymentUnit unit)
   {
      Module module = unit.getTopLevel().getAttachment(Module.class);
      if (module != null && !module.getDeterminedDomainName().equals(ClassLoaderSystem.DEFAULT_DOMAIN_NAME))
      {
         return module.getDeterminedDomainName();
      }
     
      return null;
   }
View Full Code Here

      }
   }

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

         name = (String) item.getIDependOn();
         if (name == null)
            return null;
      }

      Module iDependOnModule = domain.getModule(name);
      if (iDependOnModule == null)
         throw new IllegalStateException("Module not found with name: " + name);

      // Get the policy for the module
      if (iDependOnModule instanceof ClassLoaderPolicyModule == false)
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

   /**
    * A unit that is a child will not automatically pick up the parent module
    */
   private static Module getModuleRecursively(DeploymentUnit unit)
   {
      Module module = unit.getAttachment(Module.class);
      if (module == null)
      {
          return getModuleRecursively(unit.getParent());
         
      }
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.