|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Context
Represents a bean scope, storing the bean instances available to the
execution context, and corresponding to a
@ScopeType.
The Context is an SPI class, called by
the inject
Manager, but not normally by application code. Applications will call
BeanManager.newInstance to
create a new instance of a bean.
Example contexts include @ApplicationScoped for singleton objects,
| Method Summary | ||
|---|---|---|
|
get(Contextual<T> bean)
Returns a instance of a bean, creating if the bean is not already available in the context. |
|
|
get(Contextual<T> bean,
CreationalContext<T> creationalContext)
Internal SPI method to create a new instance of a bean, when given a creational context. |
|
java.lang.Class<? extends java.lang.annotation.Annotation> |
getScope()
Returns the @ScopeType corresponding to the current context. |
|
boolean |
isActive()
Returns true if the scope is currently active. |
|
| Method Detail |
|---|
java.lang.Class<? extends java.lang.annotation.Annotation> getScope()
boolean isActive()
<T> T get(Contextual<T> bean)
bean - the Bean type to be created
<T> T get(Contextual<T> bean,
CreationalContext<T> creationalContext)
bean - the Bean type to be createdcreationalContext - - temporary context used for managing
circular references
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||