public class SocketChannelListener extends ThreadPool implements HttpListener
ThreadPool.PoolThread__DAEMON, __PRIORITYATTRIBUTE| Constructor and Description |
|---|
SocketChannelListener()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
customizeRequest(HttpConnection connection,
HttpRequest request)
Customize a request for a listener/connection combination.
|
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.
|
String |
getHost()
Get the host or IP of the interface used by this listener.
|
HttpHandler |
getHttpHandler()
Get an optional HttpHandler for the listener.
|
HttpServer |
getHttpServer()
Get the HttpServer instance for this HttpListener.
|
int |
getIntegralPort()
Get the protocol port to use for integral redirections.
|
String |
getIntegralScheme()
Get the protocol scheme to use for integral redirections.
|
int |
getLingerTimeSecs() |
int |
getPort()
Get the port number of the listener.
|
int |
getSslPort()
get_sslPort.
|
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)
Prepare a connection for persistance.
|
void |
setBufferReserve(int size) |
void |
setBufferSize(int size) |
void |
setHost(String host)
Set the host or IP of the interface used by this listener.
|
void |
setHttpHandler(HttpHandler handler) |
void |
setHttpServer(HttpServer server)
Set the HttpServer instance for this HttpListener.
|
void |
setLingerTimeSecs(int ls) |
void |
setPort(int port)
Set the port number of the listener.
|
void |
setSslPort(int p)
set_sslPort.
|
void |
start()
Start the LifeCycle.
|
void |
stop()
Stop the ThreadPool.
|
getIdleThreads, getMaxIdleTimeMs, getMaxThreads, getMinThreads, getName, getPoolName, getThreads, getThreadsPriority, handle, isDaemon, isStarted, join, run, setDaemon, setMaxIdleTimeMs, setMaxStopTimeMs, setMaxThreads, setMinThreads, setName, setPoolName, setThreadsPriority, shrink, stopJobpublic void setHttpServer(HttpServer server)
HttpListenersetHttpServer in interface HttpListenerserver - The HttpServer instance this HttpListener has been added to.public HttpServer getHttpServer()
HttpListenergetHttpServer in interface HttpListenerpublic void setHost(String host) throws UnknownHostException
HttpListenersetHost in interface HttpListenerhost - The hostname or IP address of the interface used by this
listeners. If null or "0.0.0.0" then all available interfaces are used
by this listener.UnknownHostExceptionHttpListener.setHost(java.lang.String)public String getHost()
HttpListenergetHost in interface HttpListenerpublic void setPort(int port)
HttpListenersetPort in interface HttpListenerport - The TCP/IP port number to be used by this listener.public int getPort()
HttpListenergetPort in interface HttpListenerpublic void setBufferSize(int size)
public int getBufferSize()
HttpListenergetBufferSize in interface HttpListenerpublic void setBufferReserve(int size)
public int getBufferReserve()
HttpListenergetBufferReserve in interface HttpListenerpublic String getDefaultScheme()
HttpListenergetDefaultScheme in interface HttpListenerpublic void customizeRequest(HttpConnection connection, HttpRequest request)
HttpListenercustomizeRequest in interface HttpListenerconnection - The connection the request was received on, which must
be a HttpConnection created by this listener.request - The request to customize.public void persistConnection(HttpConnection connection)
HttpListenerpersistConnection in interface HttpListenerconnection - The perstent connection, which must be a
HttpConnection created by this listener.public boolean isLowOnResources()
HttpListenerisLowOnResources in interface HttpListenerpublic boolean isOutOfResources()
HttpListenerisOutOfResources in interface HttpListenerpublic int getSslPort()
public void setSslPort(int p)
p - Port to redirect integral and confidential requests to.public boolean isIntegral(HttpConnection connection)
HttpListenerisIntegral in interface HttpListenerconnection - The connection to test.public String getIntegralScheme()
HttpListenergetIntegralScheme in interface HttpListenerpublic int getIntegralPort()
HttpListenergetIntegralPort in interface HttpListenerpublic boolean isConfidential(HttpConnection connection)
HttpListenerisConfidential in interface HttpListenerconnection - The connection to test.public String getConfidentialScheme()
HttpListenergetConfidentialScheme in interface HttpListenerpublic int getConfidentialPort()
HttpListenergetConfidentialPort in interface HttpListenerpublic void setLingerTimeSecs(int ls)
sec - seconds to linger or -1 to disable linger.public int getLingerTimeSecs()
public void setHttpHandler(HttpHandler handler)
public HttpHandler getHttpHandler()
HttpListenergetHttpHandler in interface HttpListenerHttpListener.getHttpHandler()public void start()
throws Exception
LifeCyclestart in interface LifeCyclestart in class ThreadPoolException - An arbitrary exception may be thrown.public void stop()
throws InterruptedException
ThreadPoolstop in interface LifeCyclestop in class ThreadPoolInterruptedException - 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.Copyright © 2015. All Rights Reserved.