org.apache.activemq.network.jms
Class JmsConnector

java.lang.Object
  extended by org.apache.activemq.network.jms.JmsConnector
All Implemented Interfaces:
Service
Direct Known Subclasses:
JmsQueueConnector, JmsTopicConnector

public abstract class JmsConnector
extends Object
implements Service

This bridge joins the gap between foreign JMS providers and ActiveMQ As some JMS providers are still only 1.0.1 compliant, this bridge itself aimed to be JMS 1.0.2 compliant.

Version:
$Revision: 1.1.1.1 $

Field Summary
protected  ActiveMQConnectionFactory embeddedConnectionFactory
           
protected  JmsMesageConvertor inboundMessageConvertor
           
protected  AtomicBoolean initialized
           
protected  org.springframework.jndi.JndiTemplate jndiLocalTemplate
           
protected  org.springframework.jndi.JndiTemplate jndiOutboundTemplate
           
protected  String localClientId
           
protected  String localPassword
           
protected  String localUsername
           
protected  String outboundClientId
           
protected  JmsMesageConvertor outboundMessageConvertor
           
protected  String outboundPassword
           
protected  String outboundUsername
           
protected  LRUCache replyToBridges
           
protected  int replyToDestinationCacheSize
           
protected  AtomicBoolean started
           
 
Constructor Summary
JmsConnector()
           
 
Method Summary
protected  void addInboundBridge(DestinationBridge bridge)
           
protected  void addOutboundBridge(DestinationBridge bridge)
           
 void clearBridges()
           
protected abstract  Destination createReplyToBridge(Destination destination, Connection consumerConnection, Connection producerConnection)
           
 JmsMesageConvertor getInboundMessageConvertor()
           
 org.springframework.jndi.JndiTemplate getJndiLocalTemplate()
           
 org.springframework.jndi.JndiTemplate getJndiOutboundTemplate()
           
 String getLocalClientId()
           
 String getLocalPassword()
           
 String getLocalUsername()
           
 String getName()
           
 String getOutboundClientId()
           
 JmsMesageConvertor getOutboundMessageConvertor()
           
 String getOutboundPassword()
           
 String getOutboundUsername()
           
 int getReplyToDestinationCacheSize()
           
 boolean init()
           
protected  void removeInboundBridge(DestinationBridge bridge)
           
protected  void removeOutboundBridge(DestinationBridge bridge)
           
abstract  void restartProducerConnection()
           
 void setBrokerService(BrokerService service)
          One way to configure the local connection - this is called by The BrokerService when the Connector is embedded
 void setInboundMessageConvertor(JmsMesageConvertor jmsMessageConvertor)
           
 void setJndiLocalTemplate(org.springframework.jndi.JndiTemplate jndiTemplate)
           
 void setJndiOutboundTemplate(org.springframework.jndi.JndiTemplate jndiOutboundTemplate)
           
 void setLocalClientId(String localClientId)
           
 void setLocalPassword(String localPassword)
           
 void setLocalUsername(String localUsername)
           
 void setName(String name)
           
 void setOutboundClientId(String outboundClientId)
           
 void setOutboundMessageConvertor(JmsMesageConvertor outboundMessageConvertor)
           
 void setOutboundPassword(String outboundPassword)
           
 void setOutboundUsername(String outboundUsername)
           
 void setReplyToDestinationCacheSize(int replyToDestinationCacheSize)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jndiLocalTemplate

protected org.springframework.jndi.JndiTemplate jndiLocalTemplate

jndiOutboundTemplate

protected org.springframework.jndi.JndiTemplate jndiOutboundTemplate

inboundMessageConvertor

protected JmsMesageConvertor inboundMessageConvertor

outboundMessageConvertor

protected JmsMesageConvertor outboundMessageConvertor

initialized

protected AtomicBoolean initialized

started

protected AtomicBoolean started

embeddedConnectionFactory

protected ActiveMQConnectionFactory embeddedConnectionFactory

replyToDestinationCacheSize

protected int replyToDestinationCacheSize

outboundUsername

protected String outboundUsername

outboundPassword

protected String outboundPassword

localUsername

protected String localUsername

localPassword

protected String localPassword

outboundClientId

protected String outboundClientId

localClientId

protected String localClientId

replyToBridges

protected LRUCache replyToBridges
Constructor Detail

JmsConnector

public JmsConnector()
Method Detail

init

public boolean init()

start

public void start()
           throws Exception
Specified by:
start in interface Service
Throws:
Exception

stop

public void stop()
          throws Exception
Specified by:
stop in interface Service
Throws:
Exception

clearBridges

public void clearBridges()

createReplyToBridge

protected abstract Destination createReplyToBridge(Destination destination,
                                                   Connection consumerConnection,
                                                   Connection producerConnection)

setBrokerService

public void setBrokerService(BrokerService service)
One way to configure the local connection - this is called by The BrokerService when the Connector is embedded

Parameters:
service -

getJndiLocalTemplate

public org.springframework.jndi.JndiTemplate getJndiLocalTemplate()
Returns:
Returns the jndiTemplate.

setJndiLocalTemplate

public void setJndiLocalTemplate(org.springframework.jndi.JndiTemplate jndiTemplate)
Parameters:
jndiTemplate - The jndiTemplate to set.

getJndiOutboundTemplate

public org.springframework.jndi.JndiTemplate getJndiOutboundTemplate()
Returns:
Returns the jndiOutboundTemplate.

setJndiOutboundTemplate

public void setJndiOutboundTemplate(org.springframework.jndi.JndiTemplate jndiOutboundTemplate)
Parameters:
jndiOutboundTemplate - The jndiOutboundTemplate to set.

getInboundMessageConvertor

public JmsMesageConvertor getInboundMessageConvertor()
Returns:
Returns the inboundMessageConvertor.

setInboundMessageConvertor

public void setInboundMessageConvertor(JmsMesageConvertor jmsMessageConvertor)
Parameters:
inboundMessageConvertor - The inboundMessageConvertor to set.

getOutboundMessageConvertor

public JmsMesageConvertor getOutboundMessageConvertor()
Returns:
Returns the outboundMessageConvertor.

setOutboundMessageConvertor

public void setOutboundMessageConvertor(JmsMesageConvertor outboundMessageConvertor)
Parameters:
outboundMessageConvertor - The outboundMessageConvertor to set.

getReplyToDestinationCacheSize

public int getReplyToDestinationCacheSize()
Returns:
Returns the replyToDestinationCacheSize.

setReplyToDestinationCacheSize

public void setReplyToDestinationCacheSize(int replyToDestinationCacheSize)
Parameters:
replyToDestinationCacheSize - The replyToDestinationCacheSize to set.

getLocalPassword

public String getLocalPassword()
Returns:
Returns the localPassword.

setLocalPassword

public void setLocalPassword(String localPassword)
Parameters:
localPassword - The localPassword to set.

getLocalUsername

public String getLocalUsername()
Returns:
Returns the localUsername.

setLocalUsername

public void setLocalUsername(String localUsername)
Parameters:
localUsername - The localUsername to set.

getOutboundPassword

public String getOutboundPassword()
Returns:
Returns the outboundPassword.

setOutboundPassword

public void setOutboundPassword(String outboundPassword)
Parameters:
outboundPassword - The outboundPassword to set.

getOutboundUsername

public String getOutboundUsername()
Returns:
Returns the outboundUsername.

setOutboundUsername

public void setOutboundUsername(String outboundUsername)
Parameters:
outboundUsername - The outboundUsername to set.

getOutboundClientId

public String getOutboundClientId()
Returns:
the outboundClientId

setOutboundClientId

public void setOutboundClientId(String outboundClientId)
Parameters:
outboundClientId - the outboundClientId to set

getLocalClientId

public String getLocalClientId()
Returns:
the localClientId

setLocalClientId

public void setLocalClientId(String localClientId)
Parameters:
localClientId - the localClientId to set

addInboundBridge

protected void addInboundBridge(DestinationBridge bridge)

addOutboundBridge

protected void addOutboundBridge(DestinationBridge bridge)

removeInboundBridge

protected void removeInboundBridge(DestinationBridge bridge)

removeOutboundBridge

protected void removeOutboundBridge(DestinationBridge bridge)

getName

public String getName()

setName

public void setName(String name)

restartProducerConnection

public abstract void restartProducerConnection()
                                        throws NamingException,
                                               JMSException
Throws:
NamingException
JMSException


Copyright © 2005-2011 Apache Software Foundation. All Rights Reserved.