Package org.jboss.classloading.spi.metadata

Examples of org.jboss.classloading.spi.metadata.Requirement


            ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
            for (String integrationModuleName : integrationModuleNames)
            {
               try
               {
                  Requirement integrationRequirement = factory.createRequireModule(integrationModuleName, integrationModule.getVersionRange());
                  requirements.removeRequirement(integrationRequirement);
               }
               catch (Throwable t)
               {
                  log.warn("Error during requirement removal: " + integrationModuleName, t);
View Full Code Here


      // Maps the ClassLoaderPolicy that we get from the iDependOnModule to the list of package names that we are importing
      Map<ClassLoaderPolicy, List<String>> delegateToRequiredPackages = new LinkedHashMap<ClassLoaderPolicy, List<String>>();
     
      for (RequirementDependencyItem item : dependencies)
      {
         Requirement requirement = item.getRequirement();
        
         // If we are looking at everything or this is a re-export
         if (reExport == false || requirement.isReExport())
         {
            // Sanity checks
            if (item.isResolved() == false)
               throw new IllegalStateException("Item not resolved: " + item);
           
            // Dynamic requirement, create it lazily
            if (requirement.isDynamic())
            {
               DelegateLoader delegate = createLazyDelegateLoader(checkDomain(), item);
               dynamic.add(delegate);
               continue;
            }

            String name = (String) item.getIDependOn();
            if (name == null)
            {
               // Optional requirement, just ignore
               if (requirement.isOptional())
                  continue;
               // Something has gone wrong
               throw new IllegalStateException("No iDependOn for item: " + item);
            }
           
            Module iDependOnModule = checkDomain().getModule(name);
            if (iDependOnModule == null)
               throw new IllegalStateException("Module not found with name: " + name);

            // Determine the delegate loader for the module
            DelegateLoader delegate = iDependOnModule.getDelegateLoader(module, requirement);
            if (delegate == null)
               throw new IllegalStateException("Cannot obtain delegate for: " + requirement);

            // Check for re-export by the module
            if (requirement.wantReExports())
               addDelegates(iDependOnModule, delegates, dynamic, visited, true);
           
            // Only add a the delegate if this is not a self-dependency
            if (iDependOnModule != module)
            {
View Full Code Here

   {
      ClassLoadingSpace space = getClassLoadingSpace();
      if (resolveSpace && space != null)
         space.resolve(this);

      Requirement requirement = dependency.getRequirement();
      return checkDomain().resolveModule(this, requirement);
   }
View Full Code Here

      return requirement;
   }

   public boolean resolve(Controller controller)
   {
      Requirement requirement = getRequirement();
      Module module = getModule().resolveModule(this, true);
     
      // No module present
      if (module == null)
      {
         setResolved(requirement.isOptional() || requirement.isDynamic());
         return isResolved();
      }

      // Self dependency
      if (module == this.module)
View Full Code Here

      ControllerContext context = getControllerContext();
      if (context == null)
         throw new IllegalStateException("No controller context");
      Controller controller = context.getController();

      Requirement requirement = item.getRequirement();
      if (requirement instanceof PackageRequirement)
      {
         PackageRequirement pr = (PackageRequirement)requirement;
         ClassFilter filter = pr.toClassFilter();
         if (pr.isWildcard())
View Full Code Here

      {
         if (moduleDependencies != null && moduleDependencies.isEmpty() == false)
         {
            for (RequirementDependencyItem dependency : moduleDependencies)
            {
               Requirement requirement = dependency.getRequirement();
               for (Entry<Module, List<RequirementDependencyItem>> entry : requirements.entrySet())
               {
                  Module otherModule = entry.getKey();
                  List<RequirementDependencyItem> dependencies = entry.getValue();
                  for (RequirementDependencyItem otherDependency : dependencies)
                  {
                     Requirement otherRequirement = otherDependency.getRequirement();
                     // TODO JBCL-22 ERRORS
                     if (requirement.isConsistent(otherRequirement) == false)
                        throw new IllegalStateException(module + " has a requirement " + requirement + " which is inconsistent with " + otherRequirement + " from " + otherModule);
                  }
               }
View Full Code Here

         List<RequirementDependencyItem> requirementDependencyItems = module.getDependencies();
         if (requirementDependencyItems != null && requirementDependencyItems.isEmpty() == false)
         {
            for (RequirementDependencyItem dependencyItem : requirementDependencyItems)
            {
               Requirement requirement = dependencyItem.getRequirement();
               if (requirement instanceof ModuleRequirement && dependencyItem.isResolved())
               {
                  ModuleRequirement moduleRequirement = (ModuleRequirement)requirement;
                  if (name == null || name.equals(moduleRequirement.getName()))
                  {
View Full Code Here

      Module module = getModule().resolveModule(this, true);
     
      // No module present
      if (module == null)
      {
         Requirement requirement = getRequirement();
         setResolved(requirement.isOptional() || requirement.isDynamic());
         return isResolved();
      }

      // TODO - any reason why requesting module wasn't considered as resolving module?
      resolvedModule = module;
View Full Code Here

TOP

Related Classes of org.jboss.classloading.spi.metadata.Requirement

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.