Package org.jboss.classloader.spi.filter

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


      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

      pb.setPaths(TestB1.class);
      ClassLoader b = system.registerClassLoaderPolicy(pb);

      MockClassLoaderPolicy pa = createMockClassLoaderPolicy("A");
      pa.setPaths(TestA1.class);
      pa.setDelegates(Collections.singletonList(new FilteredDelegateLoader(pb)));
      ClassLoader a = system.registerClassLoaderPolicy(pa);
     
      Class<?> fromB = assertLoadClass(TestB1.class, b, false);
      Class<?> fromA = assertLoadClass(TestB1.class, a, b, false);
     
View Full Code Here

      MockClassLoaderPolicy pa = createMockClassLoaderPolicy("A");
      pa.setPaths(TestA1.class);

      List<DelegateLoader> delegates = new ArrayList<DelegateLoader>();
      delegates.add(new FilteredDelegateLoader(pa));
      delegates.add(new FilteredDelegateLoader(pb));
      pa.setDelegates(delegates);
      pb.setDelegates(delegates);

      ClassLoader a = system.registerClassLoaderPolicy(pa);
      ClassLoader b = system.registerClassLoaderPolicy(pb);
View Full Code Here

      pb.setPaths(ClassLoaderDomain.class);
      ClassLoader b = system.registerClassLoaderPolicy(pb);

      MockClassLoaderPolicy pa = createMockClassLoaderPolicy("A");
      pa.setPaths(TestADelegateClassLoaderDomain.class);
      pa.setDelegates(Collections.singletonList(new FilteredDelegateLoader(pb)));
      ClassLoader a = system.registerClassLoaderPolicy(pa);
     
      Class<?> fromB = assertLoadClass(ClassLoaderDomain.class, b, false);
      Class<?> fromA = assertLoadClass(ClassLoaderDomain.class, a, b, false);
     
View Full Code Here

      MockClassLoaderPolicy pa = createMockClassLoaderPolicy("A");
      pa.setPaths(TestA1.class);

      List<DelegateLoader> delegates = new ArrayList<DelegateLoader>();
      delegates.add(new FilteredDelegateLoader(pa));
      delegates.add(new FilteredDelegateLoader(pb));
      pa.setDelegates(delegates);
      pb.setDelegates(delegates);

      ClassLoader a = system.registerClassLoaderPolicy(pa);
      ClassLoader b = system.registerClassLoaderPolicy(pb);
View Full Code Here

      ClassLoaderSystem system = createClassLoaderSystemWithModifiedBootstrap();
      MockClassLoaderPolicy policy = createMockClassLoaderPolicy();
      policy.setPath("");
      policy.setPackageNames(new String[] { "" });
      MockClassLoaderPolicy policy2 = createMockClassLoaderPolicy();
      policy2.setDelegates(Collections.singletonList(new FilteredDelegateLoader(policy)));
      ClassLoader classLoader = system.registerClassLoaderPolicy(policy);
      ClassLoader classLoader2 = system.registerClassLoaderPolicy(policy2);
     
      assertLoadClass("TestDefaultPackage", classLoader2, classLoader);
   }
View Full Code Here

         MockClassLoaderPolicy pa = createMockClassLoaderPolicy("A");
         pa.setPaths(TestA1.class);

         List<DelegateLoader> delegates = new ArrayList<DelegateLoader>();
         delegates.add(new FilteredDelegateLoader(pa));
         delegates.add(new FilteredDelegateLoader(pb));
         pa.setDelegates(delegates);
         pb.setDelegates(delegates);

         final ClassLoader a = system.registerClassLoaderPolicy(pa);
         final ClassLoader b = system.registerClassLoaderPolicy(pb);
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.