com.sun.faban.harness.logging
Class ProtocolHandlerFactory
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ProtocolHandlerFactory
public ProtocolHandlerFactory(LogConfig config)
- Constructs the protocol handler factory.
- Parameters:
config
- The log configuration
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 buffercount
- 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