Package org.apache.myfaces.cdi
Class FacesScopeContext
- java.lang.Object
-
- org.apache.myfaces.cdi.FacesScopeContext
-
- All Implemented Interfaces:
jakarta.enterprise.context.spi.Context
@Typed public class FacesScopeContext extends Object implements jakarta.enterprise.context.spi.Context
Minimal implementation of FacesScope.
-
-
Field Summary
Fields Modifier and Type Field Description static String
FACES_SCOPED_STORAGE
-
Constructor Summary
Constructors Constructor Description FacesScopeContext(jakarta.enterprise.inject.spi.BeanManager beanManager)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkActive(FacesContext facesContext)
Make sure that the Context is really active.boolean
destroy(jakarta.enterprise.context.spi.Contextual bean)
static void
destroyAll(FacesContext facesContext)
<T> T
get(jakarta.enterprise.context.spi.Contextual<T> bean)
<T> T
get(jakarta.enterprise.context.spi.Contextual<T> bean, jakarta.enterprise.context.spi.CreationalContext<T> creationalContext)
protected ContextualStorage
getContextualStorage(boolean createIfNotExist, FacesContext facesContext)
An implementation has to return the underlying storage which contains the items held in the Context.Class<? extends Annotation>
getScope()
boolean
isActive()
-
-
-
Field Detail
-
FACES_SCOPED_STORAGE
public static final String FACES_SCOPED_STORAGE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getScope
public Class<? extends Annotation> getScope()
- Specified by:
getScope
in interfacejakarta.enterprise.context.spi.Context
-
isActive
public boolean isActive()
- Specified by:
isActive
in interfacejakarta.enterprise.context.spi.Context
-
get
public <T> T get(jakarta.enterprise.context.spi.Contextual<T> bean)
- Specified by:
get
in interfacejakarta.enterprise.context.spi.Context
-
get
public <T> T get(jakarta.enterprise.context.spi.Contextual<T> bean, jakarta.enterprise.context.spi.CreationalContext<T> creationalContext)
- Specified by:
get
in interfacejakarta.enterprise.context.spi.Context
-
checkActive
protected void checkActive(FacesContext facesContext)
Make sure that the Context is really active.- Parameters:
facesContext
-- Throws:
jakarta.enterprise.context.ContextNotActiveException
- if there is no active Context for the current Thread.
-
getContextualStorage
protected ContextualStorage getContextualStorage(boolean createIfNotExist, FacesContext facesContext)
An implementation has to return the underlying storage which contains the items held in the Context.- Parameters:
createIfNotExist
- whether a ContextualStorage shall get created if it doesn't yet exist.facesContext
-- Returns:
- the underlying storage
-
destroy
public boolean destroy(jakarta.enterprise.context.spi.Contextual bean)
-
destroyAll
public static void destroyAll(FacesContext facesContext)
-
-