|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.servlet.connectionMethods.StandardConnectionMethod | +--org.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.
StandardConnectionMethod
,
Serialized FormField 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. |
static int |
DEFAULT_CLIENT_TIMEOUT
|
static int |
DEFAULT_NUM_THREADS
|
static int |
DEFAULT_QUEUE_SIZE
|
static int |
DEFAULT_THREAD_TIMEOUT
|
static java.lang.String |
ENHYDRADIRECTOR
|
protected java.lang.ThreadGroup |
handlers
The thread group for EnhydraDirectorHandler threads. |
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 static org.apache.log4j.Logger |
logger
The logging channel. |
protected static org.apache.log4j.Logger |
loggerSys
The logger that logs on System.out. |
protected int |
maxHandlers
The maximum number of EnhydraDirectorHandler threads. |
protected int |
maxQueue
The maximum size of the connection queue. |
static java.lang.String |
NUM_THREADS
|
protected int |
numWaiting
The total number EnhydraDirectorHandler threads (active and waiting). |
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 class org.enhydra.servlet.connectionMethods.StandardConnectionMethod |
channelTable, filterManager, servletManager |
Fields inherited from interface org.enhydra.servlet.connectionMethods.ConnectionMethod |
disabledChannelHtml, errorHtml, noChannelHtml |
Constructor Summary | |
EnhydraDirectorConnectionMethod()
Default constructor used for dynamic connection method creation. |
Method Summary | |
boolean |
channelURLIsValid(java.lang.String channelID)
This connection method returns invalid urls. |
void |
destroy()
Shut down the connection method. |
boolean |
equivalent(ConnectionMethod compareObject)
Compares the port number to determine equivalency |
java.lang.String |
getAuthKey()
Get the authentication key for this connection. |
java.lang.String |
getBindAddress()
Gets the current Bind address, if any. |
Channel |
getChannelByURLPrefix(java.lang.String url)
Gets Channel data associated with a given URL Prefix. |
java.lang.String |
getChannelURL(java.lang.String channelID)
Returns the URL that a user would use to connect to this channel. |
int |
getClientTimeout()
Gets the client timeout associated with this connection method. |
protected java.net.Socket |
getConnection()
Returns an socket from the connection queue. |
protected EnhydraDirectorConnection |
getEnhydraDirectorConnection()
|
int |
getNumThreads()
Gets the maximum number of handler threads associated with this connection method. |
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. |
javax.servlet.Servlet |
getServlet(java.lang.String servletID)
Gets a reference to the servlet associated with servletID. |
boolean |
getSessionAffinity()
getSessionAffinity() and setSessionAffinity(). |
int |
getThreadTimeout()
Gets the thread timeout associated with this connection method. |
java.lang.String |
getType()
|
void |
initialize(Config connectionConfig,
java.lang.String id,
ServletManager servletManager,
FilterManager filterManager)
Start up. |
void |
initialize(java.lang.String id,
ServletManager servletManager,
FilterManager filterManager)
Saves the ServletManager and FilterManager for later use. |
void |
run()
Runs the EnhydraDirectorConnectionMethod. |
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 |
setPort(int port)
|
void |
setPrefixHint(java.lang.String hint)
|
void |
setSessionAffinity(boolean sessionAffinity)
|
void |
writeToConfig(Config connectionConfig,
java.lang.String base)
Write out self into config fie |
Methods inherited from class org.enhydra.servlet.connectionMethods.StandardConnectionMethod |
addChannel, addTransactionFilter, deleteChannel, disableChannel, enableChannel, getChannelIDs, getChannelStatus, getTransactionFilterIDs, getUniqueChannelName, removeTransactionFilter, resetRequestCount |
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 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 static final java.lang.String SERVER_BUSY_MSG
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 static org.apache.log4j.Logger logger
protected static org.apache.log4j.Logger loggerSys
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
Constructor Detail |
public EnhydraDirectorConnectionMethod()
Method Detail |
public void destroy() throws ConnectionMethodException
destroy
in interface ConnectionMethod
destroy
in class StandardConnectionMethod
ConnectionMethodException
- If an error occurs.public void initialize(Config connectionConfig, java.lang.String id, ServletManager servletManager, FilterManager filterManager) throws ConnectionMethodException
initialize
in interface ConnectionMethod
initialize
in class StandardConnectionMethod
connectionConfig
- The portion of the config file relevant to
this connection methodid
- The id associated with this connection methodservletManager
- The ServletManager to use to convert servletIDs
into Servlets.filterManager
- The FilterManager to use to convert filterIDs
into Filters.
ConnectionMethodException
- If unable to start up.Filter
,
org.enhydra.servlet.StandardConnectionMethod
public void initialize(java.lang.String id, ServletManager servletManager, FilterManager filterManager) throws ConnectionMethodException
initialize
in interface ConnectionMethod
initialize
in class StandardConnectionMethod
id
- The id associated with this connection methodservletManager
- The ServletManager to use to convert servletIDs
into Servlets.filterManager
- The FilterManager to use to convert filterIDs
into Filters.
ConnectionMethodException
- If unable to start up.Filter
,
org.enhydra.servlet.StandardConnectionMethod
public void writeToConfig(Config connectionConfig, java.lang.String base) throws ConfigException, KeywordValueException
writeToConfig
in interface ConnectionMethod
writeToConfig
in class StandardConnectionMethod
base
- The connection base key string
ConfigException
KeywordValueException
public void run()
run
in interface java.lang.Runnable
protected EnhydraDirectorConnection getEnhydraDirectorConnection()
protected java.net.Socket getConnection()
public Channel getChannelByURLPrefix(java.lang.String url)
url
- The URL Prefix.
public javax.servlet.Servlet getServlet(java.lang.String servletID)
servletID
- The Servlet ID.
public java.lang.String getChannelURL(java.lang.String channelID) throws ConnectionMethodException
getChannelURL
in interface ConnectionMethod
channelID
- The channel
ConnectionMethodException
- If an error occurs,
for example if the channel does not exist.public boolean channelURLIsValid(java.lang.String channelID) throws ConnectionMethodException
channelURLIsValid
in interface ConnectionMethod
channelID
- The channel
ConnectionMethodException
- If an error occurs,
for example if the channel does not exist.public boolean equivalent(ConnectionMethod compareObject)
equivalent
in interface ConnectionMethod
equivalent
in class StandardConnectionMethod
compareObject
- The object to compare this to
ConnectionMethodException
- If an error occurs.public java.lang.String getType()
getType
in interface ConnectionMethod
getType
in class StandardConnectionMethod
public int getPort()
getPort
in interface ConnectionMethod
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 int getQueueSize()
public int getClientTimeout()
public int getThreadTimeout()
|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |