Package org.jboss.classloader.spi

Examples of org.jboss.classloader.spi.DelegateLoader


               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);
           
View Full Code Here


               throw new IllegalStateException("Item not resolved: " + item);
           
            // Dynamic requirement, create it lazily
            if (requirement.isDynamic())
            {
               DelegateLoader delegate = createLazyDelegateLoader(checkDomain(), item);
               dynamic.add(delegate);
               continue;
            }
           
            Module iDependOnModule = item.getResolvedModule();
            if (iDependOnModule == null)
            {
               // Do it the hard way - probably optional or a self dependency?
               String name = (String) item.getIDependOn();
               if (name != null)
                  iDependOnModule = checkDomain().getModule(name);
               if (iDependOnModule == null)
               {
                  if (requirement.isOptional())
                     continue;
                  throw new IllegalStateException("Module not found for requirement: " + item);
               }
            }

            // 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)
            {
               // If we are connecting to another module we collect the imported package names per delegate
               if (requirement instanceof PackageRequirement)
               {
                  List<String> packageNames = delegateToRequiredPackages.get(iDependOnModule);
                  if (packageNames == null)
                  {
                     packageNames = new ArrayList<String>();
                     delegateToRequiredPackages.put(iDependOnModule, packageNames);
                  }
                 
                  PackageRequirement packageRequirement = (PackageRequirement)requirement;
                  packageNames.add(packageRequirement.getName());
               }
               else
               {
                  // Determine the delegate loader for the module
                  DelegateLoader delegate = iDependOnModule.getDelegateLoader(module, requirement);
                  if (delegate == null)
                     throw new IllegalStateException("Cannot obtain delegate for: " + requirement);
                  delegates.add(delegate);
               }
            }
         }
      }
     
      // Add FilteredDelegateLoaders for all collected package requirements
      for (Entry<Module, List<String>> entry : delegateToRequiredPackages.entrySet())
      {
         Module iDependOnModule = entry.getKey();
         DelegateLoader delegate = iDependOnModule.getDelegateLoader(module, entry.getValue());
         delegates.add(delegate);
      }
   }
View Full Code Here

      this.policy = policy;

      BaseClassLoaderPolicy basePolicy = policy;
      basePolicy.setClassLoader(this);

      loader = new DelegateLoader(policy);

      if (basePolicy.isCacheable())
         resourceCache = new ConcurrentHashMap<String, URL>();

      if (basePolicy.isBlackListable())
View Full Code Here

      this.policy = policy;

      BaseClassLoaderPolicy basePolicy = policy;
      basePolicy.setClassLoader(this);

      loader = new DelegateLoader(policy);

      if (basePolicy.isCacheable())
         resourceCache = new ConcurrentHashMap<String, URL>();

      if (basePolicy.isBlackListable())
View Full Code Here

      this.policy = policy;

      BaseClassLoaderPolicy basePolicy = policy;
      basePolicy.setClassLoader(this);

      loader = new DelegateLoader(policy);

      if (basePolicy.isCacheable())
         resourceCache = new ConcurrentHashMap<String, URL>();

      if (basePolicy.isBlackListable())
View Full Code Here

      this.policy = policy;

      BaseClassLoaderPolicy basePolicy = policy;
      basePolicy.setClassLoader(this);

      loader = new DelegateLoader(policy);

      if (basePolicy.isCacheable())
         resourceCache = new ConcurrentHashMap<String, URL>();

      if (basePolicy.isBlackListable())
View Full Code Here

      this.policy = policy;

      BaseClassLoaderPolicy basePolicy = policy;
      basePolicy.setClassLoader(this);

      loader = new DelegateLoader(policy);

      if (basePolicy.isCacheable())
         resourceCache = new ConcurrentHashMap<String, URL>();

      if (basePolicy.isBlackListable())
View Full Code Here

               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);
           
View Full Code Here

               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);
           
View Full Code Here

               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);
           
View Full Code Here

TOP

Related Classes of org.jboss.classloader.spi.DelegateLoader

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.