Package org.jboss.weld.bootstrap.spi

Examples of org.jboss.weld.bootstrap.spi.Deployment


        // The war can access the ejb jar
        war.getBeanDeploymentArchives().add(ejbJar);

        // Create a deployment, any other classes are put into the ejb-jar (not
        // relevant to test)
        Deployment deployment = new AbstractDeployment(war, ejbJar) {

            public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass) {
                return ejbJar;
            }
View Full Code Here


            public Collection<EjbDescriptor<?>> getEjbs() {
                return ImmutableSet.<EjbDescriptor<?>>of(fooDescriptor, barDescriptor, bazDescriptor);
            }
        };

        final Deployment deployment = new AbstractDeployment(bda) {
            @Override
            public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass) {
                return bda;
            }
            @Override
View Full Code Here

                getServices().add(InjectionServices.class, new TestInjectionServices());
            }
        };

        // Create a deployment, that we can use to mirror the structure of one Extension inside a BDA, and one outside
        Deployment deployment = new AbstractDeployment(new BeanDeploymentArchive[] { bda }) {

            @Override
            public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass) {
                return bda;
            }
View Full Code Here

            throw CommonLogger.LOG.errorLoadingWeld();
        } catch (IllegalAccessException ex) {
            throw CommonLogger.LOG.errorLoadingWeld();
        }

        Deployment deployment = createDeployment(resourceLoader, bootstrap);


        // Set up the container
        bootstrap.startContainer(containerId, Environments.SE, deployment);
        // Start the container
        bootstrap.startInitialization();
        bootstrap.deployBeans();
        bootstrap.validateBeans();
        bootstrap.endInitialization();

        final BeanManager manager = bootstrap.getManager(deployment.loadBeanDeploymentArchive(WeldContainer.class));

        // Set up the ShutdownManager for later
        this.shutdownManager = new ShutdownManager(bootstrap, manager);

        WeldContainer container = getInstanceByType(manager, WeldContainer.class);
View Full Code Here

     */
    protected Deployment createDeployment(ResourceLoader resourceLoader, CDI11Bootstrap bootstrap) {
        final Iterable<Metadata<Extension>> loadedExtensions = loadExtensions(WeldResourceLoader.getClassLoader(), bootstrap);
        final TypeDiscoveryConfiguration typeDiscoveryConfiguration = bootstrap.startExtensions(loadedExtensions);

        Deployment deployment=null;
        DiscoveryStrategy strategy = DiscoveryStrategyFactory.create(
                resourceLoader,
                bootstrap,
                ImmutableSet.<Class<? extends Annotation>> builder().addAll(typeDiscoveryConfiguration.getKnownBeanDefiningAnnotations())
                        // Add ThreadScoped manually as Weld SE doesn't support implicit bean archives without beans.xml
                        .add(ThreadScoped.class).build());
        Set<WeldBeanDeploymentArchive> discoveredArchives = strategy.performDiscovery();

        String isolation = AccessController.doPrivileged(new GetSystemPropertyAction(ARCHIVE_ISOLATION_SYSTEM_PROPERTY));

        if (isolation != null && Boolean.valueOf(isolation).equals(Boolean.FALSE)) {
            WeldBeanDeploymentArchive archive = WeldBeanDeploymentArchive.merge(bootstrap, discoveredArchives);
            deployment = new WeldDeployment(resourceLoader, bootstrap, Collections.singleton(archive), loadedExtensions);
            CommonLogger.LOG.archiveIsolationDisabled();
        } else {
            deployment=  new WeldDeployment(resourceLoader, bootstrap, discoveredArchives, loadedExtensions);
            CommonLogger.LOG.archiveIsolationEnabled();
        }

        if(strategy.getClassFileServices() != null) {
            deployment.getServices().add(ClassFileServices.class, strategy.getClassFileServices());
        }
        return deployment;
    }
View Full Code Here

   private CDIInjectionEnricher enricher;
  
   @Before
   public void setup() throws Exception
   {
      Deployment deployment = createDeployment(Service.class, Cat.class, CatService.class, Dog.class, DogService.class);
      bootstrap = new WeldBootstrap();
      bootstrap.startContainer(Environments.SE, deployment, new ConcurrentHashMapBeanStore())
                  .startInitialization()
                  .deployBeans()
                  .validateBeans()
                  .endInitialization();

      manager = bootstrap.getManager(deployment.getBeanDeploymentArchives().iterator().next());

      enricher = new CDIInjectionEnricher()
      {
         protected BeanManager lookupBeanManager()
         {
View Full Code Here

               beanClasses.add(c.getName());
            }
            return beanClasses;
         }
      };
      final Deployment deployment = new Deployment()
      {
         public Collection<BeanDeploymentArchive> getBeanDeploymentArchives()
         {
            return Arrays.asList((BeanDeploymentArchive)beanArchive);
         }
View Full Code Here

public class ModularWeld extends Weld
{
   @Override
   protected Deployment createDeployment(final ResourceLoader resourceLoader, final Bootstrap bootstrap)
   {
      Deployment deployment = super.createDeployment(resourceLoader, bootstrap);

      // Collection<BeanDeploymentArchive> archives = deployment.getBeanDeploymentArchives();

      return deployment;
   }
View Full Code Here

      ClassLoader cl = new ShrinkWrapClassLoader(archive);

      Thread.currentThread().setContextClassLoader(cl);

      Deployment deployment = new Deployment()
      {
         public Collection<BeanDeploymentArchive> getBeanDeploymentArchives()
         {
            return Arrays.asList(beanArchive);
         }
View Full Code Here

   }

   @Override
   protected Deployment createDeployment(ResourceLoader loader, CDI11Bootstrap bootstrap)
   {
      Deployment deployment = super.createDeployment(scanResult.getResourceLoader(), bootstrap);
      deployment.getServices().add(BootstrapConfiguration.class, new PerformanceTunedBootstrapConfiguration());
      return deployment;
   }
View Full Code Here

TOP

Related Classes of org.jboss.weld.bootstrap.spi.Deployment

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.