simple.http
Class PipelineHandlerFactory

java.lang.Object
  extended by simple.http.PipelineHandlerFactory

public final class PipelineHandlerFactory
extends java.lang.Object

The PipelineHandlerFactory is used to hide a specific implementation of the PipelineHandler used. This allows a user of this to get access to a PipelineHandler using an implementation of a ProtocolHandler.

This will create an instance of a PipelineHandler to process any incomming Pipeline's from a user. This will will multiplex Pipeline's and read requests from the Pipeline's generating Request objects and Response objects which will then be passed to the ProtocolHandler implementation provided.

Author:
Niall Gallagher

Constructor Summary
PipelineHandlerFactory()
           
 
Method Summary
static PipelineHandler getInstance(ProtocolHandler handler)
          This will create an instance of a PipelineHandler object for processing Pipeline objects using an instance of the ProtocolHandler.
static PipelineHandler getInstance(ProtocolHandler handler, int pollers, int wait)
          This will create an instance of a PipelineHandler object for processing Pipeline objects using an instance of the ProtocolHandler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PipelineHandlerFactory

public PipelineHandlerFactory()
Method Detail

getInstance

public static PipelineHandler getInstance(ProtocolHandler handler)
This will create an instance of a PipelineHandler object for processing Pipeline objects using an instance of the ProtocolHandler. This uses defaults for the PipelineHandler created. Specifics can be specified by using the overloaded getinstance method. The job of the PipelineHandler once it has been created is to read HTTP requests from Pipeline's passed to it. These transactions will be used to generate Request and Resposne objects.

This will create a PipelineHandler to handle any connected Pipeline's. This handler will poll the Pipeline's InputStream so that there is no blocking, this will use an exponential backoff so that if the socket is not producing data it is polled less frequently.

Parameters:
handler - this will recive the requests from the Pipeline

getInstance

public static PipelineHandler getInstance(ProtocolHandler handler,
                                          int pollers,
                                          int wait)
This will create an instance of a PipelineHandler object for processing Pipeline objects using an instance of the ProtocolHandler. This uses defaults for the PipelineHandler created. Specifics can be specified by using the overloaded getinstance method. The job of the PipelineHandler once it has been created is to read HTTP requests from Pipeline's passed to it. These transactions will be used to generate Request and Resposne objects.

This will create a PipelineHandler to handle any connected Pipeline's. This handler will poll the Pipeline's InputStream so that there is no blocking, this will use an exponential backoff so that if the socket is not producing data it is polled less frequently. The wait parameter identifies a maximum that the Pipeline's InputStream will be queued before the next poll.

Parameters:
handler - this will recive the requests from the Pipeline
pollers - this is the number of threads used for polling the Pipeline's, this will not effect the number of Pipeline's that can be polled
wait - this is the maximum waiting time for the polling of the Pipeline, there is an exponential backoff when polling the Pipeline this limits the wait