Package org.jboss.classloader.spi.filter

Examples of org.jboss.classloader.spi.filter.FilteredDelegateLoader


      ClassLoaderSystem system = createClassLoaderSystemWithModifiedBootstrap();

      TestClassLoaderPolicy policy1 = new TestClassLoaderPolicy();
      TestClassLoaderPolicy policy2 = new TestClassLoaderPolicy();
      TestClassLoaderPolicyFactory factory2 = new TestClassLoaderPolicyFactory(policy2, true);
      policy1.delegates = Collections.singletonList(new FilteredDelegateLoader(factory2));
      ClassLoader classLoader = system.registerClassLoaderPolicy(policy1);
      system.registerClassLoaderPolicy(policy2);
     
      assertLoadClassFail(ClassLoaderDomain.class, classLoader);
      assertNotNull("Should have tried policy1 ", policy1.getResourceInvoked);
View Full Code Here


      ClassLoaderSystem system = createClassLoaderSystemWithModifiedBootstrap();

      TestClassLoaderPolicy policy1 = new TestClassLoaderPolicy();
      TestClassLoaderPolicy policy2 = new TestClassLoaderPolicy();
      TestClassLoaderPolicyFactory factory2 = new TestClassLoaderPolicyFactory(policy2, true);
      policy1.delegates = Collections.singletonList(new FilteredDelegateLoader(factory2));
      ClassLoader classLoader1 = system.registerClassLoaderPolicy(policy1);
      ClassLoader classLoader2 = system.registerClassLoaderPolicy(policy2);
     
      assertLoadClass(TestClass.class, classLoader1, classLoader2);
      assertNull("Should NOT have tried policy1 ", policy1.getResourceInvoked);
View Full Code Here

      ClassLoaderSystem system = createClassLoaderSystemWithModifiedBootstrap();

      TestClassLoaderPolicy policy1 = new TestClassLoaderPolicy();
      TestClassLoaderPolicy policy2 = new TestClassLoaderPolicy();
      TestClassLoaderPolicyFactory factory2 = new TestClassLoaderPolicyFactory(policy2, false);
      policy1.delegates = Collections.singletonList(new FilteredDelegateLoader(factory2));
      ClassLoader classLoader = system.registerClassLoaderPolicy(policy1);
      system.registerClassLoaderPolicy(policy2);
     
      assertLoadClassFail(ClassLoaderDomain.class, classLoader);
      assertNotNull("Should have tried policy1 ", policy1.getResourceInvoked);
View Full Code Here

      ClassLoaderSystem system = createClassLoaderSystemWithModifiedBootstrap();

      MockClassLoaderPolicy policy1 = createMockClassLoaderPolicy();
      TestClassLoaderPolicy policy2 = new TestClassLoaderPolicy();
      TestClassLoaderPolicyFactory factory2 = new TestClassLoaderPolicyFactory(policy2, false);
      policy1.setDelegates(Collections.singletonList(new FilteredDelegateLoader(factory2)));
      ClassLoader classLoader1 = system.registerClassLoaderPolicy(policy1);
      ClassLoader classLoader2 = system.registerClassLoaderPolicy(policy2);

      assertLoadClassFail(TestClass.class, classLoader1);
      assertNull("Should NOT have tried policy2 ", policy2.getResourceInvoked);
View Full Code Here

      TestClassLoaderPolicy policy1 = new TestClassLoaderPolicy();
      TestClassLoaderPolicy policy2 = new TestClassLoaderPolicy();
      TestClassLoaderPolicyFactory factory1 = new TestClassLoaderPolicyFactory(policy1, true);
      TestClassLoaderPolicyFactory factory2 = new TestClassLoaderPolicyFactory(policy2, true);
      policy1.setDelegates(Collections.singletonList(new FilteredDelegateLoader(factory2)));
      policy2.setDelegates(Collections.singletonList(new FilteredDelegateLoader(factory1)));
      ClassLoader classLoader1 = system.registerClassLoaderPolicy(policy1);
      ClassLoader classLoader2 = system.registerClassLoaderPolicy(policy2);

      assertLoadClass(TestClass.class, classLoader1, classLoader2);
      assertNull("Should NOT have tried policy1 ", policy1.getResourceInvoked);
View Full Code Here

/*     */   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

/*     */
/*     */   public List<? extends DelegateLoader> createDelegates(ClassLoaderPolicy[] policies)
/*     */   {
/* 442 */     List delegates = new ArrayList();
/* 443 */     for (ClassLoaderPolicy policy : policies)
/* 444 */       delegates.add(new FilteredDelegateLoader(policy));
/* 445 */     return delegates;
/*     */   }
View Full Code Here

/*     */   protected DelegateLoader getExported()
/*     */   {
/*  67 */     String[] packageNames = getPackageNames();
/*  68 */     if (packageNames == null)
/*  69 */       return null;
/*  70 */     return new FilteredDelegateLoader(this, PackageClassFilter.createPackageClassFilter(packageNames));
/*     */   }
View Full Code Here

      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      policy.setPrefix("a/");
      policy.setPath("com/acme/p1");

      MockClassLoaderPolicy policy2 = createMockClassLoaderPolicy();
      policy2.setDelegates(Collections.singletonList(new FilteredDelegateLoader(policy)));
     
      system.registerClassLoaderPolicy(policy);
      ClassLoader classLoader = system.registerClassLoaderPolicy(policy2);
     
      assertGetResource("a/", "com/acme/p1/testResource", classLoader);
View Full Code Here

      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      policy.setPrefix("a/");
      policy.setPath("");

      MockClassLoaderPolicy policy2 = createMockClassLoaderPolicy();
      policy2.setDelegates(Collections.singletonList(new FilteredDelegateLoader(policy)));
     
      system.registerClassLoaderPolicy(policy);
      ClassLoader classLoader = system.registerClassLoaderPolicy(policy2);
     
      assertGetResource("a/", "testResource", classLoader);
View Full Code Here

TOP

Related Classes of org.jboss.classloader.spi.filter.FilteredDelegateLoader

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.