Package org.jboss.classloader.spi

Examples of org.jboss.classloader.spi.ClassLoaderDomain


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


            }
            else
            {
               if (domain instanceof ClassLoaderDomain)
               {
                  ClassLoaderDomain clDomain = (ClassLoaderDomain) domain;
                  Classpath parentClasspath = getClasspath(clDomain.getParent());
                  classpath = new NoDuplicatesClasspath(clDomain.getName(), parentClasspath);
               }
               else
               {
                  throw new RuntimeException("Domain is of unexpected type: " + domain + " - " + domain.getClass());
               }
View Full Code Here

    * @return ClassLoaderSystem instance
    */
   public static ClassLoaderSystem getClassLoaderSystem()
   {
      DefaultClassLoaderSystem system = new DefaultClassLoaderSystem();
      ClassLoaderDomain defaultDomain = system.getDefaultDomain();
      defaultDomain.setParentPolicy(ParentPolicy.AFTER);
      return system;
   }
View Full Code Here

   }

   public ObjectName getClassLoaderDomain()
   {
      BaseClassLoaderPolicy basePolicy = policy;
      ClassLoaderDomain domain = (ClassLoaderDomain) basePolicy.getClassLoaderDomain();
      return domain.getObjectName();
   }
View Full Code Here

   {
      if (!module.getDeterminedDomainName().equals(ClassLoaderSystem.DEFAULT_DOMAIN_NAME))
      {
         ClassLoaderSystem system = ClassLoaderSystem.getInstance();
         String domainName = module.getDeterminedDomainName();
         ClassLoaderDomain domain = system.getDomain(domainName);
  
         boolean parentDelegation = module.isJ2seClassLoadingCompliance();
         String name = String.valueOf(System.identityHashCode(loader));
        
         ScopedVFSClassLoaderDomain parentDomain = unit.isTopLevel() ? null : getDomain(registry, unit.getParent());
View Full Code Here

         Module module = registry.getModule(cl);
         if (module != null && module.getDeterminedParentDomainName() != null)
         {
            //It is scoped
            ClassLoaderSystem sys = ClassLoaderSystem.getInstance();
            ClassLoaderDomain domain = sys.getDomain(module.getDeterminedDomainName());
            boolean parentFirst = module.isJ2seClassLoadingCompliance();
            ClassPool parentDomainPool = getParentUnitClassPool(cl);
            pool = new ScopedJBoss5ClassPool(cl, parent, parentDomainPool, repository, getTempURL(module), parentFirst, domain);
         }
         else
View Full Code Here

      log.debug("Created new ScopedJBoss5ClasPool for " + cl + ", with parent: " + src + ", parentDomain: " + parentDomainPool + ", parentFirst: " + parentFirst);
   }

   private URL getResourceUrlForClass(String resourcename)
   {
      ClassLoaderDomain domain = domainRef.get();
      return domain.getResource(resourcename);
   }
View Full Code Here

      if (myURL == null)
      {
         return false;
      }
     
      ClassLoaderDomain domain = domainRef.get();
      Loader parent = domain.getParent();
      URL parentURL = parent.getResource(resourceName);
     
      if (parentURL == null)
      {
         return true;
View Full Code Here

         throw new IllegalArgumentException("initMapsForLoader() should only be called if parentUnitLoader is different from loader");
      }
      ClassLoaderSystem system = ClassLoaderSystem.getInstance();
     
      String domainName = module.getDeterminedDomainName();
      ClassLoaderDomain clDomain = system.getDomain(domainName);
      boolean ret = false;
      if (!classLoaderDomainsByLoader.containsKey(loader))
      {
         Integer count = classLoaderDomainReferenceCounts.get(clDomain);
         int cnt = count == null ? 0 : count.intValue();
View Full Code Here

   }
  
   public synchronized void cleanupLoader(ClassLoader loader)
   {
      WeakReference<ClassLoaderDomain> clDomainRef = classLoaderDomainsByLoader.remove(loader);
      ClassLoaderDomain clDomain = clDomainRef == null ? null : clDomainRef.get();
      if (clDomain != null)
      {
         Integer count =  classLoaderDomainReferenceCounts.get(clDomain);
         int cnt = count == null ? 0 : count.intValue();
         if (cnt > 0)
View Full Code Here

TOP

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

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.