org.restlet.ext.simple
Class SimpleServerHelper

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

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.

Author:
Lars Heuer, Jerome Louvel

Constructor Summary
SimpleServerHelper(Server server)
          Constructor.
 
Method Summary
protected  InetSocketAddress getAddress()
          Returns the socket address this server is listening to.
protected  Connection getConnection()
          Returns the Simple connection.
protected  ContainerServer getContainerServer()
          Returns the Simple container server.
 int getDefaultThreads()
          Returns the default number of polling threads for a handler object.
 boolean isConfidential()
          Indicates if this service is acting in HTTP or HTTPS mode.
protected  void setAddress(InetSocketAddress address)
          Sets the socket address this server is listening to.
protected  void setConfidential(boolean confidential)
          Indicates if this service is acting in HTTP or HTTPS mode.
protected  void setConnection(Connection connection)
          Sets the Simple connection.
protected  void setContainerServer(ContainerServer container)
          Sets the Simple container server.
 void start()
           
 void stop()
           
 
Methods inherited from class org.restlet.engine.adapter.HttpServerHelper
getAdapter, handle, setAdapter
 
Methods inherited from class org.restlet.engine.ServerHelper
handle, setEphemeralPort, setEphemeralPort
 
Methods inherited from class org.restlet.engine.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

SimpleServerHelper

public SimpleServerHelper(Server server)
Constructor.

Parameters:
server - The server to help.
Method Detail

getConnection

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

getContainerServer

protected ContainerServer getContainerServer()
Returns the Simple container server.

Returns:
The Simple container server.

getAddress

protected InetSocketAddress getAddress()
Returns the socket address this server is listening to.

Returns:
The socket address this server is listening to.

isConfidential

public 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(Connection connection)
Sets the Simple connection.

Parameters:
connection - The Simple connection.

setContainerServer

protected void setContainerServer(ContainerServer container)
Sets the Simple container server.

Parameters:
container - The Simple containerServer.

setAddress

protected void setAddress(InetSocketAddress address)
Sets the socket address this server is listening to.

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

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


Copyright © 2005-2013 Restlet.