Package org.jboss.classloader.spi

Examples of org.jboss.classloader.spi.ParentPolicy


  
   public void testAfterFilteredReachedNotMatched() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();
      NoMatchClassFilter filter = new NoMatchClassFilter(ClassLoaderDomain.class);
      ParentPolicy parentPolicy = new ParentPolicy(ClassFilterUtils.JAVA_ONLY, filter);
      ClassLoaderDomain domain = system.createAndRegisterDomain("test", parentPolicy, null);
     
      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      ClassLoader classLoader = system.registerClassLoaderPolicy(domain, policy);
     
View Full Code Here


  
   public void testAfterFilteredReachedMatched() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();
      MatchClassFilter filter = new MatchClassFilter(ClassLoaderDomain.class);
      ParentPolicy parentPolicy = new ParentPolicy(ClassFilterUtils.JAVA_ONLY, filter);
      ClassLoaderDomain domain = system.createAndRegisterDomain("test", parentPolicy, null);
     
      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      ClassLoader classLoader = system.registerClassLoaderPolicy(domain, policy);
     
View Full Code Here

   }
  
   public void testNoMatchBeforeAndAfter() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();
      ParentPolicy parentPolicy = new ParentPolicy(ClassFilterUtils.NOTHING, ClassFilterUtils.NOTHING);
      ClassLoaderDomain domain = system.createAndRegisterDomain("test", parentPolicy, null);
      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      ClassLoader classLoader = system.registerClassLoaderPolicy(domain, policy);
      assertLoadClassFail(Object.class, classLoader);
   }
View Full Code Here

  
   public void testPackageFilterNoJava() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();
      PackageClassFilter filter = PackageClassFilter.createPackageClassFilter("dummy");
      ParentPolicy parentPolicy = new ParentPolicy(filter, ClassFilterUtils.NOTHING);
      ClassLoaderDomain domain = system.createAndRegisterDomain("test", parentPolicy, null);
      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      ClassLoader classLoader = system.registerClassLoaderPolicy(domain, policy);
      assertLoadClassFail(Object.class, classLoader);
   }
View Full Code Here

   public void testPackageFilterIncludeJava() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();
      PackageClassFilter filter = PackageClassFilter.createPackageClassFilter("dummy");
      filter.setIncludeJava(true);
      ParentPolicy parentPolicy = new ParentPolicy(filter, ClassFilterUtils.NOTHING);
      ClassLoaderDomain domain = system.createAndRegisterDomain("test", parentPolicy, null);
      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      ClassLoader classLoader = system.registerClassLoaderPolicy(domain, policy);
      assertLoadClass(Object.class, classLoader, null, true);
   }
View Full Code Here

  
   public void testHierarchyFiltered() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();
      NoMatchClassFilter filter = new NoMatchClassFilter(MockLoader.class);
      ParentPolicy pp = new ParentPolicy(filter, ClassFilterUtils.NOTHING);
      ClassLoaderDomain parent = system.createAndRegisterDomain("parent", ParentPolicy.BEFORE_BUT_JAVA_ONLY);
     
      MockClassLoaderPolicy parentPolicy = createMockClassLoaderPolicy();
      parentPolicy.setPathsAndPackageNames(MockLoader.class, Loader.class);
      parentPolicy.setImportAll(true);
View Full Code Here

  
   public void testHierarchyFilteredFind() throws Exception
   {
      ClassLoaderSystem system = createClassLoaderSystem();
      NoMatchClassFilter filter = new NoMatchClassFilter(MockLoader.class);
      ParentPolicy pp = new ParentPolicy(filter, ClassFilterUtils.NOTHING);
      ClassLoaderDomain parent = system.createAndRegisterDomain("parent", ParentPolicy.BEFORE_BUT_JAVA_ONLY);
     
      MockClassLoaderPolicy parentPolicy = createMockClassLoaderPolicy();
      parentPolicy.setPathsAndPackageNames(MockLoader.class, Loader.class);
      parentPolicy.setImportAll(true);
View Full Code Here

/* 279 */     Set parentPackages = getParentPackages();
/* 280 */     String[] parentPkgs = (String[])parentPackages.toArray(new String[parentPackages.size()]);
/* 281 */     PackageClassFilter filter = new PackageClassFilter(parentPkgs);
/* 282 */     filter.setIncludeJava(true);
/* 283 */     CombiningClassFilter beforeFilter = CombiningClassFilter.create(new ClassFilter[] { filter, parentFilter });
/* 284 */     ParentPolicy parentPolicy = new ParentPolicy(beforeFilter, ClassFilter.NOTHING);
/* 285 */     return initializeClassLoader(clazz, system, parentPolicy, policy);
/*     */   }
View Full Code Here

/* 285 */     return initializeClassLoader(clazz, system, parentPolicy, policy);
/*     */   }
/*     */
/*     */   public Class<?> initializeClassLoader(Class<?> clazz, ClassLoaderSystem system, ClassFilter beforeFilter, ClassFilter afterFilter, ClassLoaderPolicy policy)
/*     */   {
/* 300 */     ParentPolicy parentPolicy = new ParentPolicy(beforeFilter, afterFilter);
/* 301 */     return initializeClassLoader(clazz, system, parentPolicy, policy);
/*     */   }
View Full Code Here

/* 133 */         ClassLoaderDomain parent = null;
/* 134 */         String parentDomain = module.getParentDomain();
/* 135 */         if (parentDomain != null) {
/* 136 */           parent = this.system.getDomain(parentDomain);
/*     */         }
/* 138 */         ParentPolicy parentPolicy = module.getParentPolicy();
/*     */
/* 140 */         domain = this.system.createAndRegisterDomain(domainName, parentPolicy, parent);
/*     */       }
/*     */     }
/* 143 */     ClassLoader classLoader = this.system.registerClassLoaderPolicy(domain, policy);
View Full Code Here

TOP

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

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.