org.mortbay.http.nio

Class SocketChannelListener

Implemented Interfaces:
HttpListener, LifeCycle, Serializable

public class SocketChannelListener
extends ThreadPool
implements HttpListener

EXPERIMENTAL NIO listener!
Version:
$Revision: 1.6 $
Author:
gregw

Nested Class Summary

Nested classes/interfaces inherited from class org.mortbay.util.ThreadPool

ThreadPool.PoolThread

Field Summary

Fields inherited from class org.mortbay.util.ThreadPool

__DAEMON, __PRIORITY

Fields inherited from interface org.mortbay.http.HttpListener

ATTRIBUTE

Constructor Summary

SocketChannelListener()
Constructor.

Method Summary

void
customizeRequest(HttpConnection connection, HttpRequest request)
int
getBufferReserve()
int
getBufferSize()
int
getConfidentialPort()
String
getConfidentialScheme()
String
getDefaultScheme()
String
getHost()
HttpHandler
getHttpHandler()
HttpServer
getHttpServer()
int
getIntegralPort()
String
getIntegralScheme()
int
getLingerTimeSecs()
int
getPort()
int
getSslPort()
get_sslPort.
boolean
isConfidential(HttpConnection connection)
boolean
isIntegral(HttpConnection connection)
boolean
isLowOnResources()
boolean
isOutOfResources()
void
persistConnection(HttpConnection connection)
void
setBufferReserve(int size)
void
setBufferSize(int size)
void
setHost(String host)
void
setHttpHandler(HttpHandler handler)
void
setHttpServer(HttpServer server)
void
setLingerTimeSecs(int ls)
void
setPort(int port)
void
setSslPort(int p)
set_sslPort.
void
start()
void
stop()

Methods inherited from class org.mortbay.util.ThreadPool

getIdleThreads, getMaxIdleTimeMs, getMaxThreads, getMinThreads, getName, getPoolName, getThreads, getThreadsPriority, handle, isDaemon, isStarted, join, run, setDaemon, setMaxIdleTimeMs, setMaxStopTimeMs, setMaxThreads, setMinThreads, setName, setPoolName, setThreadsPriority, shrink, start, stop, stopJob

Constructor Details

SocketChannelListener

public SocketChannelListener()
Constructor.

Method Details

customizeRequest

public void customizeRequest(HttpConnection connection,
                             HttpRequest request)
Specified by:
customizeRequest in interface HttpListener

getBufferReserve

public int getBufferReserve()
Specified by:
getBufferReserve in interface HttpListener

getBufferSize

public int getBufferSize()
Specified by:
getBufferSize in interface HttpListener

getConfidentialPort

public int getConfidentialPort()
Specified by:
getConfidentialPort in interface HttpListener

getConfidentialScheme

public String getConfidentialScheme()
Specified by:
getConfidentialScheme in interface HttpListener

getDefaultScheme

public String getDefaultScheme()
Specified by:
getDefaultScheme in interface HttpListener

getHost

public String getHost()
Specified by:
getHost in interface HttpListener

getHttpHandler

public HttpHandler getHttpHandler()
Specified by:
getHttpHandler in interface HttpListener

getHttpServer

public HttpServer getHttpServer()
Specified by:
getHttpServer in interface HttpListener

getIntegralPort

public int getIntegralPort()
Specified by:
getIntegralPort in interface HttpListener

getIntegralScheme

public String getIntegralScheme()
Specified by:
getIntegralScheme in interface HttpListener

getLingerTimeSecs

public int getLingerTimeSecs()
Returns:
seconds.

getPort

public int getPort()
Specified by:
getPort in interface HttpListener

getSslPort

public int getSslPort()
get_sslPort.
Returns:
Port to redirect integral and confidential requests to.

isConfidential

public boolean isConfidential(HttpConnection connection)
Specified by:
isConfidential in interface HttpListener

isIntegral

public boolean isIntegral(HttpConnection connection)
Specified by:
isIntegral in interface HttpListener

isLowOnResources

public boolean isLowOnResources()
Specified by:
isLowOnResources in interface HttpListener

isOutOfResources

public boolean isOutOfResources()
Specified by:
isOutOfResources in interface HttpListener

persistConnection

public void persistConnection(HttpConnection connection)
Specified by:
persistConnection in interface HttpListener

setBufferReserve

public void setBufferReserve(int size)

setBufferSize

public void setBufferSize(int size)

setHost

public void setHost(String host)
            throws UnknownHostException
Specified by:
setHost in interface HttpListener
See Also:
org.mortbay.http.HttpListener.setHost(java.lang.String)

setHttpHandler

public void setHttpHandler(HttpHandler handler)

setHttpServer

public void setHttpServer(HttpServer server)
Specified by:
setHttpServer in interface HttpListener

setLingerTimeSecs

public void setLingerTimeSecs(int ls)
Parameters:

setPort

public void setPort(int port)
Specified by:
setPort in interface HttpListener

setSslPort

public void setSslPort(int p)
set_sslPort.
Parameters:
p - Port to redirect integral and confidential requests to.

start

public void start()
            throws Exception
Specified by:
start in interface LifeCycle
Overrides:
start in interface ThreadPool

stop

public void stop()
            throws InterruptedException
Specified by:
stop in interface LifeCycle
Overrides:
stop in interface ThreadPool

Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.