java.lang.Object | |
↳ | com.google.inject.servlet.ServletScopes |
Servlet scopes.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Scope | REQUEST | HTTP servlet request scope. | |||||||||
Scope | SESSION | HTTP session scope. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Wraps the given callable in a contextual callable that "continues" the
HTTP request in another thread.
| |||||||||||
Scopes the given callable inside a request scope.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Wraps the given callable in a contextual callable that "continues" the HTTP request in another thread. This acts as a way of transporting request context data from the request processing thread to to worker threads.
There are some limitations:
callable | code to be executed in another thread, which depends on the request scope. |
---|---|
seedMap | the initial set of scoped instances for Guice to seed the
request scope with. To seed a key with null, use null as
the value. |
OutOfScopeException | if this method is called from a non-request thread, or if the request has completed. |
---|
Scopes the given callable inside a request scope. This is not the same as the HTTP request scope, but is used if no HTTP request scope is in progress. In this way, keys can be scoped as @RequestScoped and exist in non-HTTP requests (for example: RPC requests) as well as in HTTP request threads.
callable | code to be executed which depends on the request scope. Typically in another thread, but not necessarily so. |
---|---|
seedMap | the initial set of scoped instances for Guice to seed the
request scope with. To seed a key with null, use null as
the value. |
seedMap
as scoped keys.