|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents a logical connection to a cluster. From this object you can obtain the destination to send messages to, view the members of the cluster, watch cluster events (nodes joining, leaving, updating their state) as well as viewing each members state.
You may also update the local node's state.
Method Summary | |
void |
addClusterListener(ClusterListener listener)
Adds a new listener to cluster events |
BytesMessage |
createBytesMessage()
Creates a new bytes message |
MessageConsumer |
createConsumer(Destination destination)
Creates a consumer of all the messags sent to the given destination, including messages sent via the send() messages |
MessageConsumer |
createConsumer(Destination destination,
String selector)
Creates a consumer of all message sent to the given destination, including messages sent via the send() message with an optional SQL 92 based selector to filter messages |
MessageConsumer |
createConsumer(Destination destination,
String selector,
boolean noLocal)
Creates a consumer of all message sent to the given destination, including messages sent via the send() message with an optional SQL 92 based selector to filter messages along with optionally ignoring local traffic - messages sent via the send() method on this object. |
MapMessage |
createMapMessage()
Creates a new MapMessage |
Message |
createMessage()
Creates a new message without a body |
ObjectMessage |
createObjectMessage()
Creates a new ObjectMessage |
ObjectMessage |
createObjectMessage(Serializable object)
Creates a new ObjectMessage |
StreamMessage |
createStreamMessage()
Creates a new StreamMessage |
TextMessage |
createTextMessage()
Creates a new TextMessage |
TextMessage |
createTextMessage(String text)
Creates a new TextMessage |
Topic |
getDestination()
Returns the destination used to send a message to all members of the cluster |
LocalNode |
getLocalNode()
The local Node which allows you to mutate the state or subscribe to the nodes temporary queue for inbound messages direct to the Node |
Map |
getNodes()
A snapshot of the nodes in the cluster indexed by the Destination |
void |
removeClusterListener(ClusterListener listener)
Removes a listener to cluster events |
void |
send(Destination destination,
Message message)
Sends a message to a destination, which could be to the entire group or could be a single Node's destination |
boolean |
waitForClusterToComplete(int expectedCount,
long timeout)
wait until a the cardimality of the cluster is reaches the expected count. |
Methods inherited from interface org.codehaus.activecluster.Service |
start, stop |
Method Detail |
public Topic getDestination()
public Map getNodes()
public void addClusterListener(ClusterListener listener)
listener
- public void removeClusterListener(ClusterListener listener)
listener
- public LocalNode getLocalNode()
public void send(Destination destination, Message message) throws JMSException
destination
- is either the group topic or a node's destinationmessage
- the message to be sent
JMSException
public MessageConsumer createConsumer(Destination destination) throws JMSException
destination
-
JMSException
public MessageConsumer createConsumer(Destination destination, String selector) throws JMSException
destination
- selector
-
JMSException
public MessageConsumer createConsumer(Destination destination, String selector, boolean noLocal) throws JMSException
destination
- the destination to consume fromselector
- an optional SQL 92 filter of messages which could be nullnoLocal
- which if true messages sent via send() on this object will not be delivered to the consumer
JMSException
public Message createMessage() throws JMSException
JMSException
public BytesMessage createBytesMessage() throws JMSException
JMSException
public MapMessage createMapMessage() throws JMSException
MapMessage
JMSException
public ObjectMessage createObjectMessage() throws JMSException
ObjectMessage
JMSException
public ObjectMessage createObjectMessage(Serializable object) throws JMSException
ObjectMessage
object
-
JMSException
public StreamMessage createStreamMessage() throws JMSException
StreamMessage
JMSException
public TextMessage createTextMessage() throws JMSException
TextMessage
JMSException
public TextMessage createTextMessage(String text) throws JMSException
TextMessage
text
-
JMSException
public boolean waitForClusterToComplete(int expectedCount, long timeout) throws InterruptedException
expectedCount
- the number of expected members of a clustertimeout
- timeout in milliseconds
InterruptedException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |