org.apache.commons.messagelet
Class DistributeBridgeMDO
java.lang.Object
org.apache.commons.messagelet.MessageDrivenObjectSupport
org.apache.commons.messagelet.MessengerMDO
org.apache.commons.messagelet.BridgeMDO
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
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DistributeBridgeMDO
public DistributeBridgeMDO()
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.