org.apache.commons.messagelet
Class DistributeBridgeMDO

java.lang.Object
  extended by org.apache.commons.messagelet.MessageDrivenObjectSupport
      extended by org.apache.commons.messagelet.MessengerMDO
          extended by org.apache.commons.messagelet.BridgeMDO
              extended by org.apache.commons.messagelet.DistributeBridgeMDO
All Implemented Interfaces:
javax.jms.MessageListener, MessageDrivenObject, MessengerListener

public class DistributeBridgeMDO
extends BridgeMDO

DistributeBridgeMDO is an MDO which consumes JMS from one destination and randomly distributes them across a number of other destinations. This MDO can be used to provide a simple load balancing mechanism consuming from one destination and sending messages to a number of different physical destinations.

Version:
$Revision: 155459 $
Author:
James Strachan

Constructor Summary
DistributeBridgeMDO()
           
 
Method Summary
 void addOutputSubject(String subject)
          Adds a new output subject
 javax.jms.Destination getOutputDestination()
          Randomly chooses a destination from the list of destinations
 List getOutputDestinations()
           
protected  void validateOutputDestination()
          Validates that there is a valid output destintation that we can use.
 
Methods inherited from class org.apache.commons.messagelet.BridgeMDO
acknowledge, commit, createOutputBytesMessage, createOutputMapMessage, createOutputMessage, createOutputObjectMessage, createOutputStreamMessage, createOutputTextMessage, getBufferSize, getOutputConnection, getOutputMessenger, getOutputSubject, init, isTransacted, onMessage, processMessageHeaders, rollback, setBufferSize, setOutputConnection, setOutputDestination, setOutputMessenger, setOutputSubject, setTransacted
 
Methods inherited from class org.apache.commons.messagelet.MessengerMDO
getMessenger, getMessengerManager, setMessenger, setMessengerManager
 
Methods inherited from class org.apache.commons.messagelet.MessageDrivenObjectSupport
destroy, getLog, getServletContext, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistributeBridgeMDO

public DistributeBridgeMDO()
Method Detail

getOutputDestinations

public List getOutputDestinations()
Returns:
a List of output Destinations

addOutputSubject

public void addOutputSubject(String subject)
                      throws javax.jms.JMSException
Adds a new output subject

Throws:
javax.jms.JMSException

getOutputDestination

public javax.jms.Destination getOutputDestination()
                                           throws javax.jms.JMSException
Randomly chooses a destination from the list of destinations

Overrides:
getOutputDestination in class BridgeMDO
Throws:
javax.jms.JMSException

validateOutputDestination

protected void validateOutputDestination()
                                  throws javax.jms.JMSException,
                                         javax.servlet.ServletException
Description copied from class: BridgeMDO
Validates that there is a valid output destintation that we can use. Derivations of this class could use multiple destinations

Overrides:
validateOutputDestination in class BridgeMDO
Throws:
javax.jms.JMSException
javax.servlet.ServletException


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.