Package org.apache.activemq.network.jms
Class DestinationBridge
- java.lang.Object
-
- org.apache.activemq.network.jms.DestinationBridge
-
- All Implemented Interfaces:
MessageListener
,Service
- Direct Known Subclasses:
InboundQueueBridge
,InboundTopicBridge
,OutboundQueueBridge
,OutboundTopicBridge
public abstract class DestinationBridge extends Object implements Service, MessageListener
A Destination bridge is used to bridge between to different JMS systems
-
-
Field Summary
Fields Modifier and Type Field Description protected MessageConsumer
consumer
protected boolean
doHandleReplyTo
protected JmsConnector
jmsConnector
protected JmsMesageConvertor
jmsMessageConvertor
protected AtomicBoolean
started
-
Constructor Summary
Constructors Constructor Description DestinationBridge()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract MessageConsumer
createConsumer()
protected abstract MessageProducer
createProducer()
protected abstract Connection
getConnectionForProducer()
protected abstract Connection
getConnnectionForConsumer()
MessageConsumer
getConsumer()
JmsMesageConvertor
getJmsMessageConvertor()
boolean
isDoHandleReplyTo()
void
onMessage(Message message)
protected Destination
processReplyToDestination(Destination destination)
protected abstract void
sendMessage(Message message)
void
setConsumer(MessageConsumer consumer)
void
setDoHandleReplyTo(boolean doHandleReplyTo)
void
setJmsConnector(JmsConnector connector)
void
setJmsMessageConvertor(JmsMesageConvertor jmsMessageConvertor)
void
start()
void
stop()
-
-
-
Field Detail
-
consumer
protected MessageConsumer consumer
-
started
protected AtomicBoolean started
-
jmsMessageConvertor
protected JmsMesageConvertor jmsMessageConvertor
-
doHandleReplyTo
protected boolean doHandleReplyTo
-
jmsConnector
protected JmsConnector jmsConnector
-
-
Method Detail
-
getConsumer
public MessageConsumer getConsumer()
- Returns:
- Returns the consumer.
-
setConsumer
public void setConsumer(MessageConsumer consumer)
- Parameters:
consumer
- The consumer to set.
-
setJmsConnector
public void setJmsConnector(JmsConnector connector)
- Parameters:
connector
-
-
getJmsMessageConvertor
public JmsMesageConvertor getJmsMessageConvertor()
- Returns:
- Returns the inboundMessageConvertor.
-
setJmsMessageConvertor
public void setJmsMessageConvertor(JmsMesageConvertor jmsMessageConvertor)
- Parameters:
jmsMessageConvertor
-
-
processReplyToDestination
protected Destination processReplyToDestination(Destination destination)
-
start
public void start() throws Exception
-
onMessage
public void onMessage(Message message)
- Specified by:
onMessage
in interfaceMessageListener
-
isDoHandleReplyTo
public boolean isDoHandleReplyTo()
- Returns:
- Returns the doHandleReplyTo.
-
setDoHandleReplyTo
public void setDoHandleReplyTo(boolean doHandleReplyTo)
- Parameters:
doHandleReplyTo
- The doHandleReplyTo to set.
-
createConsumer
protected abstract MessageConsumer createConsumer() throws JMSException
- Throws:
JMSException
-
createProducer
protected abstract MessageProducer createProducer() throws JMSException
- Throws:
JMSException
-
sendMessage
protected abstract void sendMessage(Message message) throws JMSException
- Throws:
JMSException
-
getConnnectionForConsumer
protected abstract Connection getConnnectionForConsumer()
-
getConnectionForProducer
protected abstract Connection getConnectionForProducer()
-
-