Package org.jboss.classloading.spi.vfs.policy

Examples of org.jboss.classloading.spi.vfs.policy.VFSClassLoaderPolicy


      testExportAllFromBase(exportAll, expected, empty, urls, excluded);
   }

   protected void testExportAllCommon(ExportAll exportAll, Map<String, String> expected, Set<String> empty, VirtualFile[] files, VirtualFile[] excluded) throws Exception
   {
      VFSClassLoaderPolicy policy = VFSClassLoaderPolicy.createVFSClassLoaderPolicy(files, excluded);
      policy.setExportAll(exportAll);
     
      String[] packageNames = policy.getPackageNames();
      Set<String> actual = makeSet(packageNames);
      assertEquals(expected.keySet(), actual);
     
      ClassLoaderSystem system = new DefaultClassLoaderSystem();
      ClassLoader classLoader = system.registerClassLoaderPolicy(policy);
View Full Code Here


   public void testJar1Resources()
      throws Exception
   {
      URL testjar1URL = getResource("/classloader/testjar1");
      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);
View Full Code Here

   public void testWar1Resources()
      throws Exception
   {
      URL testwar1URL = getResource("/classloader/testwar1.war");
      VirtualFile testwar1 = VFS.getRoot(testwar1URL);
      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);
View Full Code Here

   {
      URL testjar3URL = getResource("/classloader/testjar3");
      VirtualFile testjar3 = VFS.getRoot(testjar3URL);
      VirtualFile testjar3subjar = testjar3.getChild("subjar1.jar");
      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);
View Full Code Here

      {
         URL url = list.get(i);
         files[i] = VFS.getRoot(url);
      }
     
      VFSClassLoaderPolicy policy = new VFSClassLoaderPolicy(files);
      policy.setExportAll(ExportAll.NON_EMPTY);
      policy.setImportAll(true);
      ClassLoader classLoader = system.registerClassLoaderPolicy(policy);
      if (classLoader instanceof RealClassLoader)
         bootstrapUCLName = ((RealClassLoader) classLoader).getObjectName();
      return classLoader;
   }
View Full Code Here

   }
  
   @Override
   protected VFSClassLoaderPolicy determinePolicy()
   {
      VFSClassLoaderPolicy policy = VFSClassLoaderPolicy.createVFSClassLoaderPolicy(getContextName(), vfsRoots, excludedRoots);
      String[] packageNames = getPackageNames();
      policy.setExportedPackages(packageNames);
      policy.setIncluded(getIncluded());
      policy.setExcluded(getExcluded());
      policy.setExcludedExport(getExcludedExport());
      policy.setExportAll(getExportAll());
      policy.setImportAll(isImportAll());
      policy.setCacheable(isCacheable());
      policy.setBlackListable(isBlackListable());
      policy.setDelegates(getDelegates());
      return policy;
   }
View Full Code Here

TOP

Related Classes of org.jboss.classloading.spi.vfs.policy.VFSClassLoaderPolicy

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.