org.jboss.messaging.core.contract
Interface Channel

All Superinterfaces:
DeliveryObserver, Receiver
All Known Subinterfaces:
Queue
All Known Implementing Classes:
ChannelSupport, MessagingQueue, PagingChannelSupport

public interface Channel
extends DeliveryObserver, Receiver

A Channel is a transactional, reliable message delivery mechanism that forwards a message from a sender to one or more receivers.

Version:
$Revision: 2868 $ $Id: Channel.java 2868 2007-07-10 20:22:16Z timfox $
Author:
Ovidiu Feodorov, Tim Fox

Method Summary
 void activate()
          Activate the channel.
 java.util.List browse(Filter filter)
           
 void close()
          Close the channel
 void deactivate()
          Deactivate the channel
 void deliver()
          Delivers as many references as possible to its router until receivers will accept no more
 long getChannelID()
           
 int getDeliveringCount()
           
 int getMaxSize()
           
 int getMessageCount()
           
 int getMessagesAdded()
          Get the total number of messages added since this channel was started
 int getScheduledCount()
          Count scheduled for delivery
 boolean isActive()
           
 boolean isRecoverable()
           
 void load()
          Load any references for this channel from storage
 void removeAllReferences()
          Remove all the references in the channel
 void setMaxSize(int newSize)
          Set the maximum number of references this channel can store
 void unload()
          Unload any references for this channel
 
Methods inherited from interface org.jboss.messaging.core.contract.DeliveryObserver
acknowledge, cancel
 
Methods inherited from interface org.jboss.messaging.core.contract.Receiver
handle
 

Method Detail

getChannelID

long getChannelID()
Returns:
the unique ID of the channel

isRecoverable

boolean isRecoverable()
Returns:
true if the channel can guarantee recoverability for reliable messages. Recoverability is not guaranteed for non-reliable messages even if the channel is recoverable.

browse

java.util.List browse(Filter filter)
Parameters:
filter - - may be null, in which case no filter is applied.
Returns:
a List containing message references of messages whose state is maintained by this State instance.

deliver

void deliver()
Delivers as many references as possible to its router until receivers will accept no more


close

void close()
Close the channel


getMessageCount

int getMessageCount()
Returns:
Total message count = undelivered + delivering + scheduled

getDeliveringCount

int getDeliveringCount()
Returns:
Count being delivered

getScheduledCount

int getScheduledCount()
Count scheduled for delivery


removeAllReferences

void removeAllReferences()
                         throws java.lang.Throwable
Remove all the references in the channel

Throws:
java.lang.Throwable

load

void load()
          throws java.lang.Exception
Load any references for this channel from storage

Throws:
java.lang.Exception

unload

void unload()
            throws java.lang.Exception
Unload any references for this channel

Throws:
java.lang.Exception

activate

void activate()
Activate the channel.


deactivate

void deactivate()
Deactivate the channel


isActive

boolean isActive()
Returns:
true if the channel is active

getMaxSize

int getMaxSize()
Returns:
The maxiumum number of references this channel can store

setMaxSize

void setMaxSize(int newSize)
Set the maximum number of references this channel can store

Parameters:
newSize -

getMessagesAdded

int getMessagesAdded()
Get the total number of messages added since this channel was started

Returns:


Copyright © 2006 JBoss Inc. All Rights Reserved.