net.sf.beep4j.transport
Interface TransportContext

All Known Implementing Classes:
LoggingTransportContext, SessionImpl

public interface TransportContext

The TransportContext defines the methods that a Transport implementation can use to notify the BEEP implementation about important events.

Author:
Simon Raess

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.
 

Method Detail

connectionEstablished

void connectionEstablished(java.net.SocketAddress address)
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.

Parameters:
address - the SocketAddress of the remote peer

exceptionCaught

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.

Parameters:
cause - the causing exception

messageReceived

void messageReceived(java.nio.ByteBuffer buffer)
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.

Parameters:
buffer - the received bytes

connectionClosed

void connectionClosed()
Invoked by the Transport when the underlying physical connection has been closed.



Copyright © 2007 null. All Rights Reserved.