public interface CdiContainer
A CdiTestContainer provides access to an underlying JSR-299 (CDI) Container. It allows starting and stopping the container and to start and stop the built-in contexts of that container.
The intention is to provide a portable control for CDI containers in Java SE environments. It is not intended for environments in which the CDI container is under full control of the server already, e.g. in EE-containers.
Modifier and Type | Method and Description |
---|---|
void |
boot()
Booting the CdiTestContainer will scan the whole classpath
for Beans and extensions available.
|
void |
boot(Map<?,?> properties)
Like
boot() but allows to pass in a configuration Map
for the container. |
javax.enterprise.inject.spi.BeanManager |
getBeanManager() |
ContextControl |
getContextControl() |
void |
shutdown()
This will shutdown the underlying CDI container and stop all contexts.
|
void boot()
Booting the CdiTestContainer will scan the whole classpath for Beans and extensions available. The container might throw a DeploymentException or similar on startup.
Note: booting the container does not automatically
start all CDI Contexts! Depending on the underlying CDI container you
might need to invoke getContextControl()
and execute
ContextControl.startContext(Class)
or
ContextControl.startContexts()
void boot(Map<?,?> properties)
Like boot()
but allows to pass in a configuration Map
for the container.
Please note that the configuration is container implementation dependent!
properties
- void shutdown()
javax.enterprise.inject.spi.BeanManager getBeanManager()
BeanManager
or null
it not availableContextControl getContextControl()
null
if the container is not yet startedCopyright © 2015 The Apache Software Foundation. All rights reserved.