com.caucho.jms
Class ClusterTopic<X extends java.io.Serializable>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractQueue<E>
          extended by com.caucho.jms.queue.AbstractDestination<E>
              extended by com.caucho.jms.queue.AbstractTopic<E>
                  extended by com.caucho.jms.cluster.ClusterTopicImpl<X>
                      extended by com.caucho.jms.ClusterTopic<X>
All Implemented Interfaces:
HandleAware, ServerDestination<X>, java.io.Serializable, java.lang.Iterable<X>, java.util.Collection<X>, java.util.concurrent.BlockingQueue<X>, java.util.Queue<X>, Destination, Topic

@Service
@Configurable
public class ClusterTopic<X extends java.io.Serializable>
extends ClusterTopicImpl<X>

ClusterTopic provides reliable Publish/Subscribe message model communication between the nodes in the Resin cluster.

Following example shows how to make two nodes in resin cluster communicate between each other using cluster topic. This example makes use of Candi Resin's dependency injection implementation.

1. ClusterTopic Configuration

 <registry>
  <resin xmlns="http://caucho.com/ns/resin"
        xmlns:jms="urn:java:com.caucho.jms">
        
   <cluster id="">
     <server id="a" port="6700"/>
     <server id="b" port="6701"/>
     
     <host id="">
       <web-app id="">
         <jms:ClusterTopic>
           <jms:name>server_topic</jms:name>
         </jms:ClusterTopic>
       </web-app>
     </host>
   </cluster>
  </resin>
 </registry> 
 
Above configurations would make ClusterTopic to run on nodes 'a' and 'b'.

2. Executing following lines of code on node 'a', would make node 'a' as the subscriber to the Topic:

See Also:
Serialized Form

Constructor Summary
ClusterTopic()
           
 
Method Summary
 
Methods inherited from class com.caucho.jms.cluster.ClusterTopicImpl
acknowledge, close, closeSubscriber, createSubscriber, destroy, getUrl, hasMessage, init, notifyMessageAvailable, receiveLocal, removeCluster, rollback, send, sendLocal, sendLocalAsBackup, setCluster, setPath, subscribeTopic
 
Methods inherited from class com.caucho.jms.queue.AbstractTopic
drainTo, drainTo, iterator, offer, offer, peek, poll, poll, postConstruct, put, receive, remainingCapacity, setTopicName, size, take
 
Methods inherited from class com.caucho.jms.queue.AbstractDestination
generateMessageID, generateMessageID, getJMSDestination, getName, getQueueName, getTopicName, hasMessage, setName, setSerializationHandle, toString
 
Methods inherited from class java.util.AbstractQueue
add, addAll, clear, element, remove
 
Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.jms.Topic
getTopicName, toString
 
Methods inherited from interface java.util.concurrent.BlockingQueue
add, contains, remove
 
Methods inherited from interface java.util.Queue
element, remove
 
Methods inherited from interface java.util.Collection
addAll, clear, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray
 

Constructor Detail

ClusterTopic

public ClusterTopic()