org.apache.wink.server.handlers
Interface MessageContext

All Superinterfaces:
org.apache.wink.common.internal.runtime.RuntimeContext

public interface MessageContext
extends org.apache.wink.common.internal.runtime.RuntimeContext

The MessageContext is used by Handlers to obtain and manipulate request specific information.


Method Summary
 java.lang.String getHttpMethod()
          Get the http method of the request.
 LinkBuilders getLinkBuilders()
          Get the LinkBuilders context
 java.util.Properties getProperties()
          Get the initialization properties
 java.lang.Object getResponseEntity()
          Get the response entity.
 javax.ws.rs.core.MediaType getResponseMediaType()
          Get the previously set response media type
 int getResponseStatusCode()
          Get the response status code that was previously set
 void setHttpMethod(java.lang.String method)
          Set the http method of the request.
 void setResponseEntity(java.lang.Object entity)
          Set the response entity.
 void setResponseMediaType(javax.ws.rs.core.MediaType responseMediaType)
          Set the response media type
 void setResponseStatusCode(int responseStatusCode)
          Set the response status code
 
Methods inherited from interface org.apache.wink.common.internal.runtime.RuntimeContext
getAttribute, getAttributes, getHttpHeaders, getInputStream, getOutputStream, getProviders, getRequest, getSecurityContext, getUriInfo, setAttribute
 

Method Detail

getProperties

java.util.Properties getProperties()
Get the initialization properties

Returns:
initialization properties

setResponseStatusCode

void setResponseStatusCode(int responseStatusCode)
Set the response status code

Parameters:
responseStatusCode - response status code

getResponseStatusCode

int getResponseStatusCode()
Get the response status code that was previously set

Returns:
response status code or -1 if it was not set

setResponseEntity

void setResponseEntity(java.lang.Object entity)
Set the response entity.

This may be

Parameters:
entity - the response entity

getResponseEntity

java.lang.Object getResponseEntity()
Get the response entity.

Returns:
the response entity

setResponseMediaType

void setResponseMediaType(javax.ws.rs.core.MediaType responseMediaType)
Set the response media type

Parameters:
responseMediaType - response media type to set

getResponseMediaType

javax.ws.rs.core.MediaType getResponseMediaType()
Get the previously set response media type

Returns:
previously set response media type

setHttpMethod

void setHttpMethod(java.lang.String method)
Set the http method of the request.

Enables overriding of the actual http method that was used for the request

Parameters:
method - the request http method to set

getHttpMethod

java.lang.String getHttpMethod()
Get the http method of the request.

Note that this may be different than the real http method on the HttpServletRequest if one of X-Method-Override or X-Http-Method-Override request headers was used to override the actual http method.

Returns:
the request http method

getLinkBuilders

LinkBuilders getLinkBuilders()
Get the LinkBuilders context

Returns:
the LinkBuilders context


Copyright © 2009 The Apache Software Foundation. All Rights Reserved.