Package org.jboss.resteasy.specimpl
Class BuiltResponse
- java.lang.Object
-
- javax.ws.rs.core.Response
-
- org.jboss.resteasy.specimpl.AbstractBuiltResponse
-
- org.jboss.resteasy.specimpl.BuiltResponse
-
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
BuiltResponseEntityNotBacked,ClientResponse,ServerResponse
public class BuiltResponse extends AbstractBuiltResponse
A response object not attached to a client or server invocation.- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jboss.resteasy.specimpl.AbstractBuiltResponse
AbstractBuiltResponse.InputStreamWrapper<T extends BuiltResponse>
-
-
Field Summary
-
Fields inherited from class org.jboss.resteasy.specimpl.AbstractBuiltResponse
annotations, bufferedEntity, entity, entityClass, genericType, is, isClosed, metadata, processor, reason, status, streamFullyRead, streamRead
-
-
Constructor Summary
Constructors Constructor Description BuiltResponse()BuiltResponse(int status, String reason, Headers<Object> metadata, Object entity, Annotation[] entityAnnotations)BuiltResponse(int status, Headers<Object> metadata, Object entity, Annotation[] entityAnnotations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanbufferEntity()protected InputStreamgetEntityStream()protected InputStreamgetInputStream()<T> TreadEntity(Class<T> type, Type genericType, Annotation[] anns)protected <T> ObjectreadFrom(Class<T> type, Type genericType, javax.ws.rs.core.MediaType media, Annotation[] annotations)voidreleaseConnection()Release underlying connection but do not close.voidreleaseConnection(boolean consumeInputStream)Release underlying connection but do not close.protected voidsetInputStream(InputStream is)-
Methods inherited from class org.jboss.resteasy.specimpl.AbstractBuiltResponse
abortIfClosed, addMethodAnnotations, close, getAllowedMethods, getAnnotations, getCookies, getDate, getEntity, getEntityClass, getEntityTag, getGenericType, getHeaderString, getHeaderValueProcessor, getLanguage, getLastModified, getLength, getLink, getLinkBuilder, getLinks, getLocation, getMediaType, getMetadata, getReasonPhrase, getStatus, getStatusInfo, getStringHeaders, hasEntity, hasLink, isClosed, readEntity, readEntity, readEntity, readEntity, resetEntity, setAnnotations, setEntity, setEntityClass, setGenericType, setMetadata, setReasonPhrase, setStatus, setStreamFullyRead, setStreamRead, toHeaderString
-
-
-
-
Constructor Detail
-
BuiltResponse
public BuiltResponse()
-
BuiltResponse
public BuiltResponse(int status, Headers<Object> metadata, Object entity, Annotation[] entityAnnotations)
-
BuiltResponse
public BuiltResponse(int status, String reason, Headers<Object> metadata, Object entity, Annotation[] entityAnnotations)
-
-
Method Detail
-
readEntity
public <T> T readEntity(Class<T> type, Type genericType, Annotation[] anns)
- Specified by:
readEntityin classAbstractBuiltResponse
-
readFrom
protected <T> Object readFrom(Class<T> type, Type genericType, javax.ws.rs.core.MediaType media, Annotation[] annotations)
-
getEntityStream
protected InputStream getEntityStream()
- Specified by:
getEntityStreamin classAbstractBuiltResponse
-
setInputStream
protected void setInputStream(InputStream is)
- Specified by:
setInputStreamin classAbstractBuiltResponse
-
getInputStream
protected InputStream getInputStream()
- Specified by:
getInputStreamin classAbstractBuiltResponse
-
releaseConnection
public void releaseConnection() throws IOExceptionDescription copied from class:AbstractBuiltResponseRelease underlying connection but do not close.- Specified by:
releaseConnectionin classAbstractBuiltResponse- Throws:
IOException- if I/O error occurred
-
releaseConnection
public void releaseConnection(boolean consumeInputStream) throws IOExceptionDescription copied from class:AbstractBuiltResponseRelease underlying connection but do not close.- Specified by:
releaseConnectionin classAbstractBuiltResponse- Parameters:
consumeInputStream- boolean to indicate either the underlying input stream must be fully read before releasing the connection or not.For most HTTP connection implementations, consuming the underlying input stream before releasing the connection will help to ensure connection reusability with respect of Keep-Alive policy.
- Throws:
IOException- if I/O error occured
-
bufferEntity
public boolean bufferEntity()
- Specified by:
bufferEntityin classjavax.ws.rs.core.Response
-
-