|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.messagelet.MessageDrivenObjectSupport org.apache.commons.messagelet.MessengerMDO org.apache.commons.messagelet.BridgeMDO
public class BridgeMDO
BridgeMDO
is an MDO which implements a JMS bridge
from one JMS destination and connection to another.
This allows messages to be consumed on one destination and sent to
another JMS destination, using possibly different JMS providers.
For example this can be used to bridge from SpiritWave to MQSeries.
This class is a useful base class to other possible bridge implementations such as 2 phase commit bridges or bridges with some complex transformation etc. This class has a number of Factory and Strategy methods to further customize the acknowledgement and transaction management, the message construction, transformation and how to handle message headers etc.
Constructor Summary | |
---|---|
BridgeMDO()
|
Method Summary | |
---|---|
protected void |
acknowledge(javax.jms.Message message)
Strategy method to allow different derived classes to acknowledge messages differently, such as to disable acknowledgements |
protected void |
commit()
Strategy method to perform a commit() on both the incoming Messenger and the output Messenger. |
protected javax.jms.BytesMessage |
createOutputBytesMessage(javax.jms.BytesMessage inputMessage)
Factory method to create BytesMessage Derived classes could override this method to perform any kind of Message transformation. |
protected javax.jms.MapMessage |
createOutputMapMessage(javax.jms.MapMessage inputMessage)
Factory method to create MapMessage Derived classes could override this method to perform any kind of Message transformation. |
protected javax.jms.Message |
createOutputMessage(javax.jms.Message inputMessage)
Factory method to create an output message given an input message. |
protected javax.jms.ObjectMessage |
createOutputObjectMessage(javax.jms.ObjectMessage inputMessage)
Factory method to create ObjectMessage Derived classes could override this method to perform any kind of Message transformation. |
protected javax.jms.StreamMessage |
createOutputStreamMessage(javax.jms.StreamMessage inputMessage)
Factory method to create StreamMessage Derived classes could override this method to perform any kind of Message transformation. |
protected javax.jms.TextMessage |
createOutputTextMessage(javax.jms.TextMessage inputMessage)
Factory method to create TextMessage Derived classes could override this method to perform any kind of Message transformation. |
int |
getBufferSize()
Gets the buffer size used for ByteMessage and StreamMessage copying |
String |
getOutputConnection()
|
javax.jms.Destination |
getOutputDestination()
Gets the Destination output messages will be sent to |
Messenger |
getOutputMessenger()
Gets the Messenger used to output messages |
String |
getOutputSubject()
|
void |
init()
This method allows the init() method to be overriden without having to call the super.init( ServletContext ) method first. |
boolean |
isTransacted()
|
void |
onMessage(javax.jms.Message message)
|
protected void |
processMessageHeaders(javax.jms.Message inputMessage,
javax.jms.Message outputMessage)
Strategy method to add any headers required on the output message. |
protected void |
rollback()
Strategy method to perform a rollback() on both the incoming Messenger and the output Messenger. |
void |
setBufferSize(int bufferSize)
Sets the buffer size used for ByteMessage and StreamMessage copying |
void |
setOutputConnection(String outputConnection)
Sets the connection name (messenger instance) to use to output messages |
void |
setOutputDestination(javax.jms.Destination outputDestination)
Sets the Destination output messages will be sent to |
void |
setOutputMessenger(Messenger outputMessenger)
Sets the Messenger used to output messages |
void |
setOutputSubject(String outputSubject)
Sets the subject (i.e. |
void |
setTransacted(boolean transacted)
Sets whether this MDO should work in transacted mode |
protected void |
validateOutputDestination()
Validates that there is a valid output destintation that we can use. |
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 |
---|
public BridgeMDO()
Method Detail |
---|
public void init() throws javax.servlet.ServletException
MessageDrivenObjectSupport
GenericServlet
.
init
in class MessageDrivenObjectSupport
javax.servlet.ServletException
public void onMessage(javax.jms.Message message)
public boolean isTransacted()
public void setTransacted(boolean transacted)
public String getOutputConnection()
public void setOutputConnection(String outputConnection)
public String getOutputSubject()
public void setOutputSubject(String outputSubject)
public Messenger getOutputMessenger() throws javax.jms.JMSException
javax.jms.JMSException
public void setOutputMessenger(Messenger outputMessenger)
public javax.jms.Destination getOutputDestination() throws javax.jms.JMSException
javax.jms.JMSException
public void setOutputDestination(javax.jms.Destination outputDestination)
public int getBufferSize()
public void setBufferSize(int bufferSize)
protected void commit() throws javax.jms.JMSException
javax.jms.JMSException
protected void rollback()
protected javax.jms.Message createOutputMessage(javax.jms.Message inputMessage) throws javax.jms.JMSException
javax.jms.JMSException
protected javax.jms.ObjectMessage createOutputObjectMessage(javax.jms.ObjectMessage inputMessage) throws javax.jms.JMSException
javax.jms.JMSException
protected javax.jms.TextMessage createOutputTextMessage(javax.jms.TextMessage inputMessage) throws javax.jms.JMSException
javax.jms.JMSException
protected javax.jms.MapMessage createOutputMapMessage(javax.jms.MapMessage inputMessage) throws javax.jms.JMSException
javax.jms.JMSException
protected javax.jms.BytesMessage createOutputBytesMessage(javax.jms.BytesMessage inputMessage) throws javax.jms.JMSException
javax.jms.JMSException
protected javax.jms.StreamMessage createOutputStreamMessage(javax.jms.StreamMessage inputMessage) throws javax.jms.JMSException
javax.jms.JMSException
protected void processMessageHeaders(javax.jms.Message inputMessage, javax.jms.Message outputMessage) throws javax.jms.JMSException
javax.jms.JMSException
protected void acknowledge(javax.jms.Message message) throws javax.jms.JMSException
javax.jms.JMSException
protected void validateOutputDestination() throws javax.jms.JMSException, javax.servlet.ServletException
javax.jms.JMSException
javax.servlet.ServletException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |