net.sf.beep4j
Interface Channel

All Known Subinterfaces:
InternalChannel

public interface Channel

Represents the outgoing view of a BEEP channel. It allows to send messages to the remote peer and to close the channel.

Author:
Simon Raess

Method Summary
 void close(CloseChannelCallback callback)
          Closes the channel.
 MessageBuilder createMessageBuilder()
          Creates a new MessageBuilder object that can be used to create one Message.
 java.lang.String getProfile()
          Gets the URI of the profile that is used by this channel.
 Session getSession()
          Gets the session on which this channel runs.
 void sendMessage(Message message, ReplyHandler listener)
          Sends a message on this channel to the remote peer.
 

Method Detail

getProfile

java.lang.String getProfile()
Gets the URI of the profile that is used by this channel.

Returns:
the URI of the active profile

getSession

Session getSession()
Gets the session on which this channel runs.

Returns:
the session

createMessageBuilder

MessageBuilder createMessageBuilder()
Creates a new MessageBuilder object that can be used to create one Message.

Returns:
a MessageBuilder implementation

sendMessage

void sendMessage(Message message,
                 ReplyHandler listener)
Sends a message on this channel to the remote peer. This method returns fairly quickly. That is, it does not wait for the answer to arrive. Instead, the reply is received through the reply listener.

Parameters:
message - the message to be sent
listener - the listener receiving the reply

close

void close(CloseChannelCallback callback)
Closes the channel. The channel is closed as soon as the conditions specified by section 2.3.1.3 of the BEEP specification are met. Note that the other peer can decline the close request. The outcome is communicated throught the CloseChannelCallback supplied by the client.

Parameters:
callback - the callback that gets notified about the outcome of the close request


Copyright © 2007 null. All Rights Reserved.