org.enhydra.servlet.connectionMethods.EnhydraDirector
Class DirectorProtocol

java.lang.Object
  extended byorg.enhydra.servlet.connectionMethods.EnhydraDirector.DirectorProtocol
All Implemented Interfaces:
javax.management.MBeanRegistration, org.apache.coyote.ProtocolHandler

public class DirectorProtocol
extends java.lang.Object
implements org.apache.coyote.ProtocolHandler, javax.management.MBeanRegistration

Author:
Milin Radivoj

Field Summary
protected  java.util.Hashtable attributes
           
protected  java.lang.String domain
           
protected  EnhydraDirectorConnectionMethod endPoint
           
protected  javax.management.MBeanServer mserver
           
protected  javax.management.ObjectName oname
           
 
Constructor Summary
DirectorProtocol()
           
 
Method Summary
 void destroy()
           
protected  void findConnector()
           
 org.apache.coyote.Adapter getAdapter()
           
 java.lang.Object getAttribute(java.lang.String key)
           
 java.util.Iterator getAttributeNames()
           
 java.lang.String getAuthKey()
          Get the authentication key for this connection.
 int getBacklog()
           
 java.lang.String getBindAddress()
          Gets the current Bind address, if any.
 int getClientTimeout()
          Gets the client timeout associated with this connection method.
 java.lang.String getDomain()
           
 boolean getEmptySessionPath()
           
 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.
 boolean getRebalanceIfSessionExpired()
           
 boolean getSessionAffinity()
          getSessionAffinity() and setSessionAffinity().
 int getSoTimeout()
           
 boolean getTcpNoDelay()
           
 int getThreadTimeout()
          Gets the thread timeout associated with this connection method.
 java.lang.String getURIEncoding()
           
 boolean getUseBodyEncodingForURI()
           
 void init()
           
 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 resume()
           
 void setAdapter(org.apache.coyote.Adapter adapter)
           
 void setAttribute(java.lang.String name, java.lang.Object value)
           
 void setAuthKey(java.lang.String authKey)
          Set the authentication key for this connection.
 void setBacklog(int i)
           
 void setBindAddress(java.lang.String addr)
          Sets the current Bind address, if any.
 void setClientTimeout(int clientTimeout)
           
 void setEmptySessionPath(boolean value)
           
 void setNumThreads(int numThreads)
           
 void setPort(int port)
           
 void setPrefixHint(java.lang.String hint)
           
 void setQueueSize(int queueSize)
           
 void setRebalanceIfSessionExpired(boolean value)
           
 void setSessionAffinity(boolean sessionAffinity)
           
 void setSoTimeout(int clientTimeout)
           
 void setTcpNoDelay(boolean b)
           
 void setThreadTimeout(int threadTimeout)
           
 void setURIEncoding(java.lang.String enc)
           
 void setUseBodyEncodingForURI(boolean use)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attributes

protected java.util.Hashtable attributes

endPoint

protected EnhydraDirectorConnectionMethod endPoint

domain

protected java.lang.String domain

oname

protected javax.management.ObjectName oname

mserver

protected javax.management.MBeanServer mserver
Constructor Detail

DirectorProtocol

public DirectorProtocol()
Method Detail

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Specified by:
setAttribute in interface org.apache.coyote.ProtocolHandler

getAttribute

public java.lang.Object getAttribute(java.lang.String key)
Specified by:
getAttribute in interface org.apache.coyote.ProtocolHandler

getAttributeNames

public java.util.Iterator getAttributeNames()
Specified by:
getAttributeNames in interface org.apache.coyote.ProtocolHandler

setAdapter

public void setAdapter(org.apache.coyote.Adapter adapter)
Specified by:
setAdapter in interface org.apache.coyote.ProtocolHandler

getAdapter

public org.apache.coyote.Adapter getAdapter()
Specified by:
getAdapter in interface org.apache.coyote.ProtocolHandler

init

public void init()
          throws java.lang.Exception
Specified by:
init in interface org.apache.coyote.ProtocolHandler
Throws:
java.lang.Exception

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface org.apache.coyote.ProtocolHandler
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Throws:
java.lang.Exception

getPort

public int getPort()
Gets the port associated with this connection method.

Returns:
port number.

setPort

public void setPort(int port)

getBindAddress

public java.lang.String getBindAddress()
Gets the current Bind address, if any.


getTcpNoDelay

public boolean getTcpNoDelay()

setTcpNoDelay

public void setTcpNoDelay(boolean b)

getBacklog

public int getBacklog()

setBacklog

public void setBacklog(int i)

getUseBodyEncodingForURI

public boolean getUseBodyEncodingForURI()

setUseBodyEncodingForURI

public void setUseBodyEncodingForURI(boolean use)

getURIEncoding

public java.lang.String getURIEncoding()

setURIEncoding

public void setURIEncoding(java.lang.String enc)

setBindAddress

public void setBindAddress(java.lang.String addr)
Sets the current Bind address, if any.


getPrefixHint

public java.lang.String getPrefixHint()
getPrefixHint() and setPrefixHint().

Returns:
port number.

setPrefixHint

public void setPrefixHint(java.lang.String hint)

getSessionAffinity

public boolean getSessionAffinity()
getSessionAffinity() and setSessionAffinity().

Returns:
session affinity flag

setSessionAffinity

public void setSessionAffinity(boolean sessionAffinity)

getAuthKey

public java.lang.String getAuthKey()
Get the authentication key for this connection.

Returns null if authentication is not required of clients.

Returns:
The authentication Key, or null if none.

setAuthKey

public void setAuthKey(java.lang.String authKey)
Set the authentication key for this connection.

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.

Parameters:
authKey - The new authtication key, or null if authentication is not needed.

getNumThreads

public int getNumThreads()
Gets the maximum number of handler threads associated with this connection method.

Returns:
numThreads.

setNumThreads

public void setNumThreads(int numThreads)

getQueueSize

public int getQueueSize()
Gets the maximum queue size associated with this connection method.

Returns:
queueSize.

setQueueSize

public void setQueueSize(int queueSize)

getClientTimeout

public int getClientTimeout()
Gets the client timeout associated with this connection method.

Returns:
clientTimeout.

setClientTimeout

public void setClientTimeout(int clientTimeout)

getSoTimeout

public int getSoTimeout()

setSoTimeout

public void setSoTimeout(int clientTimeout)

getRebalanceIfSessionExpired

public boolean getRebalanceIfSessionExpired()

setRebalanceIfSessionExpired

public void setRebalanceIfSessionExpired(boolean value)

getEmptySessionPath

public boolean getEmptySessionPath()

setEmptySessionPath

public void setEmptySessionPath(boolean value)

getThreadTimeout

public int getThreadTimeout()
Gets the thread timeout associated with this connection method.

Returns:
threadTimeout.

setThreadTimeout

public void setThreadTimeout(int threadTimeout)

pause

public void pause()
           throws java.lang.Exception
Specified by:
pause in interface org.apache.coyote.ProtocolHandler
Throws:
java.lang.Exception

resume

public void resume()
            throws java.lang.Exception
Specified by:
resume in interface org.apache.coyote.ProtocolHandler
Throws:
java.lang.Exception

destroy

public void destroy()
             throws java.lang.Exception
Specified by:
destroy in interface org.apache.coyote.ProtocolHandler
Throws:
java.lang.Exception

getObjectName

public javax.management.ObjectName getObjectName()

getDomain

public java.lang.String getDomain()

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
                                               javax.management.ObjectName name)
                                        throws java.lang.Exception
Specified by:
preRegister in interface javax.management.MBeanRegistration
Throws:
java.lang.Exception

postRegister

public void postRegister(java.lang.Boolean registrationDone)
Specified by:
postRegister in interface javax.management.MBeanRegistration

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Specified by:
preDeregister in interface javax.management.MBeanRegistration
Throws:
java.lang.Exception

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface javax.management.MBeanRegistration

findConnector

protected void findConnector()