org.mactor.brokers.file
Class FileMessageBroker

java.lang.Object
  extended by org.mactor.brokers.AbstractMessageBroker
      extended by org.mactor.brokers.PollingMessageBrokerTemplate
          extended by org.mactor.brokers.file.FileMessageBroker
All Implemented Interfaces:
MessageBroker

public class FileMessageBroker
extends PollingMessageBrokerTemplate

A message broker for communicating via file shares.

Author:
Lars Ivar Almli
See Also:
MessageBroker

Field Summary
 
Fields inherited from class org.mactor.brokers.PollingMessageBrokerTemplate
log
 
Constructor Summary
FileMessageBroker(MessageBrokersConfig.MessageBrokerConfig config)
           
 
Method Summary
protected  java.util.List<Message> doGetMessages(java.lang.String channel, int maxMessageCount)
          Template method called to check for incoming messages (the polling interval is defined by the message broker config)
protected  void doPublishMessage(java.lang.String channel, Message message)
          Template method called to publish a message.
 void terminate()
           
 
Methods inherited from class org.mactor.brokers.PollingMessageBrokerTemplate
onFirstSubscribe, onLastSubscribe, publish, publishWithResponse
 
Methods inherited from class org.mactor.brokers.AbstractMessageBroker
raiseOnMessage, subscribe, unsubscribe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileMessageBroker

public FileMessageBroker(MessageBrokersConfig.MessageBrokerConfig config)
                  throws MactorException
Throws:
MactorException
Method Detail

doGetMessages

protected java.util.List<Message> doGetMessages(java.lang.String channel,
                                                int maxMessageCount)
                                         throws MactorException
Description copied from class: PollingMessageBrokerTemplate
Template method called to check for incoming messages (the polling interval is defined by the message broker config)

Specified by:
doGetMessages in class PollingMessageBrokerTemplate
Parameters:
channel - the channel
maxMessageCount - the max number of messages to return (as defined in the message broker config).
Returns:
list of messages
Throws:
MactorException - if a problem occured (this will not cause the test to fail)

doPublishMessage

protected void doPublishMessage(java.lang.String channel,
                                Message message)
                         throws MactorException
Description copied from class: PollingMessageBrokerTemplate
Template method called to publish a message.

Specified by:
doPublishMessage in class PollingMessageBrokerTemplate
Parameters:
channel - the channel
message - the message
Throws:
MactorException - if a problem occured (this will cause the test to fail)

terminate

public void terminate()
Specified by:
terminate in interface MessageBroker
Overrides:
terminate in class PollingMessageBrokerTemplate


Copyright © 2008. All Rights Reserved.