|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mortbay.util.ThreadPool | +--org.mortbay.http.SocketChannelListener
Non blocking Listener.
Nested Class Summary | |
class |
SocketChannelListener.Connection
|
Nested classes inherited from class org.mortbay.util.ThreadPool |
ThreadPool.PoolThread |
Field Summary |
Fields inherited from class org.mortbay.util.ThreadPool |
__DAEMON |
Fields inherited from interface org.mortbay.http.HttpListener |
ATTRIBUTE |
Constructor Summary | |
SocketChannelListener()
|
Method Summary | |
void |
customizeRequest(HttpConnection connection,
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. |
java.lang.String |
getConfidentialScheme()
Get the protocol scheme to use for confidential redirections. |
java.lang.String |
getDefaultScheme()
Get the default scheme for requests. |
java.lang.String |
getHost()
Get the host or IP of the interface used by this listener. |
HttpServer |
getHttpServer()
Get the HttpServer instance for this HttpListener. |
java.net.InetSocketAddress |
getInetSocketAddress()
|
int |
getIntegralPort()
Get the protocol port to use for integral redirections. |
java.lang.String |
getIntegralScheme()
Get the protocol scheme to use for integral redirections. |
int |
getLingerTimeSecs()
|
int |
getMaxReadTimeMs()
|
int |
getPort()
Get the port number of the listener. |
void |
handle(java.lang.Object 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(java.lang.String confidentialScheme)
|
void |
setDefaultScheme(java.lang.String scheme)
|
void |
setHost(java.lang.String host)
Set the host or IP of the interface used by this listener. |
void |
setHttpServer(HttpServer server)
Set the HttpServer instance for this HttpListener. |
void |
setInetSocketAddress(java.net.InetSocketAddress address)
|
void |
setIntegralPort(int integralPort)
|
void |
setIntegralScheme(java.lang.String integralScheme)
|
void |
setLingerTimeSecs(int ls)
|
void |
setMaxReadTimeMs(int ms)
Deprecated. use maxIdleTime. |
void |
setPort(int port)
Set the port number of the listener. |
void |
start()
Start the LifeCycle. |
void |
stop()
Stop the LifeCycle. |
java.lang.String |
toString()
|
Methods inherited from class org.mortbay.util.ThreadPool |
getIdleThreads, getMaxIdleTimeMs, getMaxThreads, getMinThreads, getName, getPoolName, getThreads, isDaemon, isStarted, join, run, setDaemon, setMaxIdleTimeMs, setMaxStopTimeMs, setMaxThreads, setMinThreads, setName, setPoolName, shrink |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.mortbay.util.LifeCycle |
isStarted |
Constructor Detail |
public SocketChannelListener() throws java.io.IOException
Method Detail |
public void setHttpServer(HttpServer server)
HttpListener
setHttpServer
in interface HttpListener
server
- The HttpServer instance this HttpListener has been added to.public HttpServer getHttpServer()
HttpListener
getHttpServer
in interface HttpListener
public int getBufferSize()
HttpListener
getBufferSize
in interface HttpListener
public void setBufferSize(int size)
public int getBufferReserve()
HttpListener
getBufferReserve
in interface HttpListener
public void setBufferReserve(int size)
public void setDefaultScheme(java.lang.String scheme)
public java.lang.String getDefaultScheme()
HttpListener
getDefaultScheme
in interface HttpListener
public void setHost(java.lang.String host) throws java.net.UnknownHostException
HttpListener
setHost
in interface HttpListener
host
- 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.
java.net.UnknownHostException
public void setPort(int port)
HttpListener
setPort
in interface HttpListener
port
- The TCP/IP port number to be used by this listener.public java.lang.String getHost()
HttpListener
getHost
in interface HttpListener
public int getPort()
HttpListener
getPort
in interface HttpListener
public java.net.InetSocketAddress getInetSocketAddress()
public void setInetSocketAddress(java.net.InetSocketAddress address)
address
- The InetSocketAddress of the listenerpublic void setMaxReadTimeMs(int ms)
public int getMaxReadTimeMs()
public void setLingerTimeSecs(int ls)
public int getLingerTimeSecs()
public void start() throws java.lang.Exception
LifeCycle
start
in interface LifeCycle
start
in class ThreadPool
java.lang.Exception
- An arbitrary exception may be thrown.public void stop() throws java.lang.InterruptedException
LifeCycle
stop
in interface LifeCycle
stop
in class ThreadPool
java.lang.InterruptedException
- 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 void handle(java.lang.Object job) throws java.lang.InterruptedException
handle
in class ThreadPool
java.lang.InterruptedException
public void customizeRequest(HttpConnection connection, HttpRequest request)
customizeRequest
in interface HttpListener
request
- connection
- The connection the request was received on, which must
be a HttpConnection created by this listener.public void persistConnection(HttpConnection connection)
persistConnection
in interface HttpListener
connection
- The perstent connection, which must be a
HttpConnection created by this listener.public boolean isLowOnResources()
HttpListener
isLowOnResources
in interface HttpListener
public boolean isOutOfResources()
HttpListener
isOutOfResources
in interface HttpListener
public boolean isIntegral(HttpConnection connection)
HttpListener
isIntegral
in interface HttpListener
connection
- The connection to test.
public boolean isConfidential(HttpConnection connection)
HttpListener
isConfidential
in interface HttpListener
connection
- The connection to test.
public java.lang.String getIntegralScheme()
HttpListener
getIntegralScheme
in interface HttpListener
public void setIntegralScheme(java.lang.String integralScheme)
public int getIntegralPort()
HttpListener
getIntegralPort
in interface HttpListener
public void setIntegralPort(int integralPort)
public java.lang.String getConfidentialScheme()
HttpListener
getConfidentialScheme
in interface HttpListener
public void setConfidentialScheme(java.lang.String confidentialScheme)
public int getConfidentialPort()
HttpListener
getConfidentialPort
in interface HttpListener
public void setConfidentialPort(int confidentialPort)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |