public abstract class JmsConnector extends Object implements Service
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() |
String |
getLocalClientId() |
javax.jms.Connection |
getLocalConnection() |
String |
getLocalPassword() |
String |
getLocalUsername() |
String |
getName() |
String |
getOutboundClientId() |
JmsMesageConvertor |
getOutboundMessageConvertor() |
String |
getOutboundPassword() |
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(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 |
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 AtomicBoolean initialized
protected AtomicBoolean localSideInitialized
protected AtomicBoolean foreignSideInitialized
protected AtomicBoolean started
protected AtomicBoolean failed
protected AtomicReference<javax.jms.Connection> foreignConnection
protected AtomicReference<javax.jms.Connection> localConnection
protected ActiveMQConnectionFactory embeddedConnectionFactory
protected int replyToDestinationCacheSize
protected String outboundUsername
protected String outboundPassword
protected String localUsername
protected String localPassword
protected String outboundClientId
protected String localClientId
protected LRUCache<javax.jms.Destination,DestinationBridge> replyToBridges
protected ThreadPoolExecutor connectionService
public JmsConnector()
public boolean init()
protected boolean doConnectorInit()
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)
jmsMessageConvertor
- The jmsMessageConvertor 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 String getLocalPassword()
public void setLocalPassword(String localPassword)
localPassword
- The localPassword to set.public String getLocalUsername()
public void setLocalUsername(String localUsername)
localUsername
- The localUsername to set.public String getOutboundPassword()
public void setOutboundPassword(String outboundPassword)
outboundPassword
- The outboundPassword to set.public String getOutboundUsername()
public void setOutboundUsername(String outboundUsername)
outboundUsername
- The outboundUsername to set.public String getOutboundClientId()
public void setOutboundClientId(String outboundClientId)
outboundClientId
- the outboundClientId to setpublic String getLocalClientId()
public void setLocalClientId(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 boolean isFailed()
protected abstract void initializeLocalConnection() throws 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.
Exception
- if the connection cannot be established for any reason.protected abstract void initializeForeignConnection() throws 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.
Exception
- if the connection cannot be established for any reason.Copyright © 2005–2019 The Apache Software Foundation. All rights reserved.