org.apache.geronimo.tomcat
Class ConnectorGBean

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

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

Version:
$Rev: 406019 $ $Date: 2006-05-13 08:08:10 +0200 (Sat, 13 May 2006) $

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.
 int getBufferSizeBytes()
          Gets the size of the buffer used to handle network data for this connector.
 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()
           
 int getPort()
          Gets the network port that this connector listens on.
 String getProtocol()
          Gets the network protocol that this connector handles.
 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.
 int getSocketBuffer()
           
 boolean getUseBodyEncodingForURI()
           
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 setBufferSizeBytes(int bytes)
          Gets the size of the buffer used to handle network data for this connector.
 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 setPort(int port)
          Sets the network port that this connector listens on.
 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 setSocketBuffer(int kbytes)
           
 void setTcpNoDelay(boolean enable)
          Sets whether the TCP_NODELAY flag is set for the sockets used by this connector.
 void setUploadTimeoutEnabled(boolean enabled)
           
 void setUseBodyEncodingForURI(boolean enabled)
           
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
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

getGBeanInfo

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


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.