Package org.spincast.core.exchange
Interface RequestContext<R extends RequestContext<?>>
- All Known Subinterfaces:
AppRequestContext
,AppRequestContext
,AppRequestContext
,DefaultRequestContext
- All Known Implementing Classes:
AppRequestContextDefault
,AppRequestContextDefault
,AppRequestContextDefault
,DefaultRequestContextDefault
public interface RequestContext<R extends RequestContext<?>>
The base interface for a request context.
This declares the default
add-ons
and default
utility methods.-
Method Summary
Modifier and TypeMethodDescriptionCache headers related methods.exchange()
The underlying exchange object, as given by the HTTP server.<T> T
get
(com.google.inject.Key<T> key) Shortcut to get an instance from Guice.<T> T
Shortcut to get an instance from Guice.The best Locale to use, as resolved by theLocaleResolver
.The best TimeZone to use, as resolved by theTimeZoneResolver
.com.google.inject.Injector
guice()
Easy access to the Guice context.json()
Easy access to theJsonManager
, Json related methods.request()
Request related methods.response()
Response related methods.routing()
Routing related methods.Templating methods.Request scoped variables related methods.xml()
Easy access to theXmlManager
, XML related methods.
-
Method Details
-
request
RequestRequestContextAddon<R> request()Request related methods. -
response
ResponseRequestContextAddon<R> response()Response related methods. -
routing
RoutingRequestContextAddon<R> routing()Routing related methods. -
templating
TemplatingRequestContextAddon<R> templating()Templating methods. -
variables
VariablesRequestContextAddon<R> variables()Request scoped variables related methods. -
cacheHeaders
CacheHeadersRequestContextAddon<R> cacheHeaders()Cache headers related methods. -
json
JsonManager json()Easy access to theJsonManager
, Json related methods. -
xml
XmlManager xml()Easy access to theXmlManager
, XML related methods. -
guice
com.google.inject.Injector guice()Easy access to the Guice context. -
get
Shortcut to get an instance from Guice. Will also cache the instance (as long as it is request scoped or a singleton). -
get
<T> T get(com.google.inject.Key<T> key) Shortcut to get an instance from Guice. Will also cache the instance (as long as it is request scoped or a singleton) -
getLocaleToUse
Locale getLocaleToUse()The best Locale to use, as resolved by theLocaleResolver
. -
getTimeZoneToUse
TimeZone getTimeZoneToUse()The best TimeZone to use, as resolved by theTimeZoneResolver
. -
exchange
Object exchange()The underlying exchange object, as given by the HTTP server. If you know for sure what its implementation is, you may cast it to access extra functionalities not provided by Spincast out of the box.
-