JBoss Remoting 3 3.2.0.Beta2-redhat-1

org.jboss.remoting3
Interface Channel

All Superinterfaces:
Attachable, Closeable, HandleableCloseable<Channel>

public interface Channel
extends Attachable, HandleableCloseable<Channel>

The most basic level of communications in a Remoting connection. A channel simply sends and receives messages. No request/reply correlation is performed. Messages are received in the order that they are written; however, multiple messages may flow in or out concurrently on a single channel. In particular, a later message may complete before an earlier message does.

Author:
David M. Lloyd

Nested Class Summary
static interface Channel.Receiver
          A handler for an incoming message.
 
Nested classes/interfaces inherited from interface org.jboss.remoting3.HandleableCloseable
HandleableCloseable.Key
 
Method Summary
 void close()
          Close this channel.
 void receiveMessage(Channel.Receiver handler)
          Initiate processing of the next message, when it comes in.
 MessageOutputStream writeMessage()
          Write a new message on to this channel, blocking if necessary.
 void writeShutdown()
          Send an end-of-messages signal to the remote side.
 
Methods inherited from interface org.jboss.remoting3.Attachable
getAttachments
 
Methods inherited from interface org.jboss.remoting3.HandleableCloseable
addCloseHandler, awaitClosed, awaitClosedUninterruptibly, closeAsync
 

Method Detail

writeMessage

MessageOutputStream writeMessage()
                                 throws IOException
Write a new message on to this channel, blocking if necessary.

Returns:
the outbound message to send
Throws:
IOException - if a new message cannot be written

writeShutdown

void writeShutdown()
                   throws IOException
Send an end-of-messages signal to the remote side. No more messages may be written after this method is called; however, more incoming messages may be received.

Throws:
IOException - if the message could not be written

receiveMessage

void receiveMessage(Channel.Receiver handler)
Initiate processing of the next message, when it comes in. This method does not block; instead the handler is called asynchronously (possibly in another thread) if/when the next message arrives.

Parameters:
handler - the handler for the next incoming message

close

void close()
           throws IOException
Close this channel. No more messages may be sent or received after this method is called.

Specified by:
close in interface Closeable
Specified by:
close in interface HandleableCloseable<Channel>
Throws:
IOException - if a failure occurs during close

JBoss Remoting 3 3.2.0.Beta2-redhat-1

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.