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