Package org.apache.activemq.network.jms
Class InboundTopicBridge
- java.lang.Object
-
- org.apache.activemq.network.jms.DestinationBridge
-
- org.apache.activemq.network.jms.InboundTopicBridge
-
- All Implemented Interfaces:
javax.jms.MessageListener,org.apache.activemq.Service
public class InboundTopicBridge extends DestinationBridge
Create an Inbound Topic Bridge. By default this class uses the topic name for both the inbound and outbound topic. This behavior can be overridden however by using the setter methods to configure both the inbound and outboud topic names separately.
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.jms.TopicConnectionconsumerConnectionprotected StringconsumerNameprotected javax.jms.TopicSessionconsumerSessionprotected javax.jms.TopicconsumerTopicprotected javax.jms.TopicPublisherproducerprotected javax.jms.TopicConnectionproducerConnectionprotected javax.jms.TopicSessionproducerSessionprotected javax.jms.TopicproducerTopicprotected Stringselector-
Fields inherited from class org.apache.activemq.network.jms.DestinationBridge
consumer, doHandleReplyTo, jmsConnector, jmsMessageConvertor, started
-
-
Constructor Summary
Constructors Constructor Description InboundTopicBridge()Default ConstructorInboundTopicBridge(String inboundTopicName)Constructor that takes a foreign destination as an argument
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.jms.MessageConsumercreateConsumer()protected javax.jms.MessageProducercreateProducer()protected javax.jms.ConnectiongetConnectionForProducer()protected javax.jms.ConnectiongetConnnectionForConsumer()javax.jms.TopicConnectiongetConsumerConnection()StringgetConsumerName()javax.jms.TopicgetConsumerTopic()StringgetInboundTopicName()StringgetLocalTopicName()javax.jms.TopicConnectiongetProducerConnection()javax.jms.TopicgetProducerTopic()StringgetSelector()protected voidsendMessage(javax.jms.Message message)voidsetConsumerConnection(javax.jms.TopicConnection consumerConnection)voidsetConsumerName(String consumerName)voidsetConsumerTopic(javax.jms.Topic consumerTopic)voidsetInboundTopicName(String inboundTopicName)Sets the topic name used for the inbound topic, if the outbound topic name has not been set, then this method uses the same name to configure the outbound topic name.voidsetLocalTopicName(String localTopicName)voidsetProducerConnection(javax.jms.TopicConnection producerConnection)voidsetProducerTopic(javax.jms.Topic producerTopic)voidsetSelector(String selector)voidstop()-
Methods inherited from class org.apache.activemq.network.jms.DestinationBridge
getConsumer, getJmsMessageConvertor, isDoHandleReplyTo, onMessage, processReplyToDestination, setConsumer, setDoHandleReplyTo, setJmsConnector, setJmsMessageConvertor, start
-
-
-
-
Field Detail
-
consumerTopic
protected javax.jms.Topic consumerTopic
-
producerTopic
protected javax.jms.Topic producerTopic
-
consumerSession
protected javax.jms.TopicSession consumerSession
-
producerSession
protected javax.jms.TopicSession producerSession
-
consumerName
protected String consumerName
-
selector
protected String selector
-
producer
protected javax.jms.TopicPublisher producer
-
consumerConnection
protected javax.jms.TopicConnection consumerConnection
-
producerConnection
protected javax.jms.TopicConnection producerConnection
-
-
Constructor Detail
-
InboundTopicBridge
public InboundTopicBridge(String inboundTopicName)
Constructor that takes a foreign destination as an argument- Parameters:
inboundTopicName-
-
InboundTopicBridge
public InboundTopicBridge()
Default Constructor
-
-
Method Detail
-
getInboundTopicName
public String getInboundTopicName()
- Returns:
- Returns the outboundTopicName.
-
setInboundTopicName
public void setInboundTopicName(String inboundTopicName)
Sets the topic name used for the inbound topic, if the outbound topic name has not been set, then this method uses the same name to configure the outbound topic name.- Parameters:
inboundTopicName-
-
getLocalTopicName
public String getLocalTopicName()
- Returns:
- the localTopicName
-
setLocalTopicName
public void setLocalTopicName(String localTopicName)
- Parameters:
localTopicName- the localTopicName to set
-
stop
public void stop() throws Exception- Specified by:
stopin interfaceorg.apache.activemq.Service- Overrides:
stopin classDestinationBridge- Throws:
Exception
-
createConsumer
protected javax.jms.MessageConsumer createConsumer() throws javax.jms.JMSException- Specified by:
createConsumerin classDestinationBridge- Throws:
javax.jms.JMSException
-
createProducer
protected javax.jms.MessageProducer createProducer() throws javax.jms.JMSException- Specified by:
createProducerin classDestinationBridge- Throws:
javax.jms.JMSException
-
sendMessage
protected void sendMessage(javax.jms.Message message) throws javax.jms.JMSException- Specified by:
sendMessagein classDestinationBridge- Throws:
javax.jms.JMSException
-
getConsumerConnection
public javax.jms.TopicConnection getConsumerConnection()
- Returns:
- Returns the consumerConnection.
-
setConsumerConnection
public void setConsumerConnection(javax.jms.TopicConnection consumerConnection)
- Parameters:
consumerConnection- The consumerConnection to set.
-
getConsumerName
public String getConsumerName()
- Returns:
- Returns the consumerName.
-
setConsumerName
public void setConsumerName(String consumerName)
- Parameters:
consumerName- The consumerName to set.
-
getConsumerTopic
public javax.jms.Topic getConsumerTopic()
- Returns:
- Returns the consumerTopic.
-
setConsumerTopic
public void setConsumerTopic(javax.jms.Topic consumerTopic)
- Parameters:
consumerTopic- The consumerTopic to set.
-
getProducerConnection
public javax.jms.TopicConnection getProducerConnection()
- Returns:
- Returns the producerConnection.
-
setProducerConnection
public void setProducerConnection(javax.jms.TopicConnection producerConnection)
- Parameters:
producerConnection- The producerConnection to set.
-
getProducerTopic
public javax.jms.Topic getProducerTopic()
- Returns:
- Returns the producerTopic.
-
setProducerTopic
public void setProducerTopic(javax.jms.Topic producerTopic)
- Parameters:
producerTopic- The producerTopic to set.
-
getSelector
public String getSelector()
- Returns:
- Returns the selector.
-
setSelector
public void setSelector(String selector)
- Parameters:
selector- The selector to set.
-
getConnnectionForConsumer
protected javax.jms.Connection getConnnectionForConsumer()
- Specified by:
getConnnectionForConsumerin classDestinationBridge
-
getConnectionForProducer
protected javax.jms.Connection getConnectionForProducer()
- Specified by:
getConnectionForProducerin classDestinationBridge
-
-