Package org.jboss.shrinkwrap.api.classloader

Examples of org.jboss.shrinkwrap.api.classloader.ShrinkWrapClassLoader


   {
      Archive<JavaArchive> jarWithDefaultServiceImpl = createJarWithDefaultServiceImpl();
      Archive<JavaArchive> jarThatReplaceServiceImpl = createJarThatReplaceServiceImpl();

      ClassLoader emptyParent = null;
      ShrinkWrapClassLoader swClassloader = new ShrinkWrapClassLoader(emptyParent, jarWithDefaultServiceImpl, jarThatReplaceServiceImpl);

      ClassLoader emptyClassLoader = new ClassLoader(null){};
      ClassLoader originalClassLoader = SecurityActions.getThreadContextClassLoader();

      Collection<?> providers = null;
      Class<?> expectedImplClass = null;
      try
      {
         Thread.currentThread().setContextClassLoader(emptyClassLoader);
        
         Class<?> serviceClass = swClassloader.loadClass("org.jboss.arquillian.core.impl.loadable.util.FakeService");
         expectedImplClass = swClassloader.loadClass("org.jboss.arquillian.core.impl.loadable.util.ShouldBeIncluded");
        
         providers = new JavaSPIExtensionLoader().all(swClassloader, serviceClass);
      }
      finally
      {
View Full Code Here


   {
   }

   public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException
  
      ShrinkWrapClassLoader classLoader = getClassLoader(archive);
      ContextClassLoaderManager classLoaderManager = new ContextClassLoaderManager(classLoader);
      classLoaderManager.enable();
     
      TestContainer container = new TestContainer(findArchiveId(archive), findBeansXml(archive), findBeanClasses(archive, classLoader));
      Bootstrap bootstrap = container.getBootstrap();
View Full Code Here

      throw new UnsupportedOperationException("Weld EE Container does not support undeployment of Descriptors");
   }

    private ShrinkWrapClassLoader getClassLoader(Archive<?> archive) {
        return (archive.getName().endsWith(SUFFIX_WEB_ARCHIVE)) ? new WebArchiveClassLoader(archive.getClass().getClassLoader(), archive)
                : new ShrinkWrapClassLoader(archive.getClass().getClassLoader(), archive);
    }
View Full Code Here

        try {
            ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();

            JavaArchive archive = ShrinkWrap.create(JavaArchive.class).add(transformedAsset);
            ShrinkWrapClassLoader shrinkWrapClassLoader = new ShrinkWrapClassLoader(ClassLoaderUtils.getBootstrapClassLoader(),
                    archive);

            SeparatedClassLoader separatedClassLoader = new SeparatedClassLoader(shrinkWrapClassLoader, contextClassLoader);

            return SeparateInvocator.<Migration, MigrationImpl>invoke(MigrationImpl.class, separatedClassLoader).process(
View Full Code Here

        JavaArchive[] copy = new JavaArchive[classPathArchives.length + 1];
        System.arraycopy(classPathArchives, 0, copy, 0, classPathArchives.length);

        copy[copy.length - 1] = ShrinkWrap.create(JavaArchive.class).addClass(SerializationUtils.class);

        ClassLoader separatedClassLoader = new ShrinkWrapClassLoader(ClassLoaderUtils.getBootstrapClassLoader(), copy);
        return invoke(clazz, separatedClassLoader);
    }
View Full Code Here

   {
   }

   public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException
  
      ShrinkWrapClassLoader classLoader = getClassLoader(archive);
      ContextClassLoaderManager classLoaderManager = new ContextClassLoaderManager(classLoader);
      classLoaderManager.enable();
     
      TestContainer container = new TestContainer(findArchiveId(archive), findBeansXml(archive), findBeanClasses(archive, classLoader), true);
      Bootstrap bootstrap = container.getBootstrap();
View Full Code Here

      throw new UnsupportedOperationException("Weld EE Container does not support undeployment of Descriptors");
   }

    private ShrinkWrapClassLoader getClassLoader(Archive<?> archive) {
        return (archive.getName().endsWith(SUFFIX_WEB_ARCHIVE)) ? new WebArchiveClassLoader(archive.getClass().getClassLoader(), archive)
                : new ShrinkWrapClassLoader(archive.getClass().getClassLoader(), archive);
    }
View Full Code Here

   {
   }

   public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException
  
      ShrinkWrapClassLoader classLoader = new ShrinkWrapClassLoader(archive.getClass().getClassLoader(), archive);
      ContextClassLoaderManager classLoaderManager = new ContextClassLoaderManager(classLoader);
      classLoaderManager.enable();
     
      TestContainer container = new TestContainer(findArchiveId(archive), findBeansXml(archive), findBeanClasses(archive, classLoader));
      Bootstrap bootstrap = container.getBootstrap();
View Full Code Here

TOP

Related Classes of org.jboss.shrinkwrap.api.classloader.ShrinkWrapClassLoader

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.