org.apache.activemq.network.jms
Class InboundTopicBridge

java.lang.Object
  extended by org.apache.activemq.network.jms.DestinationBridge
      extended by org.apache.activemq.network.jms.InboundTopicBridge
All Implemented Interfaces:
MessageListener, 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
protected  TopicConnection consumerConnection
           
protected  String consumerName
           
protected  TopicSession consumerSession
           
protected  Topic consumerTopic
           
protected  TopicPublisher producer
           
protected  TopicConnection producerConnection
           
protected  TopicSession producerSession
           
protected  Topic producerTopic
           
protected  String selector
           
 
Fields inherited from class org.apache.activemq.network.jms.DestinationBridge
consumer, doHandleReplyTo, jmsConnector, jmsMessageConvertor, started
 
Constructor Summary
InboundTopicBridge()
          Default Constructor
InboundTopicBridge(String inboundTopicName)
          Constructor that takes a foreign destination as an argument
 
Method Summary
protected  MessageConsumer createConsumer()
           
protected  MessageProducer createProducer()
           
protected  Connection getConnectionForProducer()
           
protected  Connection getConnnectionForConsumer()
           
 TopicConnection getConsumerConnection()
           
 String getConsumerName()
           
 Topic getConsumerTopic()
           
 String getInboundTopicName()
           
 String getLocalTopicName()
           
 TopicConnection getProducerConnection()
           
 Topic getProducerTopic()
           
 String getSelector()
           
protected  void sendMessage(Message message)
           
 void setConsumerConnection(TopicConnection consumerConnection)
           
 void setConsumerName(String consumerName)
           
 void setConsumerTopic(Topic consumerTopic)
           
 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.
 void setLocalTopicName(String localTopicName)
           
 void setProducerConnection(TopicConnection producerConnection)
           
 void setProducerTopic(Topic producerTopic)
           
 void setSelector(String selector)
           
 void stop()
           
 
Methods inherited from class org.apache.activemq.network.jms.DestinationBridge
getConsumer, getJmsMessageConvertor, isDoHandleReplyTo, onMessage, processReplyToDestination, setConsumer, setDoHandleReplyTo, setJmsConnector, setJmsMessageConvertor, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

consumerTopic

protected Topic consumerTopic

producerTopic

protected Topic producerTopic

consumerSession

protected TopicSession consumerSession

producerSession

protected TopicSession producerSession

consumerName

protected String consumerName

selector

protected String selector

producer

protected TopicPublisher producer

consumerConnection

protected TopicConnection consumerConnection

producerConnection

protected 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:
stop in interface Service
Overrides:
stop in class DestinationBridge
Throws:
Exception

createConsumer

protected MessageConsumer createConsumer()
                                  throws JMSException
Specified by:
createConsumer in class DestinationBridge
Throws:
JMSException

createProducer

protected MessageProducer createProducer()
                                  throws JMSException
Specified by:
createProducer in class DestinationBridge
Throws:
JMSException

sendMessage

protected void sendMessage(Message message)
                    throws JMSException
Specified by:
sendMessage in class DestinationBridge
Throws:
JMSException

getConsumerConnection

public TopicConnection getConsumerConnection()
Returns:
Returns the consumerConnection.

setConsumerConnection

public void setConsumerConnection(TopicConnection consumerConnection)
Parameters:
consumerConnection - The consumerConnection to set.

getConsumerName

public String getConsumerName()
Returns:
Returns the subscriptionName.

setConsumerName

public void setConsumerName(String consumerName)
Parameters:
subscriptionName - The subscriptionName to set.

getConsumerTopic

public Topic getConsumerTopic()
Returns:
Returns the consumerTopic.

setConsumerTopic

public void setConsumerTopic(Topic consumerTopic)
Parameters:
consumerTopic - The consumerTopic to set.

getProducerConnection

public TopicConnection getProducerConnection()
Returns:
Returns the producerConnection.

setProducerConnection

public void setProducerConnection(TopicConnection producerConnection)
Parameters:
producerConnection - The producerConnection to set.

getProducerTopic

public Topic getProducerTopic()
Returns:
Returns the producerTopic.

setProducerTopic

public void setProducerTopic(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 Connection getConnnectionForConsumer()
Specified by:
getConnnectionForConsumer in class DestinationBridge

getConnectionForProducer

protected Connection getConnectionForProducer()
Specified by:
getConnectionForProducer in class DestinationBridge


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.