Restlet Framework 2.2 Snapshot
Java Standard Edition

org.restlet.ext.jetty
Class JettyServerHelper

java.lang.Object
  extended by org.restlet.engine.Helper
      extended by org.restlet.engine.RestletHelper<T>
          extended by org.restlet.engine.connector.ConnectorHelper<Server>
              extended by org.restlet.engine.connector.ServerHelper
                  extended by org.restlet.engine.adapter.HttpServerHelper
                      extended by org.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. They should be set in the Server's context before it is started:

Parameter name Value type Default value Description
minThreads int 1 Minimum threads waiting to service requests.
maxThreads int 255 Maximum threads that will service requests.
threadMaxIdleTimeMs int 60000 Time for an idle thread to wait for a request or read.
lowResourcesMaxIdleTimeMs 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.
requestHeaderSize int 4*1024 Size of the buffer to be used for request headers.
responseHeaderSize int 4*1024 Size of the buffer to be used for 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 documentation).
gracefulShutdown int 0 The time (in ms) to wait for existing requests to complete before fully stopping the server.

Author:
Jerome Louvel
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 getGracefulShutdown()
          Returns the time (in ms) to wait for existing requests to complete before fully stopping the server.
 int getIoMaxIdleTimeMs()
          Returns the maximum time to wait on an idle IO operation.
 int getLowResourcesMaxIdleTimeMs()
          Returns the time in ms that connections will persist if listener is 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 getRequestHeaderSize()
          Returns the size of the buffer to be used for request headers.
 int getResponseBufferSize()
          Returns the size of the content buffer for sending responses.
 int getResponseHeaderSize()
          Returns the size of the buffer to be used for response headers.
 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 org.restlet.engine.adapter.HttpServerHelper
getAdapter, handle, setAdapter
 
Methods inherited from class org.restlet.engine.connector.ServerHelper
handle, setEphemeralPort, setEphemeralPort
 
Methods inherited from class org.restlet.engine.connector.ConnectorHelper
getConnectorService, getContext, getProtocols, update
 
Methods inherited from class org.restlet.engine.RestletHelper
getAttributes, getHelped, getHelpedParameters, getLogger, getMetadataService, 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(AbstractConnector connector)
Configures the internal Jetty connector.

Parameters:
connector - The internal Jetty connector.

createConnector

protected abstract 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.

getGracefulShutdown

public int getGracefulShutdown()
Returns the time (in ms) to wait for existing requests to complete before fully stopping the server.

Returns:
The graceful shutdown delay.

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.

getLowResourcesMaxIdleTimeMs

public int getLowResourcesMaxIdleTimeMs()
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.

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.

getRequestHeaderSize

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

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

getResponseBufferSize

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

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

getResponseHeaderSize

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

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

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 Server getWrappedServer()
Returns the wrapped Jetty server.

Returns:
The wrapped Jetty server.

setWrappedServer

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

Parameters:
wrappedServer - The wrapped Jetty server.

start

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

stop

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

Restlet Framework 2.2 Snapshot
Java Standard Edition

Copyright © 2005-2014 Restlet.