RESTEasy JAX-RS Implementation 2.3.6.Final-redhat-1

org.jboss.resteasy.core
Class ServerResponse

java.lang.Object
  extended by javax.ws.rs.core.Response
      extended by org.jboss.resteasy.core.ServerResponse

public class ServerResponse
extends javax.ws.rs.core.Response

Version:
$Revision: 1 $
Author:
Bill Burke

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.ws.rs.core.Response
javax.ws.rs.core.Response.ResponseBuilder, javax.ws.rs.core.Response.Status, javax.ws.rs.core.Response.StatusType
 
Field Summary
protected  Annotation[] annotations
           
protected  Object entity
           
protected  Type genericType
           
protected  boolean headersCommitted
           
protected  MessageBodyWriterInterceptor[] messageBodyWriterInterceptors
           
protected  Headers<Object> metadata
           
protected  PostProcessInterceptor[] postProcessInterceptors
           
protected  Class resourceClass
           
protected  Method resourceMethod
           
protected  int status
           
 
Constructor Summary
ServerResponse()
           
ServerResponse(Object entity, int status, Headers<Object> metadata)
           
 
Method Summary
 void commitHeaders(HttpResponse response)
           
static ServerResponse copyIfNotServerResponse(javax.ws.rs.core.Response response)
           
 Annotation[] getAnnotations()
           
 Object getEntity()
           
 Type getGenericType()
           
 MessageBodyWriterInterceptor[] getMessageBodyWriterInterceptors()
           
 javax.ws.rs.core.MultivaluedMap<String,Object> getMetadata()
           
 PostProcessInterceptor[] getPostProcessInterceptors()
           
 Class getResourceClass()
          Resource class.
 Method getResourceMethod()
          JAX-RS method invoked on.
 int getStatus()
           
 javax.ws.rs.core.MediaType resolveContentType()
           
 void setAnnotations(Annotation[] annotations)
           
 void setEntity(Object entity)
           
 void setGenericType(Type genericType)
           
 void setMessageBodyWriterInterceptors(MessageBodyWriterInterceptor[] messageBodyWriterInterceptors)
           
 void setMetadata(javax.ws.rs.core.MultivaluedMap<String,Object> metadata)
           
 void setPostProcessInterceptors(PostProcessInterceptor[] postProcessInterceptors)
           
 void setResourceClass(Class resourceClass)
           
 void setResourceMethod(Method resourceMethod)
           
 void setStatus(int status)
           
 void writeTo(HttpRequest request, HttpResponse response, ResteasyProviderFactory providerFactory)
          If there is an entity, headers are not converted to a string and set on the HttpResponse until the output stream is written to.
 
Methods inherited from class javax.ws.rs.core.Response
created, fromResponse, noContent, notAcceptable, notModified, notModified, notModified, ok, ok, ok, ok, ok, seeOther, serverError, status, status, status, temporaryRedirect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entity

protected Object entity

status

protected int status

metadata

protected Headers<Object> metadata

annotations

protected Annotation[] annotations

genericType

protected Type genericType

postProcessInterceptors

protected PostProcessInterceptor[] postProcessInterceptors

messageBodyWriterInterceptors

protected MessageBodyWriterInterceptor[] messageBodyWriterInterceptors

resourceMethod

protected Method resourceMethod

resourceClass

protected Class resourceClass

headersCommitted

protected boolean headersCommitted
Constructor Detail

ServerResponse

public ServerResponse(Object entity,
                      int status,
                      Headers<Object> metadata)

ServerResponse

public ServerResponse()
Method Detail

copyIfNotServerResponse

public static ServerResponse copyIfNotServerResponse(javax.ws.rs.core.Response response)

getResourceMethod

public Method getResourceMethod()
JAX-RS method invoked on. FYI, this method may return null, specifically within the context of an async HTTP request as contextual information is not available to the container.

Returns:

setResourceMethod

public void setResourceMethod(Method resourceMethod)

getResourceClass

public Class getResourceClass()
Resource class. FYI, this method may return null, specifically within the context of an async HTTP request as contextual information is not available to the container

Returns:

setResourceClass

public void setResourceClass(Class resourceClass)

getMessageBodyWriterInterceptors

public MessageBodyWriterInterceptor[] getMessageBodyWriterInterceptors()

setMessageBodyWriterInterceptors

public void setMessageBodyWriterInterceptors(MessageBodyWriterInterceptor[] messageBodyWriterInterceptors)

getPostProcessInterceptors

public PostProcessInterceptor[] getPostProcessInterceptors()

setPostProcessInterceptors

public void setPostProcessInterceptors(PostProcessInterceptor[] postProcessInterceptors)

getEntity

public Object getEntity()
Specified by:
getEntity in class javax.ws.rs.core.Response

getStatus

public int getStatus()
Specified by:
getStatus in class javax.ws.rs.core.Response

getMetadata

public javax.ws.rs.core.MultivaluedMap<String,Object> getMetadata()
Specified by:
getMetadata in class javax.ws.rs.core.Response

setEntity

public void setEntity(Object entity)

setStatus

public void setStatus(int status)

setMetadata

public void setMetadata(javax.ws.rs.core.MultivaluedMap<String,Object> metadata)

getAnnotations

public Annotation[] getAnnotations()

setAnnotations

public void setAnnotations(Annotation[] annotations)

getGenericType

public Type getGenericType()

setGenericType

public void setGenericType(Type genericType)

writeTo

public void writeTo(HttpRequest request,
                    HttpResponse response,
                    ResteasyProviderFactory providerFactory)
             throws WriterException
If there is an entity, headers are not converted to a string and set on the HttpResponse until the output stream is written to. If there is an exception thrown then the headers are never written to the response. We do this so that on error conditions there is a clean response.

Parameters:
request -
response -
providerFactory -
Throws:
WriterException

resolveContentType

public javax.ws.rs.core.MediaType resolveContentType()

commitHeaders

public void commitHeaders(HttpResponse response)

RESTEasy JAX-RS Implementation 2.3.6.Final-redhat-1

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.