|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.enhydra.servlet.connectionMethods.EnhydraDirector.EnhydraDirectorConnectionMethod
The Enhydra connection method.
Receives and handles requests using the Enhydra Protocol. The protocol is loosely based on the proposed Apache JServ 2.1 protocol, which uses a packet transmission scheme to allow a more rich set of communcation features between web servers and Enhydra. These features include:
Round robin load balancing.
Persistent connections.
Connection Pools.
Callbacks to the front-end web server.
org.enhydra.servlet.connectionMethods.StandardConnectionMethod
Field Summary | |
static java.lang.String |
AUTH_KEY
|
protected java.lang.String |
authKey
The authentication key for this connection. |
protected int |
backlog
The backlog parameter for the server socket. |
static java.lang.String |
BIND_ADDR
|
protected java.lang.String |
bindAddress
IP address to bind to. |
static java.lang.String |
CLIENT_TIMEOUT
|
protected int |
clientTimeout
The maximum time for a thread to keep a socket connection to the client for. |
protected java.lang.String |
cmType
|
protected CircularQueue |
connections
The queue for incoming connections. |
protected org.apache.catalina.Container |
container
The Container used for processing requests received by this Connector. |
static int |
DEFAULT_CLIENT_TIMEOUT
|
static int |
DEFAULT_NUM_THREADS
|
static int |
DEFAULT_QUEUE_SIZE
|
static int |
DEFAULT_THREAD_TIMEOUT
|
protected java.lang.String |
domain
|
static java.lang.String |
ENHYDRADIRECTOR
|
static java.lang.String |
errorHtml
Return this HTML if an unexpected exception is thrown. |
protected java.lang.ThreadGroup |
handlers
The thread group for EnhydraDirectorHandler threads. |
protected org.apache.catalina.util.LifecycleSupport |
lifecycle
The lifecycle event support for this component. |
protected java.net.ServerSocket |
listenerSocket
The server socket. |
protected java.util.Vector |
liveThreads
A list of references to all EnhydraDirectorHandler threads (active and waiting). |
protected int |
maxHandlers
The maximum number of EnhydraDirectorHandler threads. |
protected int |
maxQueue
The maximum size of the connection queue. |
protected javax.management.MBeanServer |
mserver
|
static java.lang.String |
NUM_THREADS
|
protected int |
numWaiting
The total number EnhydraDirectorHandler threads (active and waiting). |
protected javax.management.ObjectName |
oname
|
protected int |
port
The port number for this connection method instance to bind to. |
static java.lang.String |
PORT
|
static java.lang.String |
PREFIX_HINT
|
protected java.lang.String |
prefixHint
The URL used on the external (i.e. |
static java.lang.String |
QUEUE_SIZE
|
protected static java.lang.String |
SERVER_BUSY_MSG
|
static java.lang.String |
SESSION_AFFINITY
|
protected boolean |
sessionAffinity
The session affinity flag NOTE: This attribute is not settable through the multiserver administration screen. |
static java.lang.String |
THREAD_TIMEOUT
|
protected int |
threadTimeout
The maximum time for an EnhydraDirectorHandler thread to wait for a connection. |
static java.lang.String |
TYPE
|
Fields inherited from interface org.apache.catalina.Lifecycle |
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, START_EVENT, STOP_EVENT |
Constructor Summary | |
EnhydraDirectorConnectionMethod()
|
Method Summary | |
void |
addLifecycleListener(org.apache.catalina.LifecycleListener listener)
Add a lifecycle event listener to this component. |
org.apache.catalina.Request |
createRequest()
Create (or allocate) and return a Request object suitable for specifying the contents of a Request to the responsible Container. |
org.apache.catalina.Response |
createResponse()
Create (or allocate) and return a Response object suitable for receiving the contents of a Response from the responsible Container. |
void |
destroy()
Shut down the connection method. |
boolean |
equivalent(EnhydraDirectorConnectionMethod compareObject)
Compares the port number to determine equivalency |
org.apache.catalina.LifecycleListener[] |
findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle. |
java.lang.String |
getAddress()
Return the bind IP address for this Connector. |
java.lang.String |
getAuthKey()
Get the authentication key for this connection. |
java.lang.String |
getBindAddress()
Gets the current Bind address, if any. |
int |
getClientTimeout()
Gets the client timeout associated with this connection method. |
protected java.net.Socket |
getConnection()
Returns an socket from the connection queue. |
org.apache.catalina.Container |
getContainer()
Return the Container used for processing requests received by this Connector. |
boolean |
getDebug()
|
java.lang.String |
getDomain()
|
boolean |
getEnableLookups()
Return the "enable DNS lookups" flag. |
protected EnhydraDirectorConnection |
getEnhydraDirectorConnection()
|
org.apache.catalina.net.ServerSocketFactory |
getFactory()
Return the server socket factory used by this Container. |
java.lang.String |
getInfo()
Return descriptive information about this Connector implementation. |
org.apache.tomcat.util.http.mapper.Mapper |
getMapper()
Return the mapper. |
org.apache.coyote.tomcat5.MapperListener |
getMapperListener()
Return the mapper. |
int |
getNumThreads()
Gets the maximum number of handler threads associated with this connection method. |
javax.management.ObjectName |
getObjectName()
|
int |
getPort()
Gets the port associated with this connection method. |
java.lang.String |
getPrefixHint()
getPrefixHint() and setPrefixHint(). |
int |
getQueueSize()
Gets the maximum queue size associated with this connection method. |
int |
getRedirectPort()
Return the port number to which a request should be redirected if it comes in on a non-SSL port and is subject to a security constraint with a transport guarantee that requires SSL. |
java.lang.String |
getScheme()
Return the scheme that will be assigned to requests received through this connector. |
boolean |
getSecure()
Return the secure connection flag that will be assigned to requests received through this connector. |
org.apache.catalina.Service |
getService()
Returns the Service with which we are associated. |
boolean |
getSessionAffinity()
getSessionAffinity() and setSessionAffinity(). |
int |
getThreadTimeout()
Gets the thread timeout associated with this connection method. |
void |
initialize()
|
void |
pause()
|
void |
postDeregister()
|
void |
postRegister(java.lang.Boolean registrationDone)
|
void |
preDeregister()
|
javax.management.ObjectName |
preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
|
void |
removeLifecycleListener(org.apache.catalina.LifecycleListener listener)
Remove a lifecycle event listener from this component. |
void |
resume()
|
void |
run()
Runs the EnhydraDirectorConnectionMethod. |
void |
setAddress(java.lang.String address)
Set the bind IP address for this Connector. |
void |
setAuthKey(java.lang.String authKey)
Set the authentication key for this connection. |
void |
setBindAddress(java.lang.String addr)
Sets the current Bind address, if any. |
void |
setClientTimeout(int clientTimeout)
|
void |
setContainer(org.apache.catalina.Container container)
Set the Container used for processing requests received by this Connector. |
void |
setDebug(boolean debug)
|
void |
setEnableLookups(boolean enableLookups)
Set the "enable DNS lookups" flag. |
void |
setFactory(org.apache.catalina.net.ServerSocketFactory factory)
Set the server socket factory used by this Container. |
void |
setNumThreads(int numThreads)
|
void |
setPort(int port)
|
void |
setPrefixHint(java.lang.String hint)
|
void |
setQueueSize(int queueSize)
|
void |
setRedirectPort(int redirectPort)
Set the redirect port number. |
void |
setScheme(java.lang.String scheme)
Set the scheme that will be assigned to requests received through this connector. |
void |
setSecure(boolean secure)
Set the secure connection flag that will be assigned to requests received through this connector. |
void |
setService(org.apache.catalina.Service service)
Set the Service with which we are associated. |
void |
setSessionAffinity(boolean sessionAffinity)
|
void |
setThreadTimeout(int threadTimeout)
|
void |
start()
Begin processing requests via this Connector. |
void |
stop()
Terminate processing requests via this Connector. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String errorHtml
response.sendError(HttpServletResponse.SC_SERVER_ERROR,
ConnectionMethod.errorHtml);
protected static final java.lang.String SERVER_BUSY_MSG
public static final java.lang.String ENHYDRADIRECTOR
public static final java.lang.String TYPE
public static final java.lang.String PORT
public static final java.lang.String BIND_ADDR
public static final java.lang.String PREFIX_HINT
public static final java.lang.String SESSION_AFFINITY
public static final java.lang.String AUTH_KEY
public static final java.lang.String NUM_THREADS
public static final java.lang.String QUEUE_SIZE
public static final java.lang.String THREAD_TIMEOUT
public static final java.lang.String CLIENT_TIMEOUT
public static final int DEFAULT_NUM_THREADS
public static final int DEFAULT_QUEUE_SIZE
public static final int DEFAULT_THREAD_TIMEOUT
public static final int DEFAULT_CLIENT_TIMEOUT
protected java.lang.String cmType
protected int port
protected java.lang.String bindAddress
protected java.lang.String prefixHint
protected boolean sessionAffinity
protected java.lang.String authKey
If null
or an empty string, then no authentication
is required.
protected java.net.ServerSocket listenerSocket
protected CircularQueue connections
protected int maxQueue
protected java.lang.ThreadGroup handlers
protected int maxHandlers
protected int threadTimeout
protected int clientTimeout
protected int backlog
protected int numWaiting
protected java.util.Vector liveThreads
protected org.apache.catalina.Container container
protected org.apache.catalina.util.LifecycleSupport lifecycle
protected java.lang.String domain
protected javax.management.ObjectName oname
protected javax.management.MBeanServer mserver
Constructor Detail |
public EnhydraDirectorConnectionMethod()
Method Detail |
public org.apache.catalina.Service getService()
Service
with which we are associated.
getService
in interface org.apache.catalina.Connector
public void setService(org.apache.catalina.Service service)
Service
with which we are associated.
setService
in interface org.apache.catalina.Connector
public void initialize()
initialize
in interface org.apache.catalina.Connector
public java.lang.String getAddress()
public void setAddress(java.lang.String address)
address
- The bind IP addresspublic void run()
run
in interface java.lang.Runnable
protected EnhydraDirectorConnection getEnhydraDirectorConnection()
protected java.net.Socket getConnection()
public boolean equivalent(EnhydraDirectorConnectionMethod compareObject)
compareObject
- The object to compare this to
ConnectionMethodException
- If an error occurs.public org.apache.tomcat.util.http.mapper.Mapper getMapper()
public org.apache.coyote.tomcat5.MapperListener getMapperListener()
public boolean getDebug()
public void setDebug(boolean debug)
public int getPort()
public void setPort(int port)
public java.lang.String getBindAddress()
public void setBindAddress(java.lang.String addr)
public java.lang.String getPrefixHint()
public void setPrefixHint(java.lang.String hint)
public boolean getSessionAffinity()
public void setSessionAffinity(boolean sessionAffinity)
public java.lang.String getAuthKey()
Returns null
if authentication is not required of
clients.
null
if none.public void setAuthKey(java.lang.String authKey)
Set to null
if authentication with clients is not needed.
We don't allow auth key of all whitespace because it is most likely the result of accidental data entry in an otherwise blank 'key' field.
authKey
- The new authtication key, or null
if
authentication is not needed.public int getNumThreads()
public void setNumThreads(int numThreads)
public int getQueueSize()
public void setQueueSize(int queueSize)
public int getClientTimeout()
public void setClientTimeout(int clientTimeout)
public int getThreadTimeout()
public void setThreadTimeout(int threadTimeout)
public org.apache.catalina.Container getContainer()
getContainer
in interface org.apache.catalina.Connector
public void setContainer(org.apache.catalina.Container container)
setContainer
in interface org.apache.catalina.Connector
container
- The new Container to usepublic boolean getEnableLookups()
getEnableLookups
in interface org.apache.catalina.Connector
public void setEnableLookups(boolean enableLookups)
setEnableLookups
in interface org.apache.catalina.Connector
enableLookups
- The new "enable DNS lookups" flag valuepublic org.apache.catalina.net.ServerSocketFactory getFactory()
getFactory
in interface org.apache.catalina.Connector
public void setFactory(org.apache.catalina.net.ServerSocketFactory factory)
setFactory
in interface org.apache.catalina.Connector
factory
- The new server socket factorypublic java.lang.String getInfo()
getInfo
in interface org.apache.catalina.Connector
public int getRedirectPort()
getRedirectPort
in interface org.apache.catalina.Connector
public void setRedirectPort(int redirectPort)
setRedirectPort
in interface org.apache.catalina.Connector
redirectPort
- The redirect port number (non-SSL to SSL)public java.lang.String getScheme()
getScheme
in interface org.apache.catalina.Connector
public void setScheme(java.lang.String scheme)
setScheme
in interface org.apache.catalina.Connector
scheme
- The new schemepublic boolean getSecure()
getSecure
in interface org.apache.catalina.Connector
public void setSecure(boolean secure)
setSecure
in interface org.apache.catalina.Connector
secure
- The new secure connection flagpublic org.apache.catalina.Request createRequest()
createRequest
in interface org.apache.catalina.Connector
public org.apache.catalina.Response createResponse()
createResponse
in interface org.apache.catalina.Connector
public void addLifecycleListener(org.apache.catalina.LifecycleListener listener)
addLifecycleListener
in interface org.apache.catalina.Lifecycle
listener
- The listener to addpublic org.apache.catalina.LifecycleListener[] findLifecycleListeners()
findLifecycleListeners
in interface org.apache.catalina.Lifecycle
public void removeLifecycleListener(org.apache.catalina.LifecycleListener listener)
removeLifecycleListener
in interface org.apache.catalina.Lifecycle
listener
- The listener to addpublic void start()
start
in interface org.apache.catalina.Lifecycle
org.apache.catalina.LifecycleException
- if a fatal startup error occurspublic void stop() throws org.apache.catalina.LifecycleException
stop
in interface org.apache.catalina.Lifecycle
org.apache.catalina.LifecycleException
- if a fatal shutdown error occurspublic void destroy() throws java.lang.Exception
ConnectionMethodException
- If an error occurs.
java.lang.Exception
public void pause() throws org.apache.catalina.LifecycleException
pause
in interface org.apache.catalina.Connector
org.apache.catalina.LifecycleException
public void resume() throws org.apache.catalina.LifecycleException
resume
in interface org.apache.catalina.Connector
org.apache.catalina.LifecycleException
public javax.management.ObjectName getObjectName()
public java.lang.String getDomain()
public javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name) throws java.lang.Exception
preRegister
in interface javax.management.MBeanRegistration
java.lang.Exception
public void postRegister(java.lang.Boolean registrationDone)
postRegister
in interface javax.management.MBeanRegistration
public void preDeregister() throws java.lang.Exception
preDeregister
in interface javax.management.MBeanRegistration
java.lang.Exception
public void postDeregister()
postDeregister
in interface javax.management.MBeanRegistration
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |