net.grinder.plugin.http.tcpproxyfilter
Class ConnectionCache

java.lang.Object
  extended by net.grinder.plugin.http.tcpproxyfilter.ConnectionCache
All Implemented Interfaces:
HTTPFilterEventListener, org.picocontainer.Disposable

public final class ConnectionCache
extends Object
implements HTTPFilterEventListener, org.picocontainer.Disposable

Map of ConnectionDetails to handlers.

Author:
Philip Aston

Constructor Summary
ConnectionCache(ConnectionHandlerFactory connectionHandlerFactory)
          Constructor.
 
Method Summary
 void close(ConnectionDetails connectionDetails)
          A connection has been closed, remove the handler.
 void dispose()
          Called after the filter has been stopped.
 void open(ConnectionDetails connectionDetails)
          A connection has been opened, create a handler.
 void request(ConnectionDetails connectionDetails, byte[] buffer, int bytesRead)
          A request message has been received.
 void response(ConnectionDetails connectionDetails, byte[] buffer, int bytesRead)
          Part of a response message has been received.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionCache

public ConnectionCache(ConnectionHandlerFactory connectionHandlerFactory)
Constructor.

Parameters:
connectionHandlerFactory - Factory for connection handlers.
Method Detail

open

public void open(ConnectionDetails connectionDetails)
A connection has been opened, create a handler.

Specified by:
open in interface HTTPFilterEventListener
Parameters:
connectionDetails - Details.

request

public void request(ConnectionDetails connectionDetails,
                    byte[] buffer,
                    int bytesRead)
A request message has been received.

Specified by:
request in interface HTTPFilterEventListener
Parameters:
connectionDetails - Connection details.
buffer - Buffer containing message.
bytesRead - Length of message.

response

public void response(ConnectionDetails connectionDetails,
                     byte[] buffer,
                     int bytesRead)
Part of a response message has been received.

Specified by:
response in interface HTTPFilterEventListener
Parameters:
connectionDetails - Connection details.
buffer - Buffer containing message.
bytesRead - Length of message.

close

public void close(ConnectionDetails connectionDetails)
A connection has been closed, remove the handler.

Specified by:
close in interface HTTPFilterEventListener
Parameters:
connectionDetails - Details.

dispose

public void dispose()
Called after the filter has been stopped.

Specified by:
dispose in interface org.picocontainer.Disposable


Copyright © 2000-2013. All Rights Reserved.