org.restlet.engine.connector
Class HttpServerHelper

java.lang.Object
  extended by org.restlet.engine.Helper
      extended by org.restlet.engine.RestletHelper<T>
          extended by org.restlet.engine.ConnectorHelper<T>
              extended by org.restlet.engine.connector.BaseHelper<T>
                  extended by org.restlet.engine.connector.ConnectionHelper<Server>
                      extended by org.restlet.engine.connector.ServerConnectionHelper
                          extended by org.restlet.engine.connector.HttpServerHelper

public class HttpServerHelper
extends ServerConnectionHelper

HTTP server helper based on NIO blocking sockets.

Author:
Jerome Louvel

Field Summary
 
Fields inherited from class org.restlet.engine.connector.BaseHelper
clientSide, controller, inboundMessages, outboundMessages
 
Constructor Summary
HttpServerHelper(Server server)
          Constructor.
HttpServerHelper(Server server, Protocol protocol)
          Constructor.
 
Method Summary
protected  boolean canHandle(Connection<Server> connection, Response response)
          Indicates if the connection can handle the given response at this point in time.
 InboundWay createInboundWay(Connection<Server> connection, int bufferSize)
          Creates an inbound way for the given connection.
 OutboundWay createOutboundWay(Connection<Server> connection, int bufferSize)
          Creates an outbound way for the given connection.
protected  Request createRequest(Connection<Server> connection, String methodName, String resourceUri, String protocol)
          Creates a new request.
 
Methods inherited from class org.restlet.engine.connector.ServerConnectionHelper
createConnection, createController, createServerSocketChannel, createSocketAddress, doHandleInbound, doHandleOutbound, getController, getServerSocketChannel, handle, handleInbound, handleOutbound, isControllerDaemon, isProxying, isReuseAddress, setEphemeralPort, setEphemeralPort, start, stop
 
Methods inherited from class org.restlet.engine.connector.ConnectionHelper
addOutboundMessage, checkin, checkout, configure, createConnectionPool, doFinishStop, doGracefulStop, getConnectionPool, getConnections, getInitialConnections, getMaxConnectionsPerHost, getMaxTotalConnections, getSocketLingerTimeMs, getSocketReceiveBufferSize, getSocketSendBufferSize, getSocketTrafficClass, isPersistingConnections, isPipeliningConnections, isPooledConnection, isSocketKeepAlive, isSocketNoDelay, isSocketOobInline, isSocketReuseAddress
 
Methods inherited from class org.restlet.engine.connector.BaseHelper
control, createControllerService, createRequest, createWorkerService, execute, getControllerSleepTimeMs, getInboundBufferSize, getInboundMessages, getLowThreads, getMaxIoIdleTimeMs, getMaxQueued, getMaxThreadIdleTimeMs, getMaxThreads, getMinThreads, getOutboundBufferSize, getOutboundMessages, getRequest, getThrottleTimeMs, getTraceStream, getTransport, getWorkerService, handleInbound, handleOutbound, hasWorkerThreads, isClientSide, isDirectBuffers, isServerSide, isTracing, isWorkerServiceOverloaded, onInboundError, onOutboundError, traceWorkerService
 
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

HttpServerHelper

public HttpServerHelper(Server server)
Constructor.

Parameters:
server - The server to help.

HttpServerHelper

public HttpServerHelper(Server server,
                        Protocol protocol)
Constructor.

Parameters:
server - The server to help.
protocol - The protocol supported.
Method Detail

canHandle

protected boolean canHandle(Connection<Server> connection,
                            Response response)
                     throws IOException
Description copied from class: ServerConnectionHelper
Indicates if the connection can handle the given response at this point in time.

Specified by:
canHandle in class ServerConnectionHelper
Parameters:
connection - The parent connection.
response - The response to handle.
Returns:
True if the connection can handle the given response at this point in time.
Throws:
IOException

createInboundWay

public InboundWay createInboundWay(Connection<Server> connection,
                                   int bufferSize)
Description copied from class: ConnectionHelper
Creates an inbound way for the given connection.

Specified by:
createInboundWay in class ConnectionHelper<Server>
Parameters:
connection - The parent connection.
bufferSize - The byte buffer size.
Returns:
The inbound way created.

createOutboundWay

public OutboundWay createOutboundWay(Connection<Server> connection,
                                     int bufferSize)
Description copied from class: ConnectionHelper
Creates an outbound way for the given connection.

Specified by:
createOutboundWay in class ConnectionHelper<Server>
Parameters:
connection - The parent connection.
bufferSize - The byte buffer size.
Returns:
The outbound way created.

createRequest

protected Request createRequest(Connection<Server> connection,
                                String methodName,
                                String resourceUri,
                                String protocol)
Description copied from class: ServerConnectionHelper
Creates a new request.

Specified by:
createRequest in class ServerConnectionHelper
Parameters:
connection - The associated connection.
methodName - The method name.
resourceUri - The target resource URI.
protocol - The protocol name and version.
Returns:
The created request.


Copyright © 2005-2013 Restlet.