org.jboss.messaging.core.local
Class Topic

java.lang.Object
  extended byorg.jboss.messaging.core.local.Topic
All Implemented Interfaces:
CoreDestination, Distributor, Receiver
Direct Known Subclasses:
DistributedTopic

public class Topic
extends java.lang.Object
implements CoreDestination

Version:
$Revision: 886 $ $Id: Topic.java 886 2006-04-13 08:57:49Z timfox $
Author:
Ovidiu Feodorov, Tim Fox

Field Summary
protected  long destinationId
           
protected  Router router
           
 
Constructor Summary
Topic(long id, int fullSize, int pageSize, int downCacheSize)
           
 
Method Summary
 boolean add(Receiver receiver)
          Add a local receiver to this distributor.
 void clear()
          Remove all receivers.
 boolean contains(Receiver receiver)
           
 int getDownCacheSize()
           
 int getFullSize()
           
 long getId()
           
 int getPageSize()
           
 Delivery handle(DeliveryObserver sender, Routable r, Transaction tx)
          A receiver can return an active, "done" or null delivery.
 boolean isQueue()
           
 java.util.Iterator iterator()
           
 boolean remove(Receiver receiver)
          Remove a local receiver from this distributor.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

router

protected Router router

destinationId

protected long destinationId
Constructor Detail

Topic

public Topic(long id,
             int fullSize,
             int pageSize,
             int downCacheSize)
Method Detail

handle

public Delivery handle(DeliveryObserver sender,
                       Routable r,
                       Transaction tx)
Description copied from interface: Receiver
A receiver can return an active, "done" or null delivery. The method returns null in case the receiver doesn't accept the message. The return value is unspecified when the message is submitted in the context of a transaction (tx not null).

Specified by:
handle in interface Receiver
Parameters:
sender - - the component the delivery should be acknowledged to.
See Also:
Delivery, DeliveryObserver

add

public boolean add(Receiver receiver)
Description copied from interface: Distributor
Add a local receiver to this distributor.

Specified by:
add in interface Distributor
Returns:
true if the distributor did not already contain the specified receiver and the receiver was added to the distributor, false otherwise.

clear

public void clear()
Description copied from interface: Distributor
Remove all receivers.

Specified by:
clear in interface Distributor

contains

public boolean contains(Receiver receiver)
Specified by:
contains in interface Distributor

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface Distributor
Returns:
an iterator of local receivers

remove

public boolean remove(Receiver receiver)
Description copied from interface: Distributor
Remove a local receiver from this distributor.

Specified by:
remove in interface Distributor
Returns:
true if this distributor contained the specified receiver.

getId

public long getId()
Specified by:
getId in interface CoreDestination

isQueue

public boolean isQueue()
Specified by:
isQueue in interface CoreDestination
Returns:
true if the CoreDestination represents a Queue

getFullSize

public int getFullSize()
Specified by:
getFullSize in interface CoreDestination

getPageSize

public int getPageSize()
Specified by:
getPageSize in interface CoreDestination

getDownCacheSize

public int getDownCacheSize()
Specified by:
getDownCacheSize in interface CoreDestination

toString

public java.lang.String toString()


Copyright © 2006 JBoss Inc. All Rights Reserved.