@Builtin @Singleton(eager=true) @Name(value="org.eiichiro.jaguar.scope.SessionContext") public class SessionContext extends ThreadContext implements WebContext<javax.servlet.http.HttpSession>
Context
implementation corresponding to the Session
scope.
SessionContext
stores a component in HTTP session. If the application
is not running in Web environment, this context becomes equal to
ThreadContext
.COMPONENTS
Constructor and Description |
---|
SessionContext() |
Modifier and Type | Method and Description |
---|---|
void |
associate(javax.servlet.http.HttpSession context)
Associates the current
HttpSession with this instance. |
void |
deassociate(javax.servlet.http.HttpSession context)
Deassociates the current
HttpSession from this instance. |
<T> T |
get(Descriptor<T> descriptor)
Returns the component corresponding to the specified
Descriptor
from the current HttpSession . |
<T> void |
put(Descriptor<T> descriptor,
T component)
Puts the specified component and descriptor pair into the current
HttpSession . |
Object |
store()
Returns the component store this context manages.
|
public <T> T get(Descriptor<T> descriptor)
Descriptor
from the current HttpSession
.
If the application is not running in Web environment, the component is
got from ThreadContext
's component store.get
in interface Context
get
in class ThreadContext
T
- The component type.descriptor
- The descriptor corresponding to the component.Descriptor
.public <T> void put(Descriptor<T> descriptor, T component)
HttpSession
.
If the application is not running in Web environment, the component is
put into ThreadContext
's component store.put
in interface Context
put
in class ThreadContext
T
- The component type.descriptor
- The descriptor corresponding to the component.component
- The component to be put.public void associate(javax.servlet.http.HttpSession context)
HttpSession
with this instance.associate
in interface WebContext<javax.servlet.http.HttpSession>
context
- The current HttpSession
.public void deassociate(javax.servlet.http.HttpSession context)
HttpSession
from this instance.deassociate
in interface WebContext<javax.servlet.http.HttpSession>
context
- The current HttpSession
.Copyright © 2011-2014 Eiichiro Uchiumi. All Rights Reserved.