|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MessageBroker
Defines the message broker interface
Message broker implementations is not requiered to implement both publish and subscribe (UnsupportedOperationException should be thrown by methods not implemented by the message broker)
Message broker implementations must have contructor that takes a
MessageBrokerConfigas the single parameter
The simplest way to implement a message broker is to extend the AbstractMessageBroker class, or the PollingMessageBrokerTemplate if the protocol is polling based (i.e. the case for FilesMessageBroker)
Method Summary | |
---|---|
void |
publish(java.lang.String channel,
Message message)
Publish a message to a channel |
Message |
publishWithResponse(java.lang.String channel,
Message message)
Publish a message and expect a reponse (when dealing with synchrounous protcols) |
void |
subscribe(java.lang.String channel,
MessageSubscriber subscriber,
MessageSelectorCommand messageSelector)
Subscibe to message from a channel |
void |
terminate()
|
void |
unsubscribe(java.lang.String channel,
MessageSubscriber subscriber)
Unsubscribe |
Method Detail |
---|
void subscribe(java.lang.String channel, MessageSubscriber subscriber, MessageSelectorCommand messageSelector) throws MactorException
channel
- the channelsubscriber
- the subscriber that will receive the messagesmessageSelector
- the message selector restricts which messages to receive from
the channel
MactorException
- if some problem occures (this will cause the test to fail)void unsubscribe(java.lang.String channel, MessageSubscriber subscriber) throws MactorException
channel
- the channelsubscriber
- the subscriber
MactorException
- if some problem occuresvoid publish(java.lang.String channel, Message message) throws MactorException
channel
- the channelmessage
- the message
MactorException
- if some problem occures (this will cause the test to fail)Message publishWithResponse(java.lang.String channel, Message message) throws MactorException
channel
- the channelmessage
- the message
MactorException
- if some problem occures (this will cause the test to fail)void terminate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |