com.sun.faban.harness.logging
Class ProtocolHandlerFactory

java.lang.Object
  extended by com.sun.faban.harness.logging.ProtocolHandlerFactory

public class ProtocolHandlerFactory
extends Object

The protocol handler factory analyzes the input buffer for different supported protocols and returns the appropriate protocol handler upon determining the correct one.

Author:
Akara Sucharitakul

Constructor Summary
ProtocolHandlerFactory(LogConfig config)
          Constructs the protocol handler factory.
 
Method Summary
 ProtocolHandler getHandler(ByteBuffer buffer, int count)
          Looks at the buffer and determines the protocol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtocolHandlerFactory

public ProtocolHandlerFactory(LogConfig config)
Constructs the protocol handler factory.

Parameters:
config - The log configuration
Method Detail

getHandler

public ProtocolHandler getHandler(ByteBuffer buffer,
                                  int count)
                           throws UnsupportedProtocolException
Looks at the buffer and determines the protocol. Returns null if there is no suficient data to determine the protocol.

Parameters:
buffer - The buffer
count - The significant size of the buffer to analyze
Returns:
The appropriate protocol handler, or null if there is not enough data
Throws:
UnsupportedProtocolException - If the protocol cannot be determined