Package org.jboss.classloader.spi

Examples of org.jboss.classloader.spi.ClassLoaderPolicy


            if (iDependOnModule != module)
            {
               // If we are connecting to another module we collect the imported package names per delegate
               if (requirement instanceof PackageRequirement)
               {
                  ClassLoaderPolicy policy = delegate.getPolicy();
                  List<String> packageNames = delegateToRequiredPackages.get(policy);
                  if (packageNames == null)
                  {
                     packageNames = new ArrayList<String>();
                     delegateToRequiredPackages.put(policy, packageNames);
View Full Code Here


            if (iDependOnModule != module)
            {
               // If we are connecting to another module we collect the imported package names per delegate
               if (requirement instanceof PackageRequirement)
               {
                  ClassLoaderPolicy policy = delegate.getPolicy();
                  List<String> packageNames = delegateToRequiredPackages.get(policy);
                  if (packageNames == null)
                  {
                     packageNames = new ArrayList<String>();
                     delegateToRequiredPackages.put(policy, packageNames);
View Full Code Here

            {
               log.trace("Factory did not create a delegate: " + factory);
            }
            else
            {
               ClassLoaderPolicy policy = (ClassLoaderPolicy) delegate;
               initialise(policy);
               this.delegate = delegate;
            }
         }
         catch (Throwable t)
View Full Code Here

      log.debug(this + " registerClassLoader " + classLoader.toString());

      if (getClassLoaderSystem() == null)
         throw new IllegalStateException("Domain is not registered with a classloader system: " + toLongString());
     
      ClassLoaderPolicy policy = classLoader.getPolicy();
      BaseDelegateLoader exported = policy.getExported();
      if (exported != null && exported.getPolicy() == null)
         throw new IllegalStateException("The exported delegate " + exported + " is too lazy for " + policy.toLongString());
     
      try
      {
         beforeRegisterClassLoader(classLoader, policy);
      }
      catch (Throwable t)
      {
         log.warn("Error in beforeRegisterClassLoader: " + this + " classLoader=" + classLoader.toLongString(), t);
      }
     
      BaseClassLoaderPolicy basePolicy = classLoader.getPolicy();
      basePolicy.setClassLoaderDomain(this);

      // FINDBUGS: This synchronization is correct - more than addIfNotPresent behaviour
      synchronized (classLoaders)
      {
         // Create the information
         ClassLoaderInformation info = new ClassLoaderInformation(classLoader, policy, order++);
         classLoaders.add(info);
         basePolicy.setInformation(info);

         // Index the packages
         String[] packageNames = policy.getPackageNames();
         if (packageNames != null && info.getExported() != null)
         {
            for (String packageName : packageNames)
            {
               List<ClassLoaderInformation> list = classLoadersByPackageName.get(packageName);
               if (list == null)
               {
                  list = new CopyOnWriteArrayList<ClassLoaderInformation>();
                  classLoadersByPackageName.put(packageName, list);
               }
               list.add(info);
               log.trace("Registered " + policy + " as providing package=" + packageName);
            }
         }
        
         flushCaches();
      }

      ClassLoaderCache cache = policy.getCache();
      if (cache != null)
         cache.flushCaches();

      try
      {
View Full Code Here

            if (iDependOnModule != module)
            {
               // If we are connecting to another module we collect the imported package names per delegate
               if (requirement instanceof PackageRequirement)
               {
                  ClassLoaderPolicy policy = delegate.getPolicy();
                  List<String> packageNames = delegateToRequiredPackages.get(policy);
                  if (packageNames == null)
                  {
                     packageNames = new ArrayList<String>();
                     delegateToRequiredPackages.put(policy, packageNames);
View Full Code Here

   {
      if (isStarted())
         return;
      if (module instanceof ClassLoaderPolicyModule)
      {
         ClassLoaderPolicy policy = ((ClassLoaderPolicyModule) module).getPolicy();
         lazyStart = new LazyStartHandler(policy);
      }
      else
      {
         throw new IllegalStateException("Cannot do lazy start for " + module);
View Full Code Here

/* 206 */     return result;
/*     */   }
/*     */
/*     */   public DelegateLoader getDelegateLoader()
/*     */   {
/* 217 */     ClassLoaderPolicy policy = (ClassLoaderPolicy)this.deploymentUnit.getAttachment(ClassLoaderPolicy.class);
/* 218 */     if (policy == null)
/* 219 */       throw new IllegalStateException("No policy for " + this.deploymentUnit.getName());
/* 220 */     return new FilteredDelegateLoader(policy);
/*     */   }
View Full Code Here

/*     */     }
/* 120 */     Module module = (Module)context.getTransientAttachments().getAttachment(Module.class);
/* 121 */     if (module == null) {
/* 122 */       throw new IllegalStateException("Deployment Context has no module: " + context);
/*     */     }
/* 124 */     ClassLoaderPolicy policy = createTopLevelClassLoaderPolicy(context, module);
/*     */     ClassLoaderDomain domain;
/* 127 */     synchronized (this)
/*     */     {
/* 129 */       String domainName = module.getDomainName();
/* 130 */       domain = this.system.getDomain(domainName);
View Full Code Here

      log.debug(this + " registerClassLoader " + classLoader.toString());

      if (getClassLoaderSystem() == null)
         throw new IllegalStateException("Domain is not registered with a classloader system: " + toLongString());
     
      ClassLoaderPolicy policy = classLoader.getPolicy();
      BaseDelegateLoader exported = policy.getExported();
      if (exported != null && exported.getPolicy() == null)
         throw new IllegalStateException("The exported delegate " + exported + " is too lazy for " + policy.toLongString());
     
      try
      {
         beforeRegisterClassLoader(classLoader, policy);
      }
      catch (Throwable t)
      {
         log.warn("Error in beforeRegisterClassLoader: " + this + " classLoader=" + classLoader.toLongString(), t);
      }
     
      BaseClassLoaderPolicy basePolicy = classLoader.getPolicy();
      basePolicy.setClassLoaderDomain(this);

      // FINDBUGS: This synchronization is correct - more than addIfNotPresent behaviour
      synchronized (classLoaders)
      {
         // Create the information
         ClassLoaderInformation info = new ClassLoaderInformation(classLoader, policy, order++);
         classLoaders.add(info);
         infos.put(classLoader, info);

         // Index the packages
         String[] packageNames = policy.getPackageNames();
         if (packageNames != null && info.getExported() != null)
         {
            for (String packageName : packageNames)
            {
               List<ClassLoaderInformation> list = classLoadersByPackageName.get(packageName);
View Full Code Here

            if (iDependOnModule != module)
            {
               // If we are connecting to another module we collect the imported package names per delegate
               if (requirement instanceof PackageRequirement)
               {
                  ClassLoaderPolicy policy = delegate.getPolicy();
                  List<String> packageNames = delegateToRequiredPackages.get(policy);
                  if (packageNames == null)
                  {
                     packageNames = new ArrayList<String>();
                     delegateToRequiredPackages.put(policy, packageNames);
View Full Code Here

TOP

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

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.