Package org.jboss.weld
Class Container
- java.lang.Object
-
- org.jboss.weld.Container
-
public class Container extends Object
A Weld application container- Author:
- pmuir
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONTEXT_ID_KEY
-
Constructor Summary
Constructors Constructor Description Container(String contextId, BeanManagerImpl deploymentManager, org.jboss.weld.bootstrap.api.ServiceRegistry deploymentServices)Container(String contextId, BeanManagerImpl deploymentManager, org.jboss.weld.bootstrap.api.ServiceRegistry deploymentServices, org.jboss.weld.bootstrap.api.Environment environment)Container(BeanManagerImpl deploymentManager, org.jboss.weld.bootstrap.api.ServiceRegistry deploymentServices)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description BeanManagerImplactivityManager(String key)Deprecated.UsegetBeanManager(String)insteadstatic booleanavailable()static booleanavailable(String contextId)Map<org.jboss.weld.bootstrap.spi.BeanDeploymentArchive,BeanManagerImpl>beanDeploymentArchives()voidcleanup()Cause the container to be cleaned up, including all registered bean managers, and all deployment servicesBeanManagerImpldeploymentManager()Gets the manager for this application deploymentBeanManagerImplgetBeanManager(String key)Get the BeanManager for a given keystatic org.jboss.weld.bootstrap.api.EnvironmentgetEnvironment()ReturnsEnvironmentthat this container was booted in, or null if not set or invoked too early in the bootstrapping process.ContainerStategetState()static voidinitialize(String contextId, BeanManagerImpl deploymentManager, org.jboss.weld.bootstrap.api.ServiceRegistry deploymentServices)static voidinitialize(String contextId, BeanManagerImpl deploymentManager, org.jboss.weld.bootstrap.api.ServiceRegistry deploymentServices, org.jboss.weld.bootstrap.api.Environment environment)static voidinitialize(BeanManagerImpl deploymentManager, org.jboss.weld.bootstrap.api.ServiceRegistry deploymentServices)Initialize the container for the current application deploymentstatic Containerinstance()Get the container for the current application deploymentstatic Containerinstance(String contextId)static Containerinstance(AnnotatedTypeIdentifier identifier)static Containerinstance(BeanManagerImpl manager)static booleanisSet(String contextId)voidputBeanDeployments(BeanDeploymentArchiveMapping bdaMapping)Add sub-deployment units to the containerorg.jboss.weld.bootstrap.api.ServiceRegistryservices()Get the services for this application deploymentvoidsetState(ContainerState state)
-
-
-
Field Detail
-
CONTEXT_ID_KEY
public static final String CONTEXT_ID_KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Container
public Container(String contextId, BeanManagerImpl deploymentManager, org.jboss.weld.bootstrap.api.ServiceRegistry deploymentServices)
-
Container
public Container(BeanManagerImpl deploymentManager, org.jboss.weld.bootstrap.api.ServiceRegistry deploymentServices)
-
Container
public Container(String contextId, BeanManagerImpl deploymentManager, org.jboss.weld.bootstrap.api.ServiceRegistry deploymentServices, org.jboss.weld.bootstrap.api.Environment environment)
-
-
Method Detail
-
instance
public static Container instance()
Get the container for the current application deployment- Returns:
-
available
public static boolean available()
-
instance
public static Container instance(BeanManagerImpl manager)
-
instance
public static Container instance(AnnotatedTypeIdentifier identifier)
-
available
public static boolean available(String contextId)
-
isSet
public static boolean isSet(String contextId)
-
initialize
public static void initialize(BeanManagerImpl deploymentManager, org.jboss.weld.bootstrap.api.ServiceRegistry deploymentServices)
Initialize the container for the current application deployment- Parameters:
deploymentManager-deploymentServices-
-
initialize
public static void initialize(String contextId, BeanManagerImpl deploymentManager, org.jboss.weld.bootstrap.api.ServiceRegistry deploymentServices)
-
initialize
public static void initialize(String contextId, BeanManagerImpl deploymentManager, org.jboss.weld.bootstrap.api.ServiceRegistry deploymentServices, org.jboss.weld.bootstrap.api.Environment environment)
-
cleanup
public void cleanup()
Cause the container to be cleaned up, including all registered bean managers, and all deployment services
-
deploymentManager
public BeanManagerImpl deploymentManager()
Gets the manager for this application deployment
-
beanDeploymentArchives
public Map<org.jboss.weld.bootstrap.spi.BeanDeploymentArchive,BeanManagerImpl> beanDeploymentArchives()
-
getBeanManager
public BeanManagerImpl getBeanManager(String key)
Get the BeanManager for a given key- Parameters:
key-- Returns:
-
activityManager
@Deprecated public BeanManagerImpl activityManager(String key)
Deprecated.UsegetBeanManager(String)instead
-
services
public org.jboss.weld.bootstrap.api.ServiceRegistry services()
Get the services for this application deployment- Returns:
- the deploymentServices
-
putBeanDeployments
public void putBeanDeployments(BeanDeploymentArchiveMapping bdaMapping)
Add sub-deployment units to the container- Parameters:
bdaMapping-
-
getState
public ContainerState getState()
-
setState
public void setState(ContainerState state)
-
getEnvironment
public static org.jboss.weld.bootstrap.api.Environment getEnvironment()
ReturnsEnvironmentthat this container was booted in, or null if not set or invoked too early in the bootstrapping process. Note that should there be multiple containers active, this will return theEnvironmentthat the first container was bootstrapped in, unless it was null.- Returns:
Environmentor null
-
-