public class CdiTestOpenWebBeansContainer extends Object implements CdiTestContainer
CdiTestContainer
.Constructor and Description |
---|
CdiTestOpenWebBeansContainer() |
Modifier and Type | Method and Description |
---|---|
void |
bootContainer()
Booting the CdiTestContainer will scan the whole classpath
for Beans and extensions available.
|
javax.enterprise.inject.spi.BeanManager |
getBeanManager() |
<T> T |
getInstance(Class<T> type,
Annotation... qualifiers)
Provide a contextual reference via it's type and optional qualifier annotations.
|
Object |
getInstance(String name)
Provide a contextual reference via it's type and ExpressionLanguage name.
|
void |
shutdownContainer()
This will shutdown the underlying CDI container.
|
void |
startApplicationScope() |
void |
startContexts()
This will start all Contexts
|
void |
startConversationScope() |
void |
startCustomScope(Class<? extends Annotation> scopeClass) |
void |
startRequestScope() |
void |
startSessionScope() |
void |
stopApplicationScope() |
void |
stopContexts()
Stop all Contexts and destroy all beans properly
|
void |
stopConversationScope() |
void |
stopCustomScope(Class<? extends Annotation> scopeClass) |
void |
stopRequestScope() |
void |
stopSessionScope() |
public void bootContainer() throws Exception
CdiTestContainer
bootContainer
in interface CdiTestContainer
Exception
public void shutdownContainer() throws Exception
CdiTestContainer
shutdownContainer
in interface CdiTestContainer
Exception
public void startContexts() throws Exception
CdiTestContainer
startContexts
in interface CdiTestContainer
Exception
public void startApplicationScope() throws Exception
startApplicationScope
in interface CdiTestContainer
Exception
public void startConversationScope() throws Exception
startConversationScope
in interface CdiTestContainer
Exception
public void startCustomScope(Class<? extends Annotation> scopeClass) throws Exception
startCustomScope
in interface CdiTestContainer
Exception
public void startRequestScope() throws Exception
startRequestScope
in interface CdiTestContainer
Exception
public void startSessionScope() throws Exception
startSessionScope
in interface CdiTestContainer
Exception
public void stopContexts() throws Exception
CdiTestContainer
stopContexts
in interface CdiTestContainer
Exception
public void stopApplicationScope() throws Exception
stopApplicationScope
in interface CdiTestContainer
Exception
public void stopConversationScope() throws Exception
stopConversationScope
in interface CdiTestContainer
Exception
public void stopCustomScope(Class<? extends Annotation> scopeClass) throws Exception
stopCustomScope
in interface CdiTestContainer
Exception
public void stopRequestScope() throws Exception
stopRequestScope
in interface CdiTestContainer
Exception
public void stopSessionScope() throws Exception
stopSessionScope
in interface CdiTestContainer
Exception
public javax.enterprise.inject.spi.BeanManager getBeanManager()
getBeanManager
in interface CdiTestContainer
BeanManager
or null
it not availablepublic <T> T getInstance(Class<T> type, Annotation... qualifiers) throws javax.enterprise.inject.ResolutionException
CdiTestContainer
getInstance
in interface CdiTestContainer
T
- the Type of the contextual referencetype
- the Type of the contextual referencequalifiers
- optional qualifiers to restrict the searchjavax.enterprise.inject.ResolutionException
- if not exactly 1 Bean<T>
got foundpublic Object getInstance(String name) throws javax.enterprise.inject.ResolutionException
CdiTestContainer
getInstance
in interface CdiTestContainer
javax.enterprise.inject.ResolutionException
- if not exactly 1 Bean<T>
got foundCopyright © 2008–2016 The Apache Software Foundation. All rights reserved.