public class WebContextsService extends AbstractContextsService
ContextsService
implementation.| Modifier and Type | Field and Description |
|---|---|
protected ApplicationContext |
applicationContext
A single applicationContext
|
protected ThreadLocal<ConversationContext> |
conversationContexts
Current conversation context
|
protected ConversationManager |
conversationManager
Conversation context manager
|
protected DependentContext |
dependentContext
Current dependent context
|
protected Boolean |
eagerSessionInitialisation |
protected Pattern |
eagerSessionPattern |
protected Boolean |
fireRequestLifecycleEvents |
protected ThreadLocal<ServletRequestContext> |
requestContexts
Current request context
|
protected ThreadLocal<SessionContext> |
sessionContexts
Current session context
|
protected SingletonContext |
singletonContext |
supportsConversation, webBeansContext| Constructor and Description |
|---|
WebContextsService(WebBeansContext webBeansContext)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
configureEagerSessionInitialisation(WebBeansContext webBeansContext) |
void |
destroy(Object destroyObject) |
protected void |
destroyApplicationContext(Object endObject)
Destroys the application context and all of its components at the end of
the application.
|
protected void |
destroyConversationContext()
Destroy conversation context.
|
protected void |
destroyRequestContext(Object endObject)
Destroys the request context and all of its components.
|
protected void |
destroySessionContext(Object endObject)
Destroys the session context and all of its components at the end of the
session.
|
protected void |
destroySingletonContext(Object endObject)
Destroy singleton context.
|
void |
endContext(Class<? extends Annotation> scopeType,
Object endParameters) |
ConversationContext |
getConversationContext(boolean create,
boolean ignoreProblems)
Get current conversation ctx.
|
Context |
getCurrentContext(Class<? extends Annotation> scopeType) |
Context |
getCurrentContext(Class<? extends Annotation> scopeType,
boolean createIfNotExists) |
ServletRequestContext |
getRequestContext(boolean create)
Get current request ctx.
|
SessionContext |
getSessionContext(boolean forceCreate)
Get current session ctx or lazily create one.
|
void |
init(Object initializeObject) |
protected void |
initApplicationContext(Object startupObject)
Creates the application context at the application startup
|
protected void |
initConversationContext(Object startObject)
Initialize conversation context.
|
protected void |
initRequestContext(Object startupObject)
Initialize requext context with the given request object.
|
protected void |
initSessionContext(Object startupObject)
Creates the session context at the session start.
|
protected void |
initSingletonContext(Object startupObject)
Initialize singleton context.
|
void |
removeThreadLocals()
Removes the ThreadLocals from the ThreadMap to prevent memory leaks.
|
protected boolean |
sessionIsExpiring(HttpSession session) |
protected boolean |
shouldEagerlyInitializeSession(HttpServletRequest request) |
protected boolean |
shouldFireRequestLifecycleEvents() |
void |
startContext(Class<? extends Annotation> scopeType,
Object startParameter) |
destroyOutdatedConversations, setSupportConversationsprotected ApplicationContext applicationContext
protected SingletonContext singletonContext
protected ThreadLocal<ServletRequestContext> requestContexts
protected ThreadLocal<SessionContext> sessionContexts
protected ThreadLocal<ConversationContext> conversationContexts
protected DependentContext dependentContext
protected final ConversationManager conversationManager
protected Boolean eagerSessionInitialisation
protected Pattern eagerSessionPattern
protected Boolean fireRequestLifecycleEvents
public WebContextsService(WebBeansContext webBeansContext)
protected void configureEagerSessionInitialisation(WebBeansContext webBeansContext)
public void removeThreadLocals()
removeThreadLocals in interface ContextsServiceremoveThreadLocals in class AbstractContextsServicepublic void init(Object initializeObject)
init in interface ContextsServiceinit in class AbstractContextsServicepublic void destroy(Object destroyObject)
destroy in interface ContextsServicedestroy in class AbstractContextsServicepublic void endContext(Class<? extends Annotation> scopeType, Object endParameters)
endContext in interface ContextsServiceendContext in class AbstractContextsServicepublic Context getCurrentContext(Class<? extends Annotation> scopeType, boolean createIfNotExists)
getCurrentContext in interface ContextsServicegetCurrentContext in class AbstractContextsServicepublic Context getCurrentContext(Class<? extends Annotation> scopeType)
getCurrentContext in interface ContextsServicegetCurrentContext in class AbstractContextsServicepublic void startContext(Class<? extends Annotation> scopeType, Object startParameter) throws ContextException
startContext in interface ContextsServicestartContext in class AbstractContextsServiceContextExceptionprotected void initRequestContext(Object startupObject)
startupObject - http servlet request event or system specific payloadprotected boolean shouldEagerlyInitializeSession(HttpServletRequest request)
protected void destroyRequestContext(Object endObject)
endObject - http servlet request object or other payloadprotected void initSessionContext(Object startupObject)
startupObject - HttpSession objectprotected void destroySessionContext(Object endObject)
endObject - http session object. Can be null or different object for non-http SessionContexts. Such a context only lives for one thread.protected boolean sessionIsExpiring(HttpSession session)
true if the sessino is currently expiring or has already expiredprotected void initApplicationContext(Object startupObject)
startupObject - servlet context object or other startupprotected void destroyApplicationContext(Object endObject)
endObject - servlet context object or other payloadprotected void initSingletonContext(Object startupObject)
startupObject - servlet contextprotected void destroySingletonContext(Object endObject)
endObject - servlet context or other payloadprotected void initConversationContext(Object startObject)
startObject - either a ServletRequest or a ConversationContextprotected void destroyConversationContext()
public ServletRequestContext getRequestContext(boolean create)
public SessionContext getSessionContext(boolean forceCreate)
forceCreate - if true we will force creating a session if not yet exists.
if false we will only create a SessionContext if a HttpSession already existspublic ConversationContext getConversationContext(boolean create, boolean ignoreProblems)
protected boolean shouldFireRequestLifecycleEvents()
Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.