net.sf.beep4j
Interface ChannelHandler

All Known Implementing Classes:
ChannelHandlerAdapter, ChannelManagementProfileImpl

public interface ChannelHandler

Represents the incoming view of a channel. The interface contains callback methods which are invoked when the channel is established (channelOpened(Channel)), when a request from the remote peer is received (#receiveRequest(Channel, Message, Reply)), or when the channel has been closed (#channelClosed(Channel)).

Author:
Simon Raess

Method Summary
 void channelClosed()
          Invoked by the framework when the other peer decided to close this channel.
 void channelCloseRequested(CloseChannelRequest request)
          Invoked by the framework when the other peer requested to close the channel.
 void channelOpened(Channel c)
          Invoked by the framework when the channel has been successfully started.
 void channelStartFailed(int code, java.lang.String message)
          Invoked by the framework when the channel could not be started.
 void messageReceived(Message message, Reply reply)
          Invoked by the framework when the other peer sent a message to this peer on this channel.
 

Method Detail

channelOpened

void channelOpened(Channel c)
Invoked by the framework when the channel has been successfully started.

Parameters:
c - the channel that was opened

channelStartFailed

void channelStartFailed(int code,
                        java.lang.String message)
Invoked by the framework when the channel could not be started.

Parameters:
code - the error code
message - the human readable error message

messageReceived

void messageReceived(Message message,
                     Reply reply)
Invoked by the framework when the other peer sent a message to this peer on this channel.

Parameters:
c - the channel on which the message was received
message - the received message
reply - the handler used to return a response.

channelCloseRequested

void channelCloseRequested(CloseChannelRequest request)
Invoked by the framework when the other peer requested to close the channel.

Parameters:
request - the request

channelClosed

void channelClosed()
Invoked by the framework when the other peer decided to close this channel.

Parameters:
c - the Channel that was closed


Copyright © 2007 null. All Rights Reserved.