com.sun.jersey.spi.container
Class CachedEntityContainerRequest
java.lang.Object
com.sun.jersey.spi.container.ContainerRequest
com.sun.jersey.spi.container.AdaptingContainerRequest
com.sun.jersey.spi.container.CachedEntityContainerRequest
- All Implemented Interfaces:
- HttpRequestContext, Traceable, HttpHeaders, Request, SecurityContext
public class CachedEntityContainerRequest
- extends AdaptingContainerRequest
A cached entity in-bound HTTP request that caches the entity instance
obtained from the adapted container request.
A filter may utilize this class if it requires an entity of a specific type
and that same type will also be utilized by a resource method.
- Author:
- [email protected]
Fields inherited from interface javax.ws.rs.core.HttpHeaders |
ACCEPT, ACCEPT_CHARSET, ACCEPT_ENCODING, ACCEPT_LANGUAGE, AUTHORIZATION, CACHE_CONTROL, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_TYPE, COOKIE, DATE, ETAG, EXPIRES, HOST, IF_MATCH, IF_MODIFIED_SINCE, IF_NONE_MATCH, IF_UNMODIFIED_SINCE, LAST_MODIFIED, LOCATION, SET_COOKIE, USER_AGENT, VARY, WWW_AUTHENTICATE |
Method Summary |
|
getEntity(java.lang.Class<T> type)
Get the entity or a cached instance. |
|
getEntity(java.lang.Class<T> type,
java.lang.reflect.Type genericType,
java.lang.annotation.Annotation[] as)
Get the entity or a cached instance. |
Methods inherited from class com.sun.jersey.spi.container.AdaptingContainerRequest |
evaluatePreconditions, evaluatePreconditions, evaluatePreconditions, evaluatePreconditions, getAbsolutePath, getAbsolutePathBuilder, getAcceptableLanguages, getAcceptableMediaType, getAcceptableMediaTypes, getAcceptableMediaTypes, getAuthenticationScheme, getBaseUri, getBaseUriBuilder, getCookieNameValueMap, getCookies, getEntityInputStream, getFormParameters, getHeaderValue, getLanguage, getMediaType, getMessageBodyWorkers, getMethod, getPath, getPath, getPathSegments, getPathSegments, getProperties, getQueryParameters, getQueryParameters, getRequestHeader, getRequestHeaders, getRequestUri, getRequestUriBuilder, getUserPrincipal, isSecure, isTracingEnabled, isUserInRole, selectVariant, setEntityInputStream, setHeaders, setMethod, setSecurityContext, setUris, trace |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CachedEntityContainerRequest
public CachedEntityContainerRequest(ContainerRequest acr)
getEntity
public <T> T getEntity(java.lang.Class<T> type)
throws java.lang.ClassCastException
- Get the entity or a cached instance.
- Specified by:
getEntity
in interface HttpRequestContext
- Overrides:
getEntity
in class AdaptingContainerRequest
- Parameters:
type
- the type of entity
- Returns:
- If called for the first time obtain the entity from the adapting
container request and cache the instance. If called for second or
subsequent time return the cached instance.
- Throws:
java.lang.ClassCastException
- if the cached entity cannot be cast to the
type requested.
getEntity
public <T> T getEntity(java.lang.Class<T> type,
java.lang.reflect.Type genericType,
java.lang.annotation.Annotation[] as)
throws java.lang.ClassCastException
- Get the entity or a cached instance.
- Specified by:
getEntity
in interface HttpRequestContext
- Overrides:
getEntity
in class AdaptingContainerRequest
- Parameters:
type
- the type of entitygenericType
- type the generic type of entity, it is the responsibility
of the callee to ensure that the type and generic type are
consistent otherwise the behaviour of this method is undefined.as
- the annotations associated with the type
- Returns:
- If called for the first time obtain the entity from the adapting
container request and cache the instance. If called for second or
subsequent time return the cached instance.
- Throws:
java.lang.ClassCastException
- if the cached entity cannot be cast to the
type requested.
Copyright © 2011 Oracle Corporation. All Rights Reserved.