simple.http
Class BufferedPipelineFactory

java.lang.Object
  extended by simple.http.BufferedPipelineFactory
All Implemented Interfaces:
PipelineFactory

public class BufferedPipelineFactory
extends java.lang.Object
implements PipelineFactory

The BufferedPipelineFacotry object is used to buffer the output for network performance. The output channel is buffered so that the TCP packets that are sent using the sockets output stream have a size that is sufficently large. The motive for using output buffering for the TCP packets can be found in Performance Interacrions Between P-HTTP and TCP-implementations 1997.

The implementation is by default created as a factory object for creating BufferedPipeline instances. This is done so that it can be used to dynamically issue buffered pipelines using the ConnectionHandlerFactory object.

Author:
Niall Gallagher

Constructor Summary
BufferedPipelineFactory()
          This creates a PipelineFactory that will issue instances of the Pipeline that buffers output so that 1Kb packets are sent to the underlying socket.
BufferedPipelineFactory(int size)
          This creates a PipelineFactory that will issue instances of the Pipeline that buffers output to a specified size so that packets that are sent to the underlying socket are sufficently large.
 
Method Summary
 Pipeline getInstance(java.net.Socket sock)
          This will produce a Pipeline with the buffering output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferedPipelineFactory

public BufferedPipelineFactory()
This creates a PipelineFactory that will issue instances of the Pipeline that buffers output so that 1Kb packets are sent to the underlying socket.


BufferedPipelineFactory

public BufferedPipelineFactory(int size)
This creates a PipelineFactory that will issue instances of the Pipeline that buffers output to a specified size so that packets that are sent to the underlying socket are sufficently large.

Parameters:
size - this is the size of the output buffer used
Method Detail

getInstance

public Pipeline getInstance(java.net.Socket sock)
                     throws java.io.IOException
This will produce a Pipeline with the buffering output stream. The output stream provided by the produced pipeline implementation will be capabile of buffering bytes written so that a larger packet can be delivered.

Specified by:
getInstance in interface PipelineFactory
Parameters:
sock - the socket to write the buffered packets to
Throws:
java.io.IOException - if an output stream can not be created