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() |
org.springframework.jndi.JndiTemplate |
getJndiLocalTemplate() |
org.springframework.jndi.JndiTemplate |
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() |
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(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 |
setReconnectionPolicy(ReconnectionPolicy policy) |
void |
setReplyToDestinationCacheSize(int replyToDestinationCacheSize) |
void |
start() |
void |
stop() |
protected org.springframework.jndi.JndiTemplate jndiLocalTemplate
protected org.springframework.jndi.JndiTemplate 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 connectionSerivce
public boolean init()
protected boolean doConnectorInit()
public void start() throws 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 org.springframework.jndi.JndiTemplate getJndiLocalTemplate()
public void setJndiLocalTemplate(org.springframework.jndi.JndiTemplate jndiTemplate)
jndiTemplate
- The jndiTemplate to set.public org.springframework.jndi.JndiTemplate getJndiOutboundTemplate()
public void setJndiOutboundTemplate(org.springframework.jndi.JndiTemplate 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 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 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 String getName()
public void setName(String name)
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–2013 The Apache Software Foundation. All rights reserved.