org.jboss.messaging.channel.plugins.handler
Class AbstractChannel

java.lang.Object
  extended byorg.jboss.messaging.channel.plugins.handler.AbstractChannel
All Implemented Interfaces:
Channel (src)
Direct Known Subclasses:
ExclusiveChannel (src) , SharedChannel (src)

public abstract class AbstractChannel
extends java.lang.Object
implements Channel (src)

An abstract channel


Field Summary
protected  Consumer (src) consumer
          The consumer
protected  ChannelHandler (src) handler
          The channel handler
 
Constructor Summary
AbstractChannel(Consumer (src)  consumer, ChannelHandler (src)  handler)
          Create a new AbstractChannel.
 
Method Summary
 void close()
          Close the channel
 MessageReference (src) receive(long wait)
          Receive a message from the channel.
 void send(MessageReference (src)  message)
          Send a message to the channel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

consumer

protected Consumer (src)  consumer
The consumer


handler

protected ChannelHandler (src)  handler
The channel handler

Constructor Detail

AbstractChannel

public AbstractChannel(Consumer (src)  consumer,
                       ChannelHandler (src)  handler)
Create a new AbstractChannel.

Parameters:
consumer - the consumer
handler - the handler
Method Detail

send

public void send(MessageReference (src)  message)
Description copied from interface: Channel (src)
Send a message to the channel.

Specified by:
send in interface Channel (src)
Parameters:
message - the message reference to send

receive

public MessageReference (src)  receive(long wait)
Description copied from interface: Channel (src)
Receive a message from the channel.

Specified by:
receive in interface Channel (src)
Parameters:
wait - the length of time to wait for a message if there are none immediately available, use -1 for no wait.
Returns:
a message or null if there are no messages

close

public void close()
Description copied from interface: Channel (src)
Close the channel

Specified by:
close in interface Channel (src)