com.caucho.server.http
Class StubSessionContextRequest

java.lang.Object
  extended by com.caucho.server.http.StubServletRequest
      extended by com.caucho.server.http.StubSessionContextRequest
All Implemented Interfaces:
ProtocolConnection, CauchoRequest, HttpServletRequest, ServletRequest

public class StubSessionContextRequest
extends StubServletRequest
implements ProtocolConnection

Used when there isn't any actual request object, e.g. for calling run-at servlets.


Field Summary
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
StubSessionContextRequest(WebApp webApp, java.lang.String sessionId)
           
 
Method Summary
 java.lang.String getProtocolRequestURL()
          Returns a request URL for debugging/management.
 HttpSession getSession(boolean create)
          Returns a session.
 boolean handleRequest()
          Handles a new request.
 boolean handleResume()
          Handles a resumption of the connection for an async/comet request.
 void init()
          Initialize the connection.
 boolean isWaitForRead()
          Return true if the connection should wait for a read before handling the request.
 void onCloseConnection()
          Handles a close event when the connection is closed.
 void onStartConnection()
          Called when the connection starts, i.e.
 
Methods inherited from class com.caucho.server.http.StubServletRequest
addAsyncListener, addAsyncListener, authenticate, clientDisconnect, getAbstractHttpRequest, getAsyncContext, getAttribute, getAttributeNames, getAuthType, getCharacterEncoding, getContentLength, getContentType, getContextPath, getCookie, getCookies, getDateHeader, getDispatcherType, getHasCookie, getHeader, getHeaderNames, getHeaders, getInputStream, getIntHeader, getLocalAddr, getLocale, getLocales, getLocalHost, getLocalName, getLocalPort, getMemorySession, getMethod, getPageContextPath, getPagePathInfo, getPageQueryString, getPageServletPath, getPageURI, getParameter, getParameterMap, getParameterNames, getParameterValues, getPart, getParts, getPathInfo, getPathTranslated, getProtocol, getQueryString, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRemoteUser, getRequest, getRequestDepth, getRequestDispatcher, getRequestedSessionId, getRequestURI, getRequestURL, getScheme, getServerName, getServerPort, getServletContext, getServletPath, getServletResponse, getSession, getSessionId, getSocketLink, getStream, getUriBuffer, getUriLength, getUserPrincipal, getVaryCookies, getWebApp, hasRequest, initStream, isAsyncStarted, isAsyncSupported, isComet, isConnectionClosed, isDuplex, isLoginRequested, isMultipartEnabled, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isSecure, isSessionIdFromCookie, isSuspend, isSyntheticCacheHeader, isTop, isUserInRole, killKeepalive, login, login, logout, removeAttribute, requestLogin, setAsyncSupported, setAttribute, setCharacterEncoding, setHasCookie, setHeader, setSessionId, setSyntheticCacheHeader, setVaryCookie, startAsync, startAsync, upgradeProtocol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StubSessionContextRequest

public StubSessionContextRequest(WebApp webApp,
                                 java.lang.String sessionId)
Method Detail

getSession

public HttpSession getSession(boolean create)
Description copied from interface: HttpServletRequest
Returns a session. If no session exists and create is true, then create a new session, otherwise return null.

Specified by:
getSession in interface HttpServletRequest
Overrides:
getSession in class StubServletRequest
Parameters:
create - If true, then create a new session if none exists.

getProtocolRequestURL

public java.lang.String getProtocolRequestURL()
Description copied from interface: ProtocolConnection
Returns a request URL for debugging/management.

Specified by:
getProtocolRequestURL in interface ProtocolConnection

handleRequest

public boolean handleRequest()
                      throws java.io.IOException
Description copied from interface: ProtocolConnection
Handles a new request. The controlling TcpServer may call handleRequest again after the connection completes, so the implementation must initialize any variables for each connection.

Specified by:
handleRequest in interface ProtocolConnection
Throws:
java.io.IOException

handleResume

public boolean handleResume()
                     throws java.io.IOException
Description copied from interface: ProtocolConnection
Handles a resumption of the connection for an async/comet request.

Specified by:
handleResume in interface ProtocolConnection
Throws:
java.io.IOException

init

public void init()
Description copied from interface: ProtocolConnection
Initialize the connection. At this point, the current thread is the connection thread.

Specified by:
init in interface ProtocolConnection

isWaitForRead

public boolean isWaitForRead()
Description copied from interface: ProtocolConnection
Return true if the connection should wait for a read before handling the request.

Specified by:
isWaitForRead in interface ProtocolConnection

onCloseConnection

public void onCloseConnection()
Description copied from interface: ProtocolConnection
Handles a close event when the connection is closed.

Specified by:
onCloseConnection in interface ProtocolConnection

onStartConnection

public void onStartConnection()
Description copied from interface: ProtocolConnection
Called when the connection starts, i.e. just after the accept

Specified by:
onStartConnection in interface ProtocolConnection