Package org.jboss.classloader.plugins.system

Examples of org.jboss.classloader.plugins.system.DefaultClassLoaderSystem.registerClassLoaderPolicy()


      VirtualFile signedJar = signedJarRoot.getChild("wstx.jar");
      VFSClassLoaderPolicy policy = VFSClassLoaderPolicy.createVFSClassLoaderPolicy(signedJar);
      policy.setExportAll(ExportAll.ALL);
     
      ClassLoaderSystem system = new DefaultClassLoaderSystem();
      ClassLoader classLoader = system.registerClassLoaderPolicy(policy);
      
      Class<?> clazz = classLoader.loadClass("org.codehaus.stax2.validation.XMLValidator");
      assertNotNull(clazz);
      ProtectionDomain pd = clazz.getProtectionDomain();
      assertNotNull("Protection Domain is null: " + clazz , pd);
View Full Code Here


      String[] packageNames = policy.getPackageNames();
      Set<String> actual = makeSet(packageNames);
      assertEquals(expected.keySet(), actual);
     
      ClassLoaderSystem system = new DefaultClassLoaderSystem();
      ClassLoader classLoader = system.registerClassLoaderPolicy(policy);
     
      for (Map.Entry<String, String> entry : expected.entrySet())
      {
         String packageName = entry.getKey();
         String resource = packageName.replace('.', '/') + "/notempty";
View Full Code Here

      VirtualFile testjar1 = VFS.getRoot(testjar1URL);
      VFSClassLoaderPolicy policy = VFSClassLoaderPolicy.createVFSClassLoaderPolicy(testjar1);
      policy.setExportAll(ExportAll.ALL);
     
      ClassLoaderSystem system = new DefaultClassLoaderSystem();
      ClassLoader classLoader = system.registerClassLoaderPolicy(policy);
      URL notempty = classLoader.getResource("notempty");
      assertNotNull(notempty);
   }
   public void testWar1Resources()
      throws Exception
View Full Code Here

      VFSClassLoaderPolicy policy = VFSClassLoaderPolicy.createVFSClassLoaderPolicy(testwar1);
      policy.setExportAll(ExportAll.NON_EMPTY);
      policy.setImportAll(true);

      ClassLoaderSystem system = new DefaultClassLoaderSystem();
      ClassLoader classLoader = system.registerClassLoaderPolicy(policy);
      URL resURL = classLoader.getResource("test-resource.txt");
      assertNull(resURL);
      resURL = classLoader.getResource("WEB-INF/test-resource.txt");
      assertNotNull(resURL);
   }
View Full Code Here

      assertNotNull(testjar3subjar);
      VFSClassLoaderPolicy policy = VFSClassLoaderPolicy.createVFSClassLoaderPolicy(testjar3, testjar3subjar);
      policy.setExportAll(ExportAll.NON_EMPTY);
     
      ClassLoaderSystem system = new DefaultClassLoaderSystem();
      ClassLoader classLoader = system.registerClassLoaderPolicy(policy);
      URL notempty = classLoader.getResource("notempty");
      assertNotNull(notempty);
      notempty = classLoader.getResource("package1/notempty");
      assertNotNull(notempty);
      notempty = classLoader.getResource("package2/notempty");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.