com.caucho.services.server
Class ServiceContext

java.lang.Object
  extended by com.caucho.services.server.ServiceContext

public class ServiceContext
extends Object

Context for a service, to handle request-specific information.


Method Summary
 void addHeader(String header, Object value)
          Adds a header.
static void begin(ServletRequest request, ServletResponse response, String serviceName, String objectId)
          Sets the request object prior to calling the service's method.
static void end()
          Cleanup at the end of a request.
static ServiceContext getContext()
          Returns the service request.
static Object getContextHeader(String header)
          Gets a header from the context.
static String getContextObjectId()
          Returns the object id, corresponding to the ?
static ServletRequest getContextRequest()
          Returns the service request.
static ServletResponse getContextResponse()
          Returns the service request.
static String getContextServiceName()
          Returns the service id, corresponding to the pathInfo of the URL.
 Object getHeader(String header)
          Gets a header.
static String getObjectId()
          Deprecated.  
static ServletRequest getRequest()
          Deprecated.  
static String getServiceName()
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

begin

public static void begin(ServletRequest request,
                         ServletResponse response,
                         String serviceName,
                         String objectId)
                  throws ServletException
Sets the request object prior to calling the service's method.

Parameters:
request - the calling servlet request
serviceId - the service identifier
objectId - the object identifier
Throws:
ServletException

getContext

public static ServiceContext getContext()
Returns the service request.


addHeader

public void addHeader(String header,
                      Object value)
Adds a header.


getHeader

public Object getHeader(String header)
Gets a header.


getContextHeader

public static Object getContextHeader(String header)
Gets a header from the context.


getContextRequest

public static ServletRequest getContextRequest()
Returns the service request.


getContextResponse

public static ServletResponse getContextResponse()
Returns the service request.


getContextServiceName

public static String getContextServiceName()
Returns the service id, corresponding to the pathInfo of the URL.


getContextObjectId

public static String getContextObjectId()
Returns the object id, corresponding to the ?id= of the URL.


end

public static void end()
Cleanup at the end of a request.


getRequest

public static ServletRequest getRequest()
Deprecated. 

Returns the service request.


getServiceName

public static String getServiceName()
Deprecated. 

Returns the service id, corresponding to the pathInfo of the URL.


getObjectId

public static String getObjectId()
Deprecated. 

Returns the object id, corresponding to the ?id= of the URL.



Copyright © 2013. All Rights Reserved.