public abstract class JmsConnector extends java.lang.Object implements Service
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.ThreadPoolExecutor |
connectionSerivce |
protected ActiveMQConnectionFactory |
embeddedConnectionFactory |
protected java.util.concurrent.atomic.AtomicBoolean |
failed |
protected java.util.concurrent.atomic.AtomicReference<javax.jms.Connection> |
foreignConnection |
protected java.util.concurrent.atomic.AtomicBoolean |
foreignSideInitialized |
protected JmsMesageConvertor |
inboundMessageConvertor |
protected java.util.concurrent.atomic.AtomicBoolean |
initialized |
protected JndiLookupFactory |
jndiLocalTemplate |
protected JndiLookupFactory |
jndiOutboundTemplate |
protected java.lang.String |
localClientId |
protected java.util.concurrent.atomic.AtomicReference<javax.jms.Connection> |
localConnection |
protected java.lang.String |
localPassword |
protected java.util.concurrent.atomic.AtomicBoolean |
localSideInitialized |
protected java.lang.String |
localUsername |
protected java.lang.String |
outboundClientId |
protected JmsMesageConvertor |
outboundMessageConvertor |
protected java.lang.String |
outboundPassword |
protected java.lang.String |
outboundUsername |
protected boolean |
preferJndiDestinationLookup |
protected LRUCache<javax.jms.Destination,DestinationBridge> |
replyToBridges |
protected int |
replyToDestinationCacheSize |
protected java.util.concurrent.atomic.AtomicBoolean |
started |
| Constructor and Description |
|---|
JmsConnector() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addInboundBridge(DestinationBridge bridge) |
protected void |
addOutboundBridge(DestinationBridge bridge) |
void |
clearBridges() |
protected abstract javax.jms.Destination |
createReplyToBridge(javax.jms.Destination destination,
javax.jms.Connection consumerConnection,
javax.jms.Connection producerConnection) |
protected boolean |
doConnectorInit() |
javax.jms.Connection |
getForeignConnection() |
JmsMesageConvertor |
getInboundMessageConvertor() |
JndiLookupFactory |
getJndiLocalTemplate() |
JndiLookupFactory |
getJndiOutboundTemplate() |
java.lang.String |
getLocalClientId() |
javax.jms.Connection |
getLocalConnection() |
java.lang.String |
getLocalPassword() |
java.lang.String |
getLocalUsername() |
java.lang.String |
getName() |
java.lang.String |
getOutboundClientId() |
JmsMesageConvertor |
getOutboundMessageConvertor() |
java.lang.String |
getOutboundPassword() |
java.lang.String |
getOutboundUsername() |
ReconnectionPolicy |
getReconnectionPolicy() |
int |
getReplyToDestinationCacheSize() |
boolean |
init() |
protected abstract void |
initializeForeignConnection()
Performs the work of connection to the foreign side of the Connection.
|
protected abstract void |
initializeLocalConnection()
Performs the work of connection to the local side of the Connection.
|
boolean |
isConnected() |
boolean |
isFailed() |
boolean |
isPreferJndiDestinationLookup() |
protected void |
removeInboundBridge(DestinationBridge bridge) |
protected void |
removeOutboundBridge(DestinationBridge bridge) |
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(JndiLookupFactory jndiTemplate) |
void |
setJndiOutboundTemplate(JndiLookupFactory jndiOutboundTemplate) |
void |
setLocalClientId(java.lang.String localClientId) |
void |
setLocalPassword(java.lang.String localPassword) |
void |
setLocalUsername(java.lang.String localUsername) |
void |
setName(java.lang.String name) |
void |
setOutboundClientId(java.lang.String outboundClientId) |
void |
setOutboundMessageConvertor(JmsMesageConvertor outboundMessageConvertor) |
void |
setOutboundPassword(java.lang.String outboundPassword) |
void |
setOutboundUsername(java.lang.String outboundUsername) |
void |
setPreferJndiDestinationLookup(boolean preferJndiDestinationLookup)
Sets whether the connector should prefer to first try to find a destination in JNDI before
using JMS semantics to create a Destination.
|
void |
setReconnectionPolicy(ReconnectionPolicy policy) |
void |
setReplyToDestinationCacheSize(int replyToDestinationCacheSize) |
void |
start() |
void |
stop() |
protected boolean preferJndiDestinationLookup
protected JndiLookupFactory jndiLocalTemplate
protected JndiLookupFactory jndiOutboundTemplate
protected JmsMesageConvertor inboundMessageConvertor
protected JmsMesageConvertor outboundMessageConvertor
protected java.util.concurrent.atomic.AtomicBoolean initialized
protected java.util.concurrent.atomic.AtomicBoolean localSideInitialized
protected java.util.concurrent.atomic.AtomicBoolean foreignSideInitialized
protected java.util.concurrent.atomic.AtomicBoolean started
protected java.util.concurrent.atomic.AtomicBoolean failed
protected java.util.concurrent.atomic.AtomicReference<javax.jms.Connection> foreignConnection
protected java.util.concurrent.atomic.AtomicReference<javax.jms.Connection> localConnection
protected ActiveMQConnectionFactory embeddedConnectionFactory
protected int replyToDestinationCacheSize
protected java.lang.String outboundUsername
protected java.lang.String outboundPassword
protected java.lang.String localUsername
protected java.lang.String localPassword
protected java.lang.String outboundClientId
protected java.lang.String localClientId
protected LRUCache<javax.jms.Destination,DestinationBridge> replyToBridges
protected java.util.concurrent.ThreadPoolExecutor connectionSerivce
public boolean init()
protected boolean doConnectorInit()
public void start()
throws java.lang.Exception
public void stop()
throws java.lang.Exception
public void clearBridges()
protected abstract javax.jms.Destination createReplyToBridge(javax.jms.Destination destination,
javax.jms.Connection consumerConnection,
javax.jms.Connection producerConnection)
public void setBrokerService(BrokerService service)
service - public javax.jms.Connection getLocalConnection()
public javax.jms.Connection getForeignConnection()
public JndiLookupFactory getJndiLocalTemplate()
public void setJndiLocalTemplate(JndiLookupFactory jndiTemplate)
jndiTemplate - The jndiTemplate to set.public JndiLookupFactory getJndiOutboundTemplate()
public void setJndiOutboundTemplate(JndiLookupFactory jndiOutboundTemplate)
jndiOutboundTemplate - The jndiOutboundTemplate to set.public JmsMesageConvertor getInboundMessageConvertor()
public void setInboundMessageConvertor(JmsMesageConvertor jmsMessageConvertor)
inboundMessageConvertor - The inboundMessageConvertor to set.public JmsMesageConvertor getOutboundMessageConvertor()
public void setOutboundMessageConvertor(JmsMesageConvertor outboundMessageConvertor)
outboundMessageConvertor - The outboundMessageConvertor to set.public int getReplyToDestinationCacheSize()
public void setReplyToDestinationCacheSize(int replyToDestinationCacheSize)
replyToDestinationCacheSize - The replyToDestinationCacheSize to set.public java.lang.String getLocalPassword()
public void setLocalPassword(java.lang.String localPassword)
localPassword - The localPassword to set.public java.lang.String getLocalUsername()
public void setLocalUsername(java.lang.String localUsername)
localUsername - The localUsername to set.public java.lang.String getOutboundPassword()
public void setOutboundPassword(java.lang.String outboundPassword)
outboundPassword - The outboundPassword to set.public java.lang.String getOutboundUsername()
public void setOutboundUsername(java.lang.String outboundUsername)
outboundUsername - The outboundUsername to set.public java.lang.String getOutboundClientId()
public void setOutboundClientId(java.lang.String outboundClientId)
outboundClientId - the outboundClientId to setpublic java.lang.String getLocalClientId()
public void setLocalClientId(java.lang.String localClientId)
localClientId - the localClientId to setpublic ReconnectionPolicy getReconnectionPolicy()
public void setReconnectionPolicy(ReconnectionPolicy policy)
policy - The new reconnection policy this JmsConnector should use.public boolean isPreferJndiDestinationLookup()
public void setPreferJndiDestinationLookup(boolean preferJndiDestinationLookup)
preferJndiDestinationLookup - the preferJndiDestinationLookup to setpublic boolean isConnected()
JmsConnector is connected to both brokers.protected void addInboundBridge(DestinationBridge bridge)
protected void addOutboundBridge(DestinationBridge bridge)
protected void removeInboundBridge(DestinationBridge bridge)
protected void removeOutboundBridge(DestinationBridge bridge)
public java.lang.String getName()
public void setName(java.lang.String name)
public boolean isFailed()
protected abstract void initializeLocalConnection()
throws java.lang.Exception
This creates the initial connection to the local end of the JmsConnector
and then sets up all the destination bridges with the information needed to bridge
on the local side of the connection.
java.lang.Exception - if the connection cannot be established for any reason.protected abstract void initializeForeignConnection()
throws java.lang.Exception
This creates the initial connection to the foreign end of the JmsConnector
and then sets up all the destination bridges with the information needed to bridge
on the foreign side of the connection.
java.lang.Exception - if the connection cannot be established for any reason.Copyright © 2005-2016 Red Hat, Inc.. All Rights Reserved.