org.apache.ajp.tomcat4

Class Ajp13Connector

Implemented Interfaces:
Connector, Lifecycle, Runnable

public final class Ajp13Connector
extends java.lang.Object
implements Connector, Lifecycle, Runnable

Implementation of an Ajp13 connector.

Version:
$Revision: 1.20 $ $Date: 2004/02/24 08:48:41 $

Author:
Kevin Seguin

Field Summary

protected Container
container
The Container used for processing requests received by this Connector.
protected LifecycleSupport
lifecycle
The lifecycle event support for this component.
protected int
minProcessors
The minimum number of processors to start at initialization time.

Fields inherited from interface org.apache.catalina.Lifecycle

AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, START_EVENT, STOP_EVENT

Method Summary

void
addLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component.
Request
createRequest()
Create (or allocate) and return a Request object suitable for specifying the contents of a Request to the responsible Container.
Response
createResponse()
Create (or allocate) and return a Response object suitable for receiving the contents of a Response from the responsible Container.
LifecycleListener[]
findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle.
int
getAcceptCount()
Return the accept count for this Connector.
String
getAddress()
Return the bind IP address for this Connector.
int
getBufferSize()
Return the input buffer size for this Connector.
int
getConnectionLinger()
Return the connection linger settings for this Connector.
int
getConnectionTimeout()
Return the connection timeout for this Connector.
Container
getContainer()
Return the Container used for processing requests received by this Connector.
int
getCurProcessors()
Return the current number of processors that have been created.
int
getDebug()
Return the debugging detail level for this component.
boolean
getEnableLookups()
Return the "enable DNS lookups" flag.
ServerSocketFactory
getFactory()
Return the server socket factory used by this Container.
String
getInfo()
Return descriptive information about this Connector implementation.
int
getMaxProcessors()
Return the maximum number of processors allowed, or <0 for unlimited.
int
getMinProcessors()
Return the minimum number of processors to start at initialization.
int
getPort()
Return the port number on which we listen for AJP13 requests.
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.
String
getScheme()
Return the scheme that will be assigned to requests received through this connector.
String
getSecret()
boolean
getSecure()
Return the secure connection flag that will be assigned to requests received through this connector.
Service
getService()
Returns the Service with which we are associated.
boolean
getTomcatAuthentication()
Get the value of the tomcatAuthentication flag.
void
initialize()
Invoke a pre-startup initialization.
boolean
isAvailable()
Is this connector available for processing requests?
void
removeLifecycleListener(LifecycleListener listener)
Remove a lifecycle event listener from this component.
void
run()
The background thread that listens for incoming TCP/IP connections and hands them off to an appropriate processor.
void
setAcceptCount(int count)
Set the accept count for this Connector.
void
setAddress(String address)
Set the bind IP address for this Connector.
void
setBufferSize(int bufferSize)
Set the input buffer size for this Connector.
void
setConnectionLinger(int connectionLinger)
Set the connection linger for this Connector.
void
setConnectionTimeout(int connectionTimeout)
Set the connection timeout for this Connector.
void
setContainer(Container container)
Set the Container used for processing requests received by this Connector.
void
setDebug(int debug)
Set the debugging detail level for this component.
void
setEnableLookups(boolean enableLookups)
Set the "enable DNS lookups" flag.
void
setFactory(ServerSocketFactory factory)
Set the server socket factory used by this Container.
void
setMaxProcessors(int maxProcessors)
Set the maximum number of processors allowed, or <0 for unlimited.
void
setMinProcessors(int minProcessors)
Set the minimum number of processors to start at initialization.
void
setPort(int port)
Set the port number on which we listen for AJP13 requests.
void
setRedirectPort(int redirectPort)
Set the redirect port number.
void
setScheme(String scheme)
Set the scheme that will be assigned to requests received through this connector.
void
setSecret(String s)
void
setSecure(boolean secure)
Set the secure connection flag that will be assigned to requests received through this connector.
void
setService(Service service)
Set the Service with which we are associated.
void
setTomcatAuthentication(boolean tomcatAuthentication)
Set the value of the tomcatAuthentication flag.
void
start()
Begin processing requests via this Connector.
void
stop()
Terminate processing requests via this Connector.

Field Details

container

protected Container container
The Container used for processing requests received by this Connector.


lifecycle

protected LifecycleSupport lifecycle
The lifecycle event support for this component.


minProcessors

protected int minProcessors
The minimum number of processors to start at initialization time.

Method Details

addLifecycleListener

public void addLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component.
Specified by:
addLifecycleListener in interface Lifecycle

Parameters:
listener - The listener to add


createRequest

public Request createRequest()
Create (or allocate) and return a Request object suitable for specifying the contents of a Request to the responsible Container.
Specified by:
createRequest in interface Connector


createResponse

public Response createResponse()
Create (or allocate) and return a Response object suitable for receiving the contents of a Response from the responsible Container.
Specified by:
createResponse in interface Connector


findLifecycleListeners

public LifecycleListener[] findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle. If this Lifecycle has no listeners registered, a zero-length array is returned.
Specified by:
findLifecycleListeners in interface Lifecycle


getAcceptCount

public int getAcceptCount()
Return the accept count for this Connector.


getAddress

public String getAddress()
Return the bind IP address for this Connector.


getBufferSize

public int getBufferSize()
Return the input buffer size for this Connector.


getConnectionLinger

public int getConnectionLinger()
Return the connection linger settings for this Connector.


getConnectionTimeout

public int getConnectionTimeout()
Return the connection timeout for this Connector.


getContainer

public Container getContainer()
Return the Container used for processing requests received by this Connector.
Specified by:
getContainer in interface Connector


getCurProcessors

public int getCurProcessors()
Return the current number of processors that have been created.


getDebug

public int getDebug()
Return the debugging detail level for this component.


getEnableLookups

public boolean getEnableLookups()
Return the "enable DNS lookups" flag.
Specified by:
getEnableLookups in interface Connector


getFactory

public ServerSocketFactory getFactory()
Return the server socket factory used by this Container.
Specified by:
getFactory in interface Connector


getInfo

public String getInfo()
Return descriptive information about this Connector implementation.
Specified by:
getInfo in interface Connector


getMaxProcessors

public int getMaxProcessors()
Return the maximum number of processors allowed, or <0 for unlimited.


getMinProcessors

public int getMinProcessors()
Return the minimum number of processors to start at initialization.


getPort

public int getPort()
Return the port number on which we listen for AJP13 requests.


getRedirectPort

public 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.
Specified by:
getRedirectPort in interface Connector


getScheme

public String getScheme()
Return the scheme that will be assigned to requests received through this connector. Default value is "http".
Specified by:
getScheme in interface Connector


getSecret

public String getSecret()


getSecure

public boolean getSecure()
Return the secure connection flag that will be assigned to requests received through this connector. Default value is "false".
Specified by:
getSecure in interface Connector


getService

public Service getService()
Returns the Service with which we are associated.
Specified by:
getService in interface Connector


getTomcatAuthentication

public boolean getTomcatAuthentication()
Get the value of the tomcatAuthentication flag.


initialize

public void initialize()
            throws LifecycleException
Invoke a pre-startup initialization. This is used to allow connectors to bind to restricted ports under Unix operating environments. ServerSocket (we start as root and change user? or I miss something?).
Specified by:
initialize in interface Connector


isAvailable

public boolean isAvailable()
Is this connector available for processing requests?


removeLifecycleListener

public void removeLifecycleListener(LifecycleListener listener)
Remove a lifecycle event listener from this component.
Specified by:
removeLifecycleListener in interface Lifecycle

Parameters:
listener - The listener to add


run

public void run()
The background thread that listens for incoming TCP/IP connections and hands them off to an appropriate processor.


setAcceptCount

public void setAcceptCount(int count)
Set the accept count for this Connector.

Parameters:
count - The new accept count


setAddress

public void setAddress(String address)
Set the bind IP address for this Connector.

Parameters:
address - The bind IP address


setBufferSize

public void setBufferSize(int bufferSize)
Set the input buffer size for this Connector.

Parameters:
bufferSize - The new input buffer size.


setConnectionLinger

public void setConnectionLinger(int connectionLinger)
Set the connection linger for this Connector.

Parameters:
connectionLinger - The new connection linger


setConnectionTimeout

public void setConnectionTimeout(int connectionTimeout)
Set the connection timeout for this Connector.

Parameters:
connectionTimeout - The new connection timeout


setContainer

public void setContainer(Container container)
Set the Container used for processing requests received by this Connector.
Specified by:
setContainer in interface Connector

Parameters:
container - The new Container to use


setDebug

public void setDebug(int debug)
Set the debugging detail level for this component.

Parameters:
debug - The new debugging detail level


setEnableLookups

public void setEnableLookups(boolean enableLookups)
Set the "enable DNS lookups" flag.
Specified by:
setEnableLookups in interface Connector

Parameters:
enableLookups - The new "enable DNS lookups" flag value


setFactory

public void setFactory(ServerSocketFactory factory)
Set the server socket factory used by this Container.
Specified by:
setFactory in interface Connector

Parameters:
factory - The new server socket factory


setMaxProcessors

public void setMaxProcessors(int maxProcessors)
Set the maximum number of processors allowed, or <0 for unlimited.

Parameters:
maxProcessors - The new maximum processors


setMinProcessors

public void setMinProcessors(int minProcessors)
Set the minimum number of processors to start at initialization.

Parameters:
minProcessors - The new minimum processors


setPort

public void setPort(int port)
Set the port number on which we listen for AJP13 requests.

Parameters:
port - The new port number


setRedirectPort

public void setRedirectPort(int redirectPort)
Set the redirect port number.
Specified by:
setRedirectPort in interface Connector

Parameters:
redirectPort - The redirect port number (non-SSL to SSL)


setScheme

public void setScheme(String scheme)
Set the scheme that will be assigned to requests received through this connector.
Specified by:
setScheme in interface Connector

Parameters:
scheme - The new scheme


setSecret

public void setSecret(String s)


setSecure

public void setSecure(boolean secure)
Set the secure connection flag that will be assigned to requests received through this connector.
Specified by:
setSecure in interface Connector

Parameters:
secure - The new secure connection flag


setService

public void setService(Service service)
Set the Service with which we are associated.
Specified by:
setService in interface Connector


setTomcatAuthentication

public void setTomcatAuthentication(boolean tomcatAuthentication)
Set the value of the tomcatAuthentication flag.


start

public void start()
            throws LifecycleException
Begin processing requests via this Connector.
Specified by:
start in interface Lifecycle

Throws:
LifecycleException - if a fatal startup error occurs


stop

public void stop()
            throws LifecycleException
Terminate processing requests via this Connector.
Specified by:
stop in interface Lifecycle

Throws:
LifecycleException - if a fatal shutdown error occurs


Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.