org.ocd.msgbus
Interface IMessageBus

All Known Implementing Classes:
MessageBus

public interface IMessageBus


Field Summary
static char TOPIC_SEP
          Character used to seperate Topic Names
 
Method Summary
 void addListener(java.lang.String topic, IMsgBusListener listener)
          Add a Listener to the Bus that listens for Messages delivered on a specified Topic
 void fireMessage(java.lang.String topic, MsgBusMessage msg)
          Fire a message onto the Bus This call returns quickly the implementation should process the msg in a seperate thread.
 MsgBusMessage fireMessage(java.lang.String topic, MsgBusMessage msg, boolean resultRequired)
          Fire a message onto the bus.
 MsgBusMessage fireMessage(java.lang.String topic, MsgBusMessage msg, boolean resultRequired, boolean unicast)
          Fire a message onto the bus.
 void fireMessage(java.lang.String topic, MsgBusMessage msg, IMsgBusListener resultListener)
          Fire a Message and notify the result Listener This call returns quickly the implementation should process the msg in a seperate thread.
 void removeListener(java.lang.String topic, IMsgBusListener listener)
          Remove a Listener
 

Field Detail

TOPIC_SEP

public static final char TOPIC_SEP
Character used to seperate Topic Names
Method Detail

addListener

public void addListener(java.lang.String topic,
                        IMsgBusListener listener)
Add a Listener to the Bus that listens for Messages delivered on a specified Topic
Parameters:
topic - name of topic
listener -  

removeListener

public void removeListener(java.lang.String topic,
                           IMsgBusListener listener)
Remove a Listener

fireMessage

public void fireMessage(java.lang.String topic,
                        MsgBusMessage msg)
Fire a message onto the Bus This call returns quickly the implementation should process the msg in a seperate thread.
Parameters:
topic - name of Topic
msg - message to Send

fireMessage

public void fireMessage(java.lang.String topic,
                        MsgBusMessage msg,
                        IMsgBusListener resultListener)
Fire a Message and notify the result Listener This call returns quickly the implementation should process the msg in a seperate thread. The MessageBus Listener that acts on this message should send a reply to the Reply Listener.
Parameters:
topic -  
msg - to send
listener - that should receive a reply

fireMessage

public MsgBusMessage fireMessage(java.lang.String topic,
                                 MsgBusMessage msg,
                                 boolean resultRequired)
Fire a message onto the bus. For the given Topic. This method does not use the MessageBus Processor and therefore it will block until all listeners have recieved the message. The Result from Each Listener is merged into one result and returned to this methods caller.
Parameters:
topic - to pass the message on
msg - to pass
resultRequired - true if a result should be returned from this method
Returns:
result of firing the message

fireMessage

public MsgBusMessage fireMessage(java.lang.String topic,
                                 MsgBusMessage msg,
                                 boolean resultRequired,
                                 boolean unicast)
Fire a message onto the bus. For the given Topic. This method does not use the MessageBus Processor and therefore it will block until all listeners have recieved the message. The Result from Each Listener is merged into one result and returned to this methods caller If unicast is set to true only the first Listener will receive the Message
Parameters:
topic - to pass the message on
msg - to pass
resultRequired - true if a result should be returned from this method
unicast - true if only first listener should receive the message
Returns:
result of firing the message