jrun.servlet.jrpp
Class ProxyEndpoint

jrun.servlet.ServletConnection
  |
  +--jrun.servlet.jrpp.ProxyEndpoint
All Implemented Interfaces:
HttpConstants, JRunProxyProtocol, ProxyEndPointInterface, java.lang.Runnable

public final class ProxyEndpoint
extends ServletConnection
implements java.lang.Runnable, JRunProxyProtocol, ProxyEndPointInterface


Field Summary
static java.lang.String PATH_INFO
           
static int PATH_INFO_HASH
           
static java.lang.String PATH_TRANSLATED
           
static int PATH_TRANSLATED_HASH
           
static java.lang.String QUERY_STRING
           
static int QUERY_STRING_HASH
           
static java.lang.String REMOTE_ADDRESS
           
static int REMOTE_ADDRESS_HASH
           
static java.lang.String REMOTE_HOST
           
static int REMOTE_HOST_HASH
           
static java.lang.String REMOTE_USER
           
static int REMOTE_USER_HASH
           
static java.lang.String REQUEST_METHOD
           
static int REQUEST_METHOD_HASH
           
static java.lang.String REQUEST_URI
           
static int REQUEST_URI_HASH
           
static java.lang.String SCRIPT_NAME
           
static int SCRIPT_NAME_HASH
           
static java.lang.String SERVER_NAME
           
static int SERVER_NAME_HASH
           
static java.lang.String SERVER_PORT
           
static int SERVER_PORT_HASH
           
static java.lang.String SERVER_PORT_SECURE
           
static int SERVER_PORT_SECURE_HASH
           
static java.lang.String SERVER_PROTOCOL
           
static int SERVER_PROTOCOL_HASH
           
 
Fields inherited from class jrun.servlet.ServletConnection
bytesIn, bytesOut, committed, headersIn, headersOut, metrics
 
Fields inherited from interface jrun.servlet.jrpp.JRunProxyProtocol
PROXY_BUSY, PROXY_DESTROYALL, PROXY_DESTROYALL_QUIT, PROXY_FINISH, PROXY_GET_ATTRIBUTE, PROXY_GET_DATA, PROXY_GET_HEADER, PROXY_GET_POSTDATA, PROXY_GET_PROPS, PROXY_GET_REALPATH, PROXY_MAP, PROXY_MAP_CHECK, PROXY_PING, PROXY_PUT_CLIENT, PROXY_PUT_CLUSTER_SEQ, PROXY_PUT_DATA, PROXY_PUT_HEADER, PROXY_PUT_HEADER_VALUE, PROXY_PUT_LOAD_VALUE, PROXY_PUT_MORE_DATA, PROXY_PUT_PROPS, PROXY_PUT_STATUS, PROXY_SERVICE, PROXY_SERVICE_30, PROXY_SERVICE_40, PROXY_SET_ATTRIBUTE, PROXY_SET_AUTH_TYPE, PROXY_SET_HEADER, PROXY_SET_JRUN_TARGET, PROXY_SET_JSESSIONID, PROXY_SET_PATH_INFO, PROXY_SET_PATH_TRANSLATED, PROXY_SET_QUERY_STRING, PROXY_SET_REMOTE_ADDRESS, PROXY_SET_REMOTE_HOST, PROXY_SET_REMOTE_USER, PROXY_SET_REQUEST_METHOD, PROXY_SET_REQUEST_URI, PROXY_SET_SCRIPT_NAME, PROXY_SET_SECURE, PROXY_SET_SERVER_NAME, PROXY_SET_SERVER_PORT, PROXY_SET_SERVER_PROTOCOL
 
Fields inherited from interface jrun.servlet.HttpConstants
ACCEPT_CHARSET, ACCEPT_LANGUAGE, CACHE_CONTROL, CONNECTION, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_TYPE, COOKIE, DATE, EXPIRES, HOST, LOCATION, SERVER, SET_COOKIE
 
Method Summary
 void close()
          called at the end of a request by response.finish() or just before closing output streams by out.close() The proxy protocol never closes the socket connection at this point, we just send a FINISH to let the native connector know we're done with the request.
 void closeInputStream()
          closing the input stream does not close the socket
 javax.servlet.ServletOutputStream commit()
           
 void flushBuffer()
           
 java.lang.String getAuthType()
           
 int getBufferSize()
           
 java.lang.String getHeader(java.lang.String name)
          Get the header value from the set of headers we received on the initial request.
 java.util.Enumeration getHeaderNames()
           
 java.util.Enumeration getHeaders(java.lang.String name)
           
 java.lang.String getMethod()
           
 javax.servlet.ServletOutputStream getOutputStream()
           
 java.lang.String getProtocol()
           
 java.lang.String getQueryString()
           
 java.lang.String getRealPath(java.lang.String path)
          Returns corresponding real path for specified virtual path.
 java.lang.String getRemoteAddr()
           
 java.lang.String getRemoteHost()
           
 java.lang.String getRemoteUser()
           
 java.lang.String getRequestURI()
           
 java.lang.String getScheme()
           
 java.lang.String getServerName()
           
 int getServerPort()
           
 java.lang.String getSessionId()
           
 boolean isSecure()
           
protected  void parseHeaders(java.lang.String header)
          parse a JRun 2.3 style connector request.
protected  void proxyGetProps()
          service the PROXY_GET_PROPS command
protected  void readRequest()
          get a new request object over the proxy connection.
 void resetBuffer()
           
 void run()
           
 void setBufferSize(int size)
           
 void setServerLoad()
           
 void writeHeader(java.lang.String name, java.lang.String value)
           
 void writeStatus(int status, java.lang.String reason)
           
 
Methods inherited from class jrun.servlet.ServletConnection
addCookie, addDateHeader, addHeader, addIntHeader, commitHeaders, containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, formatDateHeader, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getContextPath, getCookies, getCurrent, getDateHeader, getIn, getInputStream, getIntHeader, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getPathInfo, getPathTranslated, getReader, getRequestDispatcher, getRequestedSessionId, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, getWriter, isCommitted, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole, reason, removeAttribute, reset, sendError, sendError, sendRedirect, setAttribute, setCharacterEncoding, setContentLength, setContentType, setDateHeader, setHeader, setInputStream, setIntHeader, setLocale, setStatus, setStatus
 

Field Detail

PATH_INFO

public static final java.lang.String PATH_INFO

PATH_TRANSLATED

public static final java.lang.String PATH_TRANSLATED

QUERY_STRING

public static final java.lang.String QUERY_STRING

REMOTE_HOST

public static final java.lang.String REMOTE_HOST

REMOTE_USER

public static final java.lang.String REMOTE_USER

REMOTE_ADDRESS

public static final java.lang.String REMOTE_ADDRESS

REQUEST_METHOD

public static final java.lang.String REQUEST_METHOD

REQUEST_URI

public static final java.lang.String REQUEST_URI

SCRIPT_NAME

public static final java.lang.String SCRIPT_NAME

SERVER_NAME

public static final java.lang.String SERVER_NAME

SERVER_PORT

public static final java.lang.String SERVER_PORT

SERVER_PORT_SECURE

public static final java.lang.String SERVER_PORT_SECURE

SERVER_PROTOCOL

public static final java.lang.String SERVER_PROTOCOL

PATH_INFO_HASH

public static final int PATH_INFO_HASH

PATH_TRANSLATED_HASH

public static final int PATH_TRANSLATED_HASH

QUERY_STRING_HASH

public static final int QUERY_STRING_HASH

REMOTE_HOST_HASH

public static final int REMOTE_HOST_HASH

REMOTE_USER_HASH

public static final int REMOTE_USER_HASH

REMOTE_ADDRESS_HASH

public static final int REMOTE_ADDRESS_HASH

REQUEST_METHOD_HASH

public static final int REQUEST_METHOD_HASH

REQUEST_URI_HASH

public static final int REQUEST_URI_HASH

SCRIPT_NAME_HASH

public static final int SCRIPT_NAME_HASH

SERVER_NAME_HASH

public static final int SERVER_NAME_HASH

SERVER_PORT_HASH

public static final int SERVER_PORT_HASH

SERVER_PORT_SECURE_HASH

public static final int SERVER_PORT_SECURE_HASH

SERVER_PROTOCOL_HASH

public static final int SERVER_PROTOCOL_HASH
Method Detail

closeInputStream

public void closeInputStream()
                      throws java.io.IOException
closing the input stream does not close the socket
Overrides:
closeInputStream in class ServletConnection

close

public void close()
           throws java.io.IOException
called at the end of a request by response.finish() or just before closing output streams by out.close() The proxy protocol never closes the socket connection at this point, we just send a FINISH to let the native connector know we're done with the request.

readRequest

protected void readRequest()
                    throws java.io.IOException
get a new request object over the proxy connection. This method does not return until a new request is received, but in the mean time it processes any proxy-level commands, such as PROXY_PING and PROXY_GET_PROPS
Overrides:
readRequest in class ServletConnection

proxyGetProps

protected void proxyGetProps()
                      throws java.io.IOException
service the PROXY_GET_PROPS command

getRealPath

public java.lang.String getRealPath(java.lang.String path)
Returns corresponding real path for specified virtual path. Values are cached. The cache is local to this endpoint, so it can return values specific to the webserver we're connected to.
Overrides:
getRealPath in class ServletConnection

getSessionId

public java.lang.String getSessionId()
Specified by:
getSessionId in interface ProxyEndPointInterface

setServerLoad

public void setServerLoad()

run

public final void run()
Specified by:
run in interface java.lang.Runnable

writeStatus

public void writeStatus(int status,
                        java.lang.String reason)
                 throws java.io.IOException
Overrides:
writeStatus in class ServletConnection

writeHeader

public void writeHeader(java.lang.String name,
                        java.lang.String value)
                 throws java.io.IOException
Overrides:
writeHeader in class ServletConnection

commit

public javax.servlet.ServletOutputStream commit()
                                         throws java.io.IOException

getHeader

public java.lang.String getHeader(java.lang.String name)
Get the header value from the set of headers we received on the initial request. If the header value is not found, go back to the web server and ask for it. If we get it this way, store it in the extraHeaders table so we don't get CGI headers and HTTP headers mixed up. This is mainly for spec conformance.
Overrides:
getHeader in class ServletConnection

getHeaders

public java.util.Enumeration getHeaders(java.lang.String name)
Overrides:
getHeaders in class ServletConnection

getHeaderNames

public java.util.Enumeration getHeaderNames()
Overrides:
getHeaderNames in class ServletConnection

parseHeaders

protected void parseHeaders(java.lang.String header)
parse a JRun 2.3 style connector request. In this case, the header comes accross as a single string, and we must parse everything apart manually

getRemoteAddr

public java.lang.String getRemoteAddr()
Overrides:
getRemoteAddr in class ServletConnection

getRemoteHost

public java.lang.String getRemoteHost()
Overrides:
getRemoteHost in class ServletConnection

getServerName

public java.lang.String getServerName()
Overrides:
getServerName in class ServletConnection

getServerPort

public int getServerPort()
Overrides:
getServerPort in class ServletConnection

getRequestURI

public java.lang.String getRequestURI()
Overrides:
getRequestURI in class ServletConnection

getQueryString

public java.lang.String getQueryString()
Overrides:
getQueryString in class ServletConnection

getMethod

public java.lang.String getMethod()
Overrides:
getMethod in class ServletConnection

getProtocol

public java.lang.String getProtocol()
Overrides:
getProtocol in class ServletConnection

isSecure

public boolean isSecure()
Overrides:
isSecure in class ServletConnection

getRemoteUser

public java.lang.String getRemoteUser()
Overrides:
getRemoteUser in class ServletConnection

getAuthType

public java.lang.String getAuthType()
Overrides:
getAuthType in class ServletConnection

getScheme

public java.lang.String getScheme()
Overrides:
getScheme in class ServletConnection

flushBuffer

public void flushBuffer()
                 throws java.io.IOException
Overrides:
flushBuffer in class ServletConnection

getBufferSize

public int getBufferSize()
Overrides:
getBufferSize in class ServletConnection

getOutputStream

public javax.servlet.ServletOutputStream getOutputStream()
                                                  throws java.io.IOException
Overrides:
getOutputStream in class ServletConnection

resetBuffer

public void resetBuffer()
Overrides:
resetBuffer in class ServletConnection

setBufferSize

public void setBufferSize(int size)
Overrides:
setBufferSize in class ServletConnection


Copyright � 2002 Macromedia Corporation. All Rights Reserved.