Package com.caucho.services.server
Class ServiceContext
- java.lang.Object
-
- com.caucho.services.server.ServiceContext
-
public class ServiceContext extends Object
Context for a service, to handle request-specific information. Applications can use the ServiceContext to get servlet session ids or HTTP headers.ServletRequest req = ServiceContext.getContext().getRequest();
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddHeader(String header, Object value)Adds a header.static voidbegin(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, String serviceName, String objectId)Sets the request object prior to calling the service's method.static voidend()Cleanup at the end of a request.static ServiceContextgetContext()Returns the service request.static ObjectgetContextHeader(String header)Gets a header from the context.static StringgetContextObjectId()Returns the object id, corresponding to the ?id= of the URL.static javax.servlet.ServletRequestgetContextRequest()Returns the service request.static javax.servlet.ServletResponsegetContextResponse()Returns the service request.static StringgetContextServiceName()Returns the service id, corresponding to the pathInfo of the URL.ObjectgetHeader(String header)Gets a header.static StringgetObjectId()Deprecated.static javax.servlet.ServletRequestgetRequest()Deprecated.static StringgetServiceName()Deprecated.
-
-
-
Method Detail
-
begin
public static void begin(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, String serviceName, String objectId) throws javax.servlet.ServletExceptionSets the request object prior to calling the service's method.- Parameters:
request- the calling servlet requestserviceId- the service identifierobjectId- the object identifier- Throws:
javax.servlet.ServletException
-
getContext
public static ServiceContext getContext()
Returns the service request.
-
getContextHeader
public static Object getContextHeader(String header)
Gets a header from the context.
-
getContextRequest
public static javax.servlet.ServletRequest getContextRequest()
Returns the service request.
-
getContextResponse
public static javax.servlet.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 javax.servlet.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.
-
-