net.sf.beep4j.transport
Class LoggingTransportContext

java.lang.Object
  extended by net.sf.beep4j.transport.LoggingTransportContext
All Implemented Interfaces:
TransportContext

public class LoggingTransportContext
extends java.lang.Object
implements TransportContext

Logging interceptor for methods of TransportContext.

Author:
Simon Raess

Constructor Summary
LoggingTransportContext(TransportContext target)
           
 
Method Summary
 void connectionClosed()
          Invoked by the Transport when the underlying physical connection has been closed.
 void connectionEstablished(java.net.SocketAddress address)
          Notifies the context that the physical connection has been established.
 void exceptionCaught(java.lang.Throwable cause)
          Invoked by the Transport to notify the context about an exception that has been caught while sending or processing a message.
 void messageReceived(java.nio.ByteBuffer buffer)
          Invoked by the Transport whenever new content has been received.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggingTransportContext

public LoggingTransportContext(TransportContext target)
Method Detail

connectionEstablished

public void connectionEstablished(java.net.SocketAddress address)
Description copied from interface: TransportContext
Notifies the context that the physical connection has been established. This allows the BEEP peer to start initializing the BEEP session by sending the greeting.

Specified by:
connectionEstablished in interface TransportContext
Parameters:
address - the SocketAddress of the remote peer

messageReceived

public void messageReceived(java.nio.ByteBuffer buffer)
Description copied from interface: TransportContext
Invoked by the Transport whenever new content has been received. This method is invoked whenever a new chunk of bytes arrives. There is no guarantee whatsoever that the received buffer contains a full message. Only the application knows what constitutes a message.

Specified by:
messageReceived in interface TransportContext
Parameters:
buffer - the received bytes

exceptionCaught

public void exceptionCaught(java.lang.Throwable cause)
Description copied from interface: TransportContext
Invoked by the Transport to notify the context about an exception that has been caught while sending or processing a message.

Specified by:
exceptionCaught in interface TransportContext
Parameters:
cause - the causing exception

connectionClosed

public void connectionClosed()
Description copied from interface: TransportContext
Invoked by the Transport when the underlying physical connection has been closed.

Specified by:
connectionClosed in interface TransportContext


Copyright © 2007 null. All Rights Reserved.