com.noelios.restlet.ext.jetty
Class JettyServerHelper

java.lang.Object
  extended by org.restlet.util.Helper<T>
      extended by com.noelios.restlet.ConnectorHelper<Server>
          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
See Also:
Jetty home page

Constructor Summary
JettyServerHelper(Server server)
          Constructor.
 
Method Summary
protected  void configure(org.mortbay.jetty.AbstractConnector connector)
          Configures the internal Jetty connector.
protected abstract  org.mortbay.jetty.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  org.mortbay.jetty.Server getWrappedServer()
          Returns the wrapped Jetty server.
protected  void setWrappedServer(org.mortbay.jetty.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
handle, setEphemeralPort, setEphemeralPort
 
Methods inherited from class com.noelios.restlet.ConnectorHelper
getProtocols, update
 
Methods inherited from class org.restlet.util.Helper
getAttributes, getContext, getHelped, getHelpedParameters, getLogger, setHelped
 
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

configure

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

Parameters:
connector - The internal Jetty connector.

createConnector

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

Returns:
A new internal Jetty connector.

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.

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.

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.

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.

getMaxThreads

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

Returns:
The maximum threads that will service requests.

getMinThreads

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

Returns:
The minimum threads waiting to service requests.

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.

getSoLingerTime

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

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

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.

getWrappedServer

protected org.mortbay.jetty.Server getWrappedServer()
Returns the wrapped Jetty server.

Returns:
The wrapped Jetty server.

setWrappedServer

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

Parameters:
wrappedServer - The wrapped Jetty server.

start

public void start()
           throws java.lang.Exception
Overrides:
start in class ConnectorHelper<Server>
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Overrides:
stop in class ServerHelper
Throws:
java.lang.Exception


Copyright © 2005-2008 Noelios Technologies.