Package org.jboss.classloading.spi.metadata

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


         DependencyInfo infoA = contextA.getDependencyInfo();

         MockClassLoadingMetaData b = new MockClassLoadingMetaData("b");
         b.setPathsAndPackageNames(B.class);
         ClassLoadingMetaDataFactory factory = ClassLoadingMetaDataFactory.getInstance();
         Requirement requirement = factory.createRequirePackage(A.class.getPackage().getName());
         b.setRequirements(Collections.singletonList(requirement));

         KernelControllerContext contextB = install(b);
         try
         {
View Full Code Here


   protected static void addRequireModule(ClassLoadingMetaData classLoadingMetaData, String moduleName, VersionRange versionRange)
   {
      RequirementsMetaData requirements = classLoadingMetaData.getRequirements();

      Requirement requirement = classLoadingMetaDataFactory.createRequireModule(moduleName, versionRange);
      requirements.addRequirement(requirement);
   }
View Full Code Here

   protected static void addRequirePackage(ClassLoadingMetaData classLoadingMetaData, Class<?> pck, VersionRange versionRange)
   {
      RequirementsMetaData requirements = classLoadingMetaData.getRequirements();

      Requirement requirement = classLoadingMetaDataFactory.createRequirePackage(pck.getPackage().getName(), versionRange);
      requirements.addRequirement(requirement);
   }
View Full Code Here

   protected static void addRequireModule(ClassLoadingMetaData classLoadingMetaData, String moduleName, VersionRange versionRange)
   {
      RequirementsMetaData requirements = classLoadingMetaData.getRequirements();

      Requirement requirement = classLoadingMetaDataFactory.createRequireModule(moduleName, versionRange);
      requirements.addRequirement(requirement);
   }
View Full Code Here

   protected static void addRequirePackage(ClassLoadingMetaData classLoadingMetaData, Class<?> pck, VersionRange versionRange)
   {
      RequirementsMetaData requirements = classLoadingMetaData.getRequirements();

      Requirement requirement = classLoadingMetaDataFactory.createRequirePackage(pck.getPackage().getName(), versionRange);
      requirements.addRequirement(requirement);
   }
View Full Code Here

      if (dependencies == null || dependencies.isEmpty())
         return;
     
      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
            Module other = item.getModule();
            DelegateLoader delegate = iDependOnModule.getDelegateLoader(other, requirement);

            // Check for re-export by the module
            if (requirement.wantReExports())
               addDelegates(iDependOnModule, delegates, dynamic, visited, true);
           
            // We want a module's re-exports (i.e. part of its imports) before the module itself
            if (delegate != null)
               delegates.add(delegate);
View Full Code Here

      return requirement;
   }

   public boolean resolve(Controller controller)
   {
      Requirement requirement = getRequirement();
      Object iDependOn = getModule().resolve(controller, requirement);
      if (iDependOn != null)
      {
         ControllerContext context = controller.getContext(iDependOn, getDependentState());
         if (context != null)
         {
            setIDependOn(context.getName());
            addDependsOnMe(controller, context);
            setResolved(true);
         }
         else
         {
            setResolved(false);
         }
      }
      else
      {
         // Optional requirement
         if (requirement.isOptional() || requirement.isDynamic())
            setResolved(true);
      }
      return isResolved();
   }
View Full Code Here

      if (dependencies == null || dependencies.isEmpty())
         return;
     
      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
            Module other = item.getModule();
            DelegateLoader delegate = iDependOnModule.getDelegateLoader(other, requirement);

            // Check for re-export by the module
            if (requirement.wantReExports())
               addDelegates(iDependOnModule, delegates, dynamic, visited, true);
           
            // We want a module's re-exports (i.e. part of its imports) before the module itself
            if (delegate != null)
               delegates.add(delegate);
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

      {
         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

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.