org.nnsoft.shs
Interface HttpServerConfigurator


public interface HttpServerConfigurator

The Server configuration. It has been designed as interface so users are free to implement their proxies on Properties, XML, JSON, YAML, ...


Method Summary
 void bindServerToHost(String host)
          Configure the host name or the textual representation of its IP address the server has to be bound.
 void bindServerToPort(int port)
          Configure the port number where binding the server.
 RequestHandlerBuilder serve(String path)
          Starts binding a request path, can be expressed using the web.xml grammar, to a RequestHandler.
 void serveRequestsWithThreads(int threads)
          Configure the number of threads that will serve the HTTP requests.
 void sessionsHaveMagAge(int sessionMaxAge)
          Configure the maximum number of seconds of life of HTTP Sessions.
 DefaultResponseBuilder when(Response.Status status)
          Allows defining the default response has to be shown when replying to clients with specified status.
 

Method Detail

bindServerToHost

void bindServerToHost(String host)
Configure the host name or the textual representation of its IP address the server has to be bound.

Parameters:
host - the host name or the textual representation of its IP address.

bindServerToPort

void bindServerToPort(int port)
Configure the port number where binding the server.

Parameters:
port - the port number where binding the server.

serveRequestsWithThreads

void serveRequestsWithThreads(int threads)
Configure the number of threads that will serve the HTTP requests.

Parameters:
threads - the number of threads that will serve the HTTP requests.

sessionsHaveMagAge

void sessionsHaveMagAge(int sessionMaxAge)
Configure the maximum number of seconds of life of HTTP Sessions.

Parameters:
sessionMaxAge - the maximum number of seconds of life of HTTP Sessions.

serve

RequestHandlerBuilder serve(String path)
Starts binding a request path, can be expressed using the web.xml grammar, to a RequestHandler.

Parameters:
path - the path for handling calls.
Returns:
the builder to associate a RequestDispatcher

when

DefaultResponseBuilder when(Response.Status status)
Allows defining the default response has to be shown when replying to clients with specified status.

Parameters:
status - the status the server is replying to clients
Returns:
the builder to associate a fixed file to the given status


Copyright © 2012 99 Software Foundation. All Rights Reserved.