Package org.jboss.weld.integration.deployer.env

Source Code of org.jboss.weld.integration.deployer.env.JBossBeanDeploymentArchive

package org.jboss.weld.integration.deployer.env;

import java.util.Collection;
import java.util.Collections;
import java.util.List;

import org.jboss.weld.bootstrap.api.Bootstrap;
import org.jboss.weld.bootstrap.api.ServiceRegistry;
import org.jboss.weld.bootstrap.api.helpers.SimpleServiceRegistry;
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.weld.bootstrap.spi.BeansXml;
import org.jboss.weld.ejb.spi.EjbDescriptor;

public class JBossBeanDeploymentArchive implements BeanDeploymentArchive
{

   private final WeldDiscoveryEnvironment environment;
   private final Collection<EjbDescriptor<?>> ejbDescriptors;
   private final ServiceRegistry services;
   private final String id;
   private Bootstrap bootstrap;

   public JBossBeanDeploymentArchive(String id, WeldDiscoveryEnvironment environment, Collection<EjbDescriptor<?>> ejbDescriptors)
   {
      this.environment = environment;
      this.ejbDescriptors = ejbDescriptors;
      this.services = new SimpleServiceRegistry();
      this.id = id;
   }

   public Collection<String> getBeanClasses()
   {
      return environment.getWeldClasses();
   }

   public List<BeanDeploymentArchive> getBeanDeploymentArchives()
   {
      return Collections.emptyList();
   }

   public BeansXml getBeansXml()
   {
      if (bootstrap == null)
      {
         throw new IllegalStateException("bootstrap must not be null");
      }
      return bootstrap.parse(environment.getWeldXml());
   }

   public Collection<EjbDescriptor<?>> getEjbs()
   {
      return ejbDescriptors;
   }

   public ServiceRegistry getServices()
   {
      return services;
   }

   public String getId()
   {
      return id;
   }

   public void setBootstrap(Bootstrap bootstrap)
   {
      this.bootstrap = bootstrap;
   }
  
}
TOP

Related Classes of org.jboss.weld.integration.deployer.env.JBossBeanDeploymentArchive

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.