protected HttpSession getSession(boolean create) { HttpServletRequest request = (HttpServletRequest) ServiceContext .getContextRequest(); if (request == null) { throw new IllegalStateException( "Attempt to access HttpSession outside the request scope."); } return request.getSession(create); }
/** * Gets a header from the context. */ public static Object getContextHeader(String header) { ServiceContext context = (ServiceContext) _localContext.get(); if (context != null) return context.getHeader(header); else return null; }
/** * Returns the object identifier for the request. */ public String getObjectId() { return ServiceContext.getObjectId(); }
ServiceContext context = ServiceContext.getContext(); Object value = in.readObject(); context.addHeader(header, value);
/** * Returns the service identifier for the request. */ public String getServiceName() { return ServiceContext.getServiceName(); }
/** * Returns the servlet request object for the request. */ public ServletRequest getRequest() { return ServiceContext.getRequest(); }
/** * Sets the request object prior to calling the service's method. * * @param request the calling servlet request * @param serviceId the service identifier * @param objectId the object identifier */ public static void begin(ServletRequest request, String serviceName, String objectId) throws ServletException { ServiceContext context = (ServiceContext) _localContext.get(); if (context == null) { context = new ServiceContext(); _localContext.set(context); } context._request = request; context._serviceName = serviceName; context._objectId = objectId; context._count++; }
ServiceContext context = ServiceContext.getContext(); Object value = in.readObject(); context.addHeader(header, value);
/** * Returns the service identifier for the request. */ public String getServiceName() { return ServiceContext.getServiceName(); }
/** * Returns the servlet request object for the request. */ public ServletRequest getRequest() { return ServiceContext.getRequest(); }
/** * Sets the request object prior to calling the service's method. * * @param request the calling servlet request * @param serviceId the service identifier * @param objectId the object identifier */ public static void begin(ServletRequest request, ServletResponse response, String serviceName, String objectId) throws ServletException { ServiceContext context = (ServiceContext) _localContext.get(); if (context == null) { context = new ServiceContext(); _localContext.set(context); } context._request = request; context._response = response; context._serviceName = serviceName; context._objectId = objectId; context._count++; }
ServiceContext context = ServiceContext.getContext(); Object value = in.readObject(); context.addHeader(header, value);
@Override protected HttpSession getSession(boolean create) { HttpServletRequest request = (HttpServletRequest) ServiceContext .getContextRequest(); if (request == null) { throw new IllegalStateException( "Attempt to access HttpSession outside the request scope."); } return request.getSession(create); } }
/** * Returns the object identifier for the request. */ public String getObjectId() { return ServiceContext.getObjectId(); }
/** * Returns the service identifier for the request. */ public String getServiceName() { return ServiceContext.getServiceName(); }
/** * Returns the servlet request object for the request. */ public ServletRequest getRequest() { return ServiceContext.getRequest(); }
/** * Gets a header from the context. */ public static Object getContextHeader(String header) { ServiceContext context = (ServiceContext) _localContext.get(); if (context != null) return context.getHeader(header); else return null; }