com.noelios.restlet.ext.jetty
Class JettyServerHelper

java.lang.Object
  extended by org.restlet.util.Helper
      extended by com.noelios.restlet.ConnectorHelper
          extended by com.noelios.restlet.ServerHelper
              extended by com.noelios.restlet.http.HttpServerHelper
                  extended by com.noelios.restlet.ext.jetty.JettyServerHelper
Direct Known Subclasses:
AjpServerHelper, HttpServerHelper, HttpsServerHelper

public abstract class JettyServerHelper
extends HttpServerHelper

Abstract Jetty Web server connector. Here is the list of parameters that are supported:

Parameter name Value type Default value Description
minThreads int 1 Minimum threads waiting to service requests.
maxThread int 255 Maximum threads that will service requests.
threadMaxIdleTimeMs int 60000 Time for an idle thread to wait for a request or read.
lowThreads int 25 Threshold of remaining threads at which the server is considered as running low on resources.
lowResourceMaxIdleTimeMs int 2500 Time in ms that connections will persist if listener is low on resources.
acceptorThreads int 1 Number of acceptor threads to set.
acceptQueueSize int 0 Size of the accept queue.
headerBufferSize int 4*1024 Size of the buffer to be used for request and response headers.
requestBufferSize int 8*1024 Size of the content buffer for receiving requests.
responseBufferSize int 32*1024 Size of the content buffer for sending responses.
ioMaxIdleTimeMs int 30000 Maximum time to wait on an idle IO operation.
soLingerTime int 1000 SO linger time (see Jetty 6 documentation).
converter String com.noelios.restlet.http.HttpServerConverter Class name of the converter of low-level HTTP calls into high level requests and responses.
useForwardedForHeader boolean false Lookup the "X-Forwarded-For" header supported by popular proxies and caches and uses it to populate the Request.getClientAddresses() method result. This information is only safe for intermediary components within your local network. Other addresses could easily be changed by setting a fake header and should not be trusted for serious security checks.

Author:
Jerome Louvel (contact@noelios.com)
See Also:
Jetty home page

Constructor Summary
JettyServerHelper(Server server)
          Constructor.
 
Method Summary
protected  void configure(AbstractConnector connector)
          Configures the internal Jetty connector.
protected abstract  AbstractConnector createConnector()
          Creates a new internal Jetty connector.
 int getAcceptorThreads()
          Returns the number of acceptor threads to set.
 int getAcceptQueueSize()
          Returns the size of the accept queue.
 int getHeaderBufferSize()
          Returns the size of the buffer to be used for request and response headers.
 int getIoMaxIdleTimeMs()
          Returns the maximum time to wait on an idle IO operation.
 int getLowResourceMaxIdleTimeMs()
          Returns the time in ms that connections will persist if listener is low on resources.
 int getLowThreads()
          Returns the threshold of remaining threads at which the server is considered as running low on resources.
 int getMaxThreads()
          Returns the maximum threads that will service requests.
 int getMinThreads()
          Returns the minimum threads waiting to service requests.
 int getRequestBufferSize()
          Returns the size of the content buffer for receiving requests.
 int getResponseBufferSize()
          Returns the size of the content buffer for sending responses.
 int getSoLingerTime()
          Returns the SO linger time (see Jetty 6 documentation).
 int getThreadMaxIdleTimeMs()
          Returns the time for an idle thread to wait for a request or read.
protected  Server getWrappedServer()
          Returns the wrapped Jetty server.
protected  void setWrappedServer(Server wrappedServer)
          Sets the wrapped Jetty server.
 void start()
           
 void stop()
           
 
Methods inherited from class com.noelios.restlet.http.HttpServerHelper
getConverter, handle, setConverter
 
Methods inherited from class com.noelios.restlet.ServerHelper
getContext, getLogger, getParameters, getServer, handle, setServer
 
Methods inherited from class com.noelios.restlet.ConnectorHelper
createContext, getProtocols
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JettyServerHelper

public JettyServerHelper(Server server)
Constructor.

Parameters:
server - The server to help.
Method Detail

start

public void start()
           throws Exception
Overrides:
start in class ConnectorHelper
Throws:
Exception

stop

public void stop()
          throws Exception
Overrides:
stop in class ConnectorHelper
Throws:
Exception

createConnector

protected abstract AbstractConnector createConnector()
Creates a new internal Jetty connector.

Returns:
A new internal Jetty connector.

configure

protected void configure(AbstractConnector connector)
Configures the internal Jetty connector.

Parameters:
connector - The internal Jetty connector.

getMinThreads

public int getMinThreads()
Returns the minimum threads waiting to service requests.

Returns:
The minimum threads waiting to service requests.

getMaxThreads

public int getMaxThreads()
Returns the maximum threads that will service requests.

Returns:
The maximum threads that will service requests.

getThreadMaxIdleTimeMs

public int getThreadMaxIdleTimeMs()
Returns the time for an idle thread to wait for a request or read.

Returns:
The time for an idle thread to wait for a request or read.

getLowThreads

public int getLowThreads()
Returns the threshold of remaining threads at which the server is considered as running low on resources.

Returns:
The threshold of remaining threads at which the server is considered as running low on resources.

getLowResourceMaxIdleTimeMs

public int getLowResourceMaxIdleTimeMs()
Returns the time in ms that connections will persist if listener is low on resources.

Returns:
The time in ms that connections will persist if listener is low on resources.

getAcceptorThreads

public int getAcceptorThreads()
Returns the number of acceptor threads to set.

Returns:
The number of acceptor threads to set.

getAcceptQueueSize

public int getAcceptQueueSize()
Returns the size of the accept queue.

Returns:
The size of the accept queue.

getHeaderBufferSize

public int getHeaderBufferSize()
Returns the size of the buffer to be used for request and response headers.

Returns:
The size of the buffer to be used for request and response headers.

getRequestBufferSize

public int getRequestBufferSize()
Returns the size of the content buffer for receiving requests.

Returns:
The size of the content buffer for receiving requests.

getResponseBufferSize

public int getResponseBufferSize()
Returns the size of the content buffer for sending responses.

Returns:
The size of the content buffer for sending responses.

getIoMaxIdleTimeMs

public int getIoMaxIdleTimeMs()
Returns the maximum time to wait on an idle IO operation.

Returns:
The maximum time to wait on an idle IO operation.

getSoLingerTime

public int getSoLingerTime()
Returns the SO linger time (see Jetty 6 documentation).

Returns:
The SO linger time (see Jetty 6 documentation).

setWrappedServer

protected void setWrappedServer(Server wrappedServer)
Sets the wrapped Jetty server.

Parameters:
wrappedServer - The wrapped Jetty server.

getWrappedServer

protected Server getWrappedServer()
Returns the wrapped Jetty server.

Returns:
The wrapped Jetty server.


Copyright © 2005-2007 Noelios Technologies.