public class AJP13Listener extends ThreadedServer implements HttpListener
This code uses the AJP13 code from tomcat3.3 as the protocol specification, but is new implementation.
ThreadPool.PoolThread__DAEMON, __PRIORITYATTRIBUTE| Constructor and Description |
|---|
AJP13Listener() |
AJP13Listener(InetAddrPort address) |
| Modifier and Type | Method and Description |
|---|---|
protected AJP13Connection |
createConnection(Socket socket)
Create an AJP13Connection instance.
|
void |
customizeRequest(HttpConnection connection,
HttpRequest request)
Customize the request from connection.
|
protected void |
customizeRequest(Socket socket,
HttpRequest request)
Customize request from socket.
|
int |
getBufferReserve()
Get the size of the header reserve area.
|
int |
getBufferSize()
Get the size of the buffers used by connections from this listener.
|
int |
getConfidentialPort()
Get the protocol port to use for confidential redirections.
|
String |
getConfidentialScheme()
Get the protocol scheme to use for confidential redirections.
|
String |
getDefaultScheme()
Get the default scheme for requests.
|
HttpHandler |
getHttpHandler()
Get an optional HttpHandler for the listener.
|
HttpServer |
getHttpServer()
Get the HttpServer instance for this HttpListener.
|
boolean |
getIdentifyListener() |
int |
getIntegralPort()
Get the protocol port to use for integral redirections.
|
String |
getIntegralScheme()
Get the protocol scheme to use for integral redirections.
|
String[] |
getRemoteServers() |
void |
handleConnection(Socket socket)
Handle Job.
|
boolean |
isConfidential(HttpConnection connection)
Get the confidential status of a connection.
|
boolean |
isIntegral(HttpConnection connection)
Get the integral status of a connection.
|
boolean |
isLowOnResources()
Get the low on resources state of the listener.
|
boolean |
isOutOfResources()
Get the out of resources state of the listener.
|
void |
persistConnection(HttpConnection connection)
Persist the connection.
|
void |
setBufferReserve(int size) |
void |
setBufferSize(int size) |
void |
setConfidentialPort(int confidentialPort) |
void |
setConfidentialScheme(String confidentialScheme) |
void |
setHttpHandler(HttpHandler handler) |
void |
setHttpServer(HttpServer server)
Set the HttpServer instance for this HttpListener.
|
void |
setIdentifyListener(boolean identifyListener) |
void |
setIntegralPort(int integralPort) |
void |
setIntegralScheme(String integralScheme) |
void |
setRemoteServers(String[] servers)
Set accepted remote servers.
|
void |
start()
Start the LifeCycle.
|
void |
stop()
Stop the ThreadPool.
|
acceptSocket, acceptSocket, getAcceptorThreads, getAcceptQueueSize, getHost, getInetAddress, getInetAddrPort, getLingerTimeSecs, getMaxReadTimeMs, getPort, getServerSocket, getTcpNoDelay, handle, handleConnection, newServerSocket, open, setAcceptorThreads, setAcceptQueueSize, setHost, setInetAddress, setInetAddrPort, setLingerTimeSecs, setMaxReadTimeMs, setPort, setTcpNoDelay, stopJob, toStringgetIdleThreads, getMaxIdleTimeMs, getMaxThreads, getMinThreads, getName, getPoolName, getThreads, getThreadsPriority, isDaemon, isStarted, join, run, setDaemon, setMaxIdleTimeMs, setMaxStopTimeMs, setMaxThreads, setMinThreads, setName, setPoolName, setThreadsPriority, shrinkclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetHost, getPort, setHost, setPortpublic AJP13Listener()
public AJP13Listener(InetAddrPort address)
public void setHttpServer(HttpServer server)
HttpListenersetHttpServer in interface HttpListenerserver - The HttpServer instance this HttpListener has been added to.public HttpServer getHttpServer()
HttpListenergetHttpServer in interface HttpListenerpublic int getBufferSize()
HttpListenergetBufferSize in interface HttpListenerpublic void setBufferSize(int size)
public int getBufferReserve()
HttpListenergetBufferReserve in interface HttpListenerpublic void setBufferReserve(int size)
public boolean getIdentifyListener()
public void setIdentifyListener(boolean identifyListener)
identifyListener - If true, the listener name is added to all requests as the
org.mortbay.http.HttListener attributepublic String getDefaultScheme()
HttpListenergetDefaultScheme in interface HttpListenerpublic void start()
throws Exception
LifeCyclestart in interface LifeCyclestart in class ThreadedServerException - An arbitrary exception may be thrown.public void stop()
throws InterruptedException
ThreadPoolstop in interface LifeCyclestop in class ThreadedServerInterruptedException - Stopping a lifecycle is rarely atomic
and may be interrupted by another thread. If this happens
InterruptedException is throw and the component will be in an
indeterminant state and should probably be discarded.public String[] getRemoteServers()
public void setRemoteServers(String[] servers)
servers - Array of accepted remote server hostnames or IPspublic void handleConnection(Socket socket) throws IOException
handleConnection in class ThreadedServersocket - A Connection.IOExceptionprotected AJP13Connection createConnection(Socket socket) throws IOException
socket - The underlying socket.IOExceptionpublic void customizeRequest(HttpConnection connection, HttpRequest request)
customizeRequest in interface HttpListenerrequest - connection - The connection the request was received on, which must
be a HttpConnection created by this listener.protected void customizeRequest(Socket socket, HttpRequest request)
request - public void persistConnection(HttpConnection connection)
persistConnection in interface HttpListenerconnection - public boolean isLowOnResources()
HttpListenerisLowOnResources in interface HttpListenerpublic boolean isOutOfResources()
HttpListenerisOutOfResources in interface HttpListenerpublic boolean isIntegral(HttpConnection connection)
HttpListenerisIntegral in interface HttpListenerconnection - The connection to test.public boolean isConfidential(HttpConnection connection)
HttpListenerisConfidential in interface HttpListenerconnection - The connection to test.public String getIntegralScheme()
HttpListenergetIntegralScheme in interface HttpListenerpublic void setIntegralScheme(String integralScheme)
public int getIntegralPort()
HttpListenergetIntegralPort in interface HttpListenerpublic void setIntegralPort(int integralPort)
public String getConfidentialScheme()
HttpListenergetConfidentialScheme in interface HttpListenerpublic void setConfidentialScheme(String confidentialScheme)
public int getConfidentialPort()
HttpListenergetConfidentialPort in interface HttpListenerpublic void setConfidentialPort(int confidentialPort)
public HttpHandler getHttpHandler()
HttpListenergetHttpHandler in interface HttpListenerpublic void setHttpHandler(HttpHandler handler)
Copyright © 2016. All Rights Reserved.