public class JMSModule extends Object implements ExceptionListener, Serializable, JMSModuleMBean
Modifier and Type | Class and Description |
---|---|
protected class |
JMSModule.ReconnectionDaemon
The
ReconnectionDaemon thread is responsible for reconnecting
the bridge module with the foreign JMS server in case of disconnection. |
protected class |
JMSModule.StartupDaemon
The
StartupDaemon thread is responsible for retrieving the
needed JMS administered objects from the JNDI server. |
Modifier and Type | Field and Description |
---|---|
protected String |
clientID
JMS clientID field.
|
protected Connection |
cnx
Connection to the foreign JMS server.
|
protected ConnectionFactory |
cnxFact
Connection factory object for connecting to the foreign JMS server.
|
protected String |
cnxFactName
ConnectionFactory JNDI name.
|
static int |
FAILING |
protected String |
jndiFactory
Name of the JNDI factory class to use.
|
protected String |
jndiUrl
JNDI URL.
|
private List<JMSAcquisition.JmsListener> |
listeners |
private static Logger |
logger |
private String |
name
the name identifying the remote JMS provider
|
protected boolean |
notUsable
true if the module is fully usable. |
protected String |
notUsableMessage
Message explaining why the module is not usable.
|
static int |
OK |
protected String |
password
User password for connecting to the foreign JMS server.
|
protected JMSModule.ReconnectionDaemon |
reconnectionDaemon
Daemon used for the reconnection process.
|
private static long |
serialVersionUID
define serialVersionUID for interoperability, fix with 5.15.0 value.
|
static int |
STARTING |
private int |
status |
static int |
UNKNOWN |
protected String |
userName
User identification for connecting to the foreign JMS server.
|
Constructor and Description |
---|
JMSModule(String name,
String cnxFactoryName,
String jndiFactoryClass,
String jndiUrl,
String user,
String password,
String clientID) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
addExceptionListener(JMSAcquisition.JmsListener listener) |
protected void |
doConnect()
Opens a connection with the foreign JMS server and creates the JMS
resources for interacting with the foreign JMS destination.
|
String |
getClientID()
JMS clientID field.
|
Connection |
getCnx() |
String |
getCnxFactName()
ConnectionFactory JNDI name.
|
protected Context |
getInitialContext() |
private String |
getMBeanName() |
String |
getName() |
String |
getNamingFactory()
Name of the JNDI factory class to use.
|
String |
getNamingURL()
JNDI URL.
|
String |
getState() |
int |
getStatus() |
String |
getUserName() |
boolean |
isConnectionOpen() |
void |
onException(JMSException exc)
Implements the
javax.jms.ExceptionListener interface for
catching the failures of the connection to the remote JMS server. |
(package private) void |
removeExceptionListener(JMSAcquisition.JmsListener listener) |
protected Object |
retrieveJndiObject(String jndiName) |
void |
startLiveConnection()
Launches the connection process to the foreign JMS server.
|
void |
stopLiveConnection() |
private static final long serialVersionUID
private static final Logger logger
protected transient boolean notUsable
true
if the module is fully usable.protected transient String notUsableMessage
protected transient JMSModule.ReconnectionDaemon reconnectionDaemon
protected transient volatile Connection cnx
private String name
protected String userName
protected String password
protected String jndiFactory
protected String jndiUrl
protected String cnxFactName
protected String clientID
protected transient ConnectionFactory cnxFact
private int status
public static final int UNKNOWN
public static final int STARTING
public static final int OK
public static final int FAILING
private transient List<JMSAcquisition.JmsListener> listeners
public Connection getCnx()
public String getName()
public String getUserName()
getUserName
in interface JMSModuleMBean
public String getNamingFactory()
JMSModuleMBean
getNamingFactory
in interface JMSModuleMBean
public String getNamingURL()
JMSModuleMBean
getNamingURL
in interface JMSModuleMBean
public String getCnxFactName()
JMSModuleMBean
getCnxFactName
in interface JMSModuleMBean
public String getClientID()
JMSModuleMBean
getClientID
in interface JMSModuleMBean
public void stopLiveConnection()
public void startLiveConnection()
IllegalStateException
- If the module can't access the foreign JMS server.JMSException
- If the needed JMS resources can't be created.protected Object retrieveJndiObject(String jndiName) throws Exception
Exception
protected Context getInitialContext() throws IOException, NamingException
IOException
NamingException
protected void doConnect() throws JMSException
JMSException
- If the needed JMS resources could not be created.public void onException(JMSException exc)
javax.jms.ExceptionListener
interface for
catching the failures of the connection to the remote JMS server.
Reacts by launching a reconnection process.
onException
in interface ExceptionListener
public boolean isConnectionOpen()
public int getStatus()
public String getState()
getState
in interface JMSModuleMBean
private String getMBeanName()
void removeExceptionListener(JMSAcquisition.JmsListener listener)
void addExceptionListener(JMSAcquisition.JmsListener listener)
Copyright © 2023 ScalAgent D.T.. All rights reserved.