com.noelios.restlet.ext.simple
Class SimpleServerHelper

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.simple.SimpleServerHelper
Direct Known Subclasses:
HttpServerHelper, HttpsServerHelper

public abstract class SimpleServerHelper
extends HttpServerHelper

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

Parameter name Value type Default value Description
defaultThreads int 20 Default number of polling threads for a handler object.
maxWaitTimeMs int 200 Maximum waiting time between polls of the input.
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:
Lars Heuer, Jerome Louvel

Constructor Summary
SimpleServerHelper(Server server)
          Constructor.
 
Method Summary
protected  simple.http.connect.Connection getConnection()
          Returns the Simple connection.
 int getDefaultThreads()
          Returns the default number of polling threads for a handler object.
protected  simple.http.PipelineHandler getHandler()
          Returns the Simple pipeline handler.
 int getMaxWaitTimeMs()
          Returns the maximum waiting time between polls of the input.
protected  java.net.ServerSocket getSocket()
          Returns the server socket this server is listening to.
protected  boolean isConfidential()
          Indicates if this service is acting in HTTP or HTTPS mode.
protected  void setConfidential(boolean confidential)
          Indicates if this service is acting in HTTP or HTTPS mode.
protected  void setConnection(simple.http.connect.Connection connection)
          Sets the Simple connection.
protected  void setHandler(simple.http.PipelineHandler handler)
          Sets the Simple pipeline handler.
protected  void setSocket(java.net.ServerSocket socket)
          Sets the server socket this server is listening to.
 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

SimpleServerHelper

public SimpleServerHelper(Server server)
Constructor.

Parameters:
server - The server to help.
Method Detail

getConnection

protected simple.http.connect.Connection getConnection()
Returns the Simple connection.

Returns:
The Simple connection.

getDefaultThreads

public int getDefaultThreads()
Returns the default number of polling threads for a handler object.

Returns:
The default number of polling threads for a handler object.

getHandler

protected simple.http.PipelineHandler getHandler()
Returns the Simple pipeline handler.

Returns:
The Simple pipeline handler.

getMaxWaitTimeMs

public int getMaxWaitTimeMs()
Returns the maximum waiting time between polls of the input.

Returns:
The maximum waiting time between polls of the input.

getSocket

protected java.net.ServerSocket getSocket()
Returns the server socket this server is listening to.

Returns:
The server socket this server is listening to.

isConfidential

protected boolean isConfidential()
Indicates if this service is acting in HTTP or HTTPS mode.

Returns:
True if this service is acting in HTTP or HTTPS mode.

setConfidential

protected void setConfidential(boolean confidential)
Indicates if this service is acting in HTTP or HTTPS mode.

Parameters:
confidential - True if this service is acting in HTTP or HTTPS mode.

setConnection

protected void setConnection(simple.http.connect.Connection connection)
Sets the Simple connection.

Parameters:
connection - The Simple connection.

setHandler

protected void setHandler(simple.http.PipelineHandler handler)
Sets the Simple pipeline handler.

Parameters:
handler - The Simple pipeline handler.

setSocket

protected void setSocket(java.net.ServerSocket socket)
Sets the server socket this server is listening to.

Parameters:
socket - The server socket this server is listening to.

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.