org.apache.geronimo.tomcat
Class ConnectorGBean

java.lang.Object
  extended by org.apache.geronimo.tomcat.BaseGBean
      extended by org.apache.geronimo.tomcat.ConnectorGBean
All Implemented Interfaces:
org.apache.geronimo.gbean.GBeanLifecycle, org.apache.geronimo.management.geronimo.NetworkConnector, org.apache.geronimo.management.geronimo.WebConnector, ObjectRetriever, TomcatWebConnector
Direct Known Subclasses:
HttpsConnectorGBean

public class ConnectorGBean
extends BaseGBean
implements org.apache.geronimo.gbean.GBeanLifecycle, ObjectRetriever, TomcatWebConnector


Field Summary
protected  org.apache.catalina.connector.Connector connector
           
static String CONNECTOR_CONTAINER_REFERENCE
           
static org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
           
 
Constructor Summary
ConnectorGBean(String name, String protocol, String host, int port, TomcatContainer container)
           
 
Method Summary
 void doFail()
           
 void doStart()
           
 void doStop()
           
 int getAcceptQueueSize()
          Gets the maximum number of connections that may be queued while all threads are busy.
 boolean getAllowTrace()
           
 int getBufferSizeBytes()
          Gets the size of the buffer used to handle network data for this connector.
 String getCompressableMimeType()
           
 String getCompression()
           
 int getConnectionTimeoutMillis()
           
 String getConnectUrl()
           
 int getDefaultPort()
           
static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()
           
 String getHost()
          Gets the hostname/IP that this connector listens on.
 Object getInternalObject()
           
 int getLingerMillis()
          Gets the amount of time the socket used by this connector will linger after being closed
 InetSocketAddress getListenAddress()
          Every connector must specify a property of type InetSocketAddress because we use that to identify the network services to print a list during startup.
 int getMaxHttpHeaderSizeBytes()
           
 int getMaxKeepAliveRequests()
           
 int getMaxPostSize()
           
 int getMaxSavePostSize()
           
 int getMaxSpareThreads()
           
 int getMaxThreads()
          Gets the maximum number of threads used to service connections from this connector.
 int getMinSpareThreads()
           
 String getName()
           
 String getNoCompressionUserAgents()
           
 int getPort()
          Gets the network port that this connector listens on.
 String getProtocol()
          Gets the network protocol that this connector handles.
 String getProxyName()
           
 int getProxyPort()
           
 int getRedirectPort()
          Gets the network port to which traffic will be redirected if this connector handles insecure traffic and the request requires a secure connection.
 String getRestrictedUserAgents()
           
 String getScheme()
           
 String getServer()
           
 int getSocketBuffer()
           
 String getStrategy()
           
 int getThreadPriority()
           
 String getUriEncoding()
           
 boolean getUseBodyEncodingForURI()
           
 boolean getUseIPVHosts()
           
 boolean getXpoweredBy()
           
protected  void initializeParams(String protocol, Map params)
          Adds any special parameters before constructing the connector.
 boolean isEmptySessionPath()
           
 boolean isHostLookupEnabled()
           
 boolean isTcpNoDelay()
          Gets whether the TCP_NODELAY flag is set for the sockets used by this connector.
 boolean isUploadTimeoutEnabled()
           
 void setAcceptQueueSize(int size)
          Sets the maximum number of connections that may be queued while all threads are busy.
 void setAllowTrace(boolean allow)
           
 void setBufferSizeBytes(int bytes)
          Gets the size of the buffer used to handle network data for this connector.
 void setCompressableMimeType(String compressableMimeType)
           
 void setCompression(String compression)
           
 void setConnectionTimeoutMillis(int millis)
           
 void setEmptySessionPath(boolean emptySessionPath)
           
 void setHost(String host)
          Sets the hostname/IP that this connector listens on.
 void setHostLookupEnabled(boolean enabled)
           
 void setLingerMillis(int millis)
          Sets the amount of time the socket used by this connector will linger after being closed.
 void setMaxHttpHeaderSizeBytes(int bytes)
           
 void setMaxKeepAliveRequests(int maxKeepAliveRequests)
           
 void setMaxPostSize(int bytes)
           
 void setMaxSavePostSize(int kbytes)
           
 void setMaxSpareThreads(int threads)
           
 void setMaxThreads(int threads)
          Sets the maximum number of threads used to service connections from this connector.
 void setMinSpareThreads(int threads)
           
 void setNoCompressionUserAgents(String noCompressionUserAgents)
           
 void setPort(int port)
          Sets the network port that this connector listens on.
 void setProxyName(String proxyName)
           
 void setProxyPort(int port)
           
 void setRedirectPort(int port)
          Gets the network port to which traffic will be redirected if this connector handles insecure traffic and the request requires a secure connection.
 void setRestrictedUserAgents(String restrictedUserAgents)
           
 void setScheme(String scheme)
           
 void setServer(String server)
           
 void setSocketBuffer(int kbytes)
           
 void setStrategy(String strategy)
           
 void setTcpNoDelay(boolean enable)
          Sets whether the TCP_NODELAY flag is set for the sockets used by this connector.
 void setThreadPriority(int threadPriority)
           
 void setUploadTimeoutEnabled(boolean enabled)
           
 void setUriEncoding(String encoding)
           
 void setUseBodyEncodingForURI(boolean enabled)
           
 void setUseIPVHosts(boolean useIPVHosts)
           
 void setXpoweredBy(boolean xpoweredBy)
           
protected  void validateProtocol(String protocol)
          Ensures that this implementation can handle the requested protocol.
 
Methods inherited from class org.apache.geronimo.tomcat.BaseGBean
setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONNECTOR_CONTAINER_REFERENCE

public static final String CONNECTOR_CONTAINER_REFERENCE
See Also:
Constant Field Values

connector

protected final org.apache.catalina.connector.Connector connector

GBEAN_INFO

public static final org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
Constructor Detail

ConnectorGBean

public ConnectorGBean(String name,
                      String protocol,
                      String host,
                      int port,
                      TomcatContainer container)
               throws Exception
Throws:
Exception
Method Detail

initializeParams

protected void initializeParams(String protocol,
                                Map params)
Adds any special parameters before constructing the connector. Note: all keys and values must be Strings.

Parameters:
protocol - Should be one of the constants from WebContainer.
params - The map of parameters that will be used to initialize the connector.

validateProtocol

protected void validateProtocol(String protocol)
Ensures that this implementation can handle the requested protocol.

Parameters:
protocol -

getName

public String getName()

getInternalObject

public Object getInternalObject()
Specified by:
getInternalObject in interface ObjectRetriever

doStart

public void doStart()
             throws org.apache.catalina.LifecycleException
Specified by:
doStart in interface org.apache.geronimo.gbean.GBeanLifecycle
Throws:
org.apache.catalina.LifecycleException

doStop

public void doStop()
Specified by:
doStop in interface org.apache.geronimo.gbean.GBeanLifecycle

doFail

public void doFail()
Specified by:
doFail in interface org.apache.geronimo.gbean.GBeanLifecycle

getDefaultPort

public int getDefaultPort()

getConnectUrl

public String getConnectUrl()
Specified by:
getConnectUrl in interface org.apache.geronimo.management.geronimo.WebConnector

isEmptySessionPath

public boolean isEmptySessionPath()
Specified by:
isEmptySessionPath in interface TomcatWebConnector

setEmptySessionPath

public void setEmptySessionPath(boolean emptySessionPath)
Specified by:
setEmptySessionPath in interface TomcatWebConnector

getProtocol

public String getProtocol()
Gets the network protocol that this connector handles.

Specified by:
getProtocol in interface org.apache.geronimo.management.geronimo.NetworkConnector

getPort

public int getPort()
Gets the network port that this connector listens on.

Specified by:
getPort in interface org.apache.geronimo.management.geronimo.NetworkConnector

setPort

public void setPort(int port)
Sets the network port that this connector listens on.

Specified by:
setPort in interface org.apache.geronimo.management.geronimo.NetworkConnector

getHost

public String getHost()
Gets the hostname/IP that this connector listens on.

Specified by:
getHost in interface org.apache.geronimo.management.geronimo.NetworkConnector

setHost

public void setHost(String host)
             throws UnknownHostException
Sets the hostname/IP that this connector listens on. This is typically most useful for machines with multiple network cards, but can be used to limit a connector to only listen for connections from the local machine (127.0.0.1). To listen on all available network interfaces, specify an address of 0.0.0.0.

Specified by:
setHost in interface org.apache.geronimo.management.geronimo.NetworkConnector
Throws:
UnknownHostException

getListenAddress

public InetSocketAddress getListenAddress()
Every connector must specify a property of type InetSocketAddress because we use that to identify the network services to print a list during startup. However, this can be read-only since the host and port are set separately using setHost and setPort.

Specified by:
getListenAddress in interface org.apache.geronimo.management.geronimo.NetworkConnector

getBufferSizeBytes

public int getBufferSizeBytes()
Gets the size of the buffer used to handle network data for this connector.

Specified by:
getBufferSizeBytes in interface org.apache.geronimo.management.geronimo.WebConnector

setBufferSizeBytes

public void setBufferSizeBytes(int bytes)
Gets the size of the buffer used to handle network data for this connector.

Specified by:
setBufferSizeBytes in interface org.apache.geronimo.management.geronimo.WebConnector

getMaxThreads

public int getMaxThreads()
Gets the maximum number of threads used to service connections from this connector.

Specified by:
getMaxThreads in interface org.apache.geronimo.management.geronimo.WebConnector

setMaxThreads

public void setMaxThreads(int threads)
Sets the maximum number of threads used to service connections from this connector.

Specified by:
setMaxThreads in interface org.apache.geronimo.management.geronimo.WebConnector

getAcceptQueueSize

public int getAcceptQueueSize()
Gets the maximum number of connections that may be queued while all threads are busy. Any requests received while the queue is full will be rejected.

Specified by:
getAcceptQueueSize in interface org.apache.geronimo.management.geronimo.WebConnector

setAcceptQueueSize

public void setAcceptQueueSize(int size)
Sets the maximum number of connections that may be queued while all threads are busy. Any requests received while the queue is full will be rejected.

Specified by:
setAcceptQueueSize in interface org.apache.geronimo.management.geronimo.WebConnector

getLingerMillis

public int getLingerMillis()
Gets the amount of time the socket used by this connector will linger after being closed. -1 indicates that socket linger is disabled.

Specified by:
getLingerMillis in interface org.apache.geronimo.management.geronimo.WebConnector

setLingerMillis

public void setLingerMillis(int millis)
Sets the amount of time the socket used by this connector will linger after being closed. Use -1 to disable socket linger.

Specified by:
setLingerMillis in interface org.apache.geronimo.management.geronimo.WebConnector

isTcpNoDelay

public boolean isTcpNoDelay()
Gets whether the TCP_NODELAY flag is set for the sockets used by this connector. This usually enhances performance, so it should typically be set.

Specified by:
isTcpNoDelay in interface org.apache.geronimo.management.geronimo.WebConnector

setTcpNoDelay

public void setTcpNoDelay(boolean enable)
Sets whether the TCP_NODELAY flag is set for the sockets used by this connector. This usually enhances performance, so it should typically be set.

Specified by:
setTcpNoDelay in interface org.apache.geronimo.management.geronimo.WebConnector

getRedirectPort

public int getRedirectPort()
Gets the network port to which traffic will be redirected if this connector handles insecure traffic and the request requires a secure connection. Needless to say, this should point to another connector configured for SSL.

Specified by:
getRedirectPort in interface org.apache.geronimo.management.geronimo.WebConnector

setRedirectPort

public void setRedirectPort(int port)
Gets the network port to which traffic will be redirected if this connector handles insecure traffic and the request requires a secure connection. Needless to say, this should point to another connector configured for SSL. If no SSL connector is available, any port can be used as they all fail equally well. :)

Specified by:
setRedirectPort in interface org.apache.geronimo.management.geronimo.WebConnector

getMinSpareThreads

public int getMinSpareThreads()
Specified by:
getMinSpareThreads in interface TomcatWebConnector

setMinSpareThreads

public void setMinSpareThreads(int threads)
Specified by:
setMinSpareThreads in interface TomcatWebConnector

getMaxSpareThreads

public int getMaxSpareThreads()
Specified by:
getMaxSpareThreads in interface TomcatWebConnector

setMaxSpareThreads

public void setMaxSpareThreads(int threads)
Specified by:
setMaxSpareThreads in interface TomcatWebConnector

getMaxHttpHeaderSizeBytes

public int getMaxHttpHeaderSizeBytes()
Specified by:
getMaxHttpHeaderSizeBytes in interface TomcatWebConnector

setMaxHttpHeaderSizeBytes

public void setMaxHttpHeaderSizeBytes(int bytes)
Specified by:
setMaxHttpHeaderSizeBytes in interface TomcatWebConnector

isHostLookupEnabled

public boolean isHostLookupEnabled()
Specified by:
isHostLookupEnabled in interface TomcatWebConnector

setHostLookupEnabled

public void setHostLookupEnabled(boolean enabled)
Specified by:
setHostLookupEnabled in interface TomcatWebConnector

getConnectionTimeoutMillis

public int getConnectionTimeoutMillis()
Specified by:
getConnectionTimeoutMillis in interface TomcatWebConnector

setConnectionTimeoutMillis

public void setConnectionTimeoutMillis(int millis)
Specified by:
setConnectionTimeoutMillis in interface TomcatWebConnector

isUploadTimeoutEnabled

public boolean isUploadTimeoutEnabled()
Specified by:
isUploadTimeoutEnabled in interface TomcatWebConnector

setUploadTimeoutEnabled

public void setUploadTimeoutEnabled(boolean enabled)
Specified by:
setUploadTimeoutEnabled in interface TomcatWebConnector

getMaxPostSize

public int getMaxPostSize()
Specified by:
getMaxPostSize in interface TomcatWebConnector

setMaxPostSize

public void setMaxPostSize(int bytes)
Specified by:
setMaxPostSize in interface TomcatWebConnector

getMaxSavePostSize

public int getMaxSavePostSize()
Specified by:
getMaxSavePostSize in interface TomcatWebConnector

setMaxSavePostSize

public void setMaxSavePostSize(int kbytes)
Specified by:
setMaxSavePostSize in interface TomcatWebConnector

getMaxKeepAliveRequests

public int getMaxKeepAliveRequests()
Specified by:
getMaxKeepAliveRequests in interface TomcatWebConnector

setMaxKeepAliveRequests

public void setMaxKeepAliveRequests(int maxKeepAliveRequests)
Specified by:
setMaxKeepAliveRequests in interface TomcatWebConnector

getSocketBuffer

public int getSocketBuffer()
Specified by:
getSocketBuffer in interface TomcatWebConnector

setSocketBuffer

public void setSocketBuffer(int kbytes)
Specified by:
setSocketBuffer in interface TomcatWebConnector

getUseBodyEncodingForURI

public boolean getUseBodyEncodingForURI()
Specified by:
getUseBodyEncodingForURI in interface TomcatWebConnector

setUseBodyEncodingForURI

public void setUseBodyEncodingForURI(boolean enabled)
Specified by:
setUseBodyEncodingForURI in interface TomcatWebConnector

setAllowTrace

public void setAllowTrace(boolean allow)
Specified by:
setAllowTrace in interface TomcatWebConnector

getAllowTrace

public boolean getAllowTrace()
Specified by:
getAllowTrace in interface TomcatWebConnector

setProxyName

public void setProxyName(String proxyName)
Specified by:
setProxyName in interface TomcatWebConnector

getProxyName

public String getProxyName()
Specified by:
getProxyName in interface TomcatWebConnector

setProxyPort

public void setProxyPort(int port)
Specified by:
setProxyPort in interface TomcatWebConnector

getProxyPort

public int getProxyPort()
Specified by:
getProxyPort in interface TomcatWebConnector

setScheme

public void setScheme(String scheme)
Specified by:
setScheme in interface TomcatWebConnector

getScheme

public String getScheme()
Specified by:
getScheme in interface TomcatWebConnector

setUriEncoding

public void setUriEncoding(String encoding)
Specified by:
setUriEncoding in interface TomcatWebConnector

getUriEncoding

public String getUriEncoding()
Specified by:
getUriEncoding in interface TomcatWebConnector

setUseIPVHosts

public void setUseIPVHosts(boolean useIPVHosts)
Specified by:
setUseIPVHosts in interface TomcatWebConnector

getUseIPVHosts

public boolean getUseIPVHosts()
Specified by:
getUseIPVHosts in interface TomcatWebConnector

setXpoweredBy

public void setXpoweredBy(boolean xpoweredBy)
Specified by:
setXpoweredBy in interface TomcatWebConnector

getXpoweredBy

public boolean getXpoweredBy()
Specified by:
getXpoweredBy in interface TomcatWebConnector

setCompressableMimeType

public void setCompressableMimeType(String compressableMimeType)
Specified by:
setCompressableMimeType in interface TomcatWebConnector

getCompressableMimeType

public String getCompressableMimeType()
Specified by:
getCompressableMimeType in interface TomcatWebConnector

setCompression

public void setCompression(String compression)
Specified by:
setCompression in interface TomcatWebConnector

getCompression

public String getCompression()
Specified by:
getCompression in interface TomcatWebConnector

setNoCompressionUserAgents

public void setNoCompressionUserAgents(String noCompressionUserAgents)
Specified by:
setNoCompressionUserAgents in interface TomcatWebConnector

getNoCompressionUserAgents

public String getNoCompressionUserAgents()
Specified by:
getNoCompressionUserAgents in interface TomcatWebConnector

setRestrictedUserAgents

public void setRestrictedUserAgents(String restrictedUserAgents)
Specified by:
setRestrictedUserAgents in interface TomcatWebConnector

getRestrictedUserAgents

public String getRestrictedUserAgents()
Specified by:
getRestrictedUserAgents in interface TomcatWebConnector

setThreadPriority

public void setThreadPriority(int threadPriority)
Specified by:
setThreadPriority in interface TomcatWebConnector

getThreadPriority

public int getThreadPriority()
Specified by:
getThreadPriority in interface TomcatWebConnector

setServer

public void setServer(String server)
Specified by:
setServer in interface TomcatWebConnector

getServer

public String getServer()
Specified by:
getServer in interface TomcatWebConnector

setStrategy

public void setStrategy(String strategy)
Specified by:
setStrategy in interface TomcatWebConnector

getStrategy

public String getStrategy()
Specified by:
getStrategy in interface TomcatWebConnector

getGBeanInfo

public static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()


Copyright © 2006 Apache Software Foundation. All Rights Reserved.