use of org.apache.oozie.jms.JMSExceptionListener in project oozie by apache.
the class JMSAccessorService method createConnectionContext.
public ConnectionContext createConnectionContext(JMSConnectionInfo connInfo) {
ConnectionContext connCtxt = connectionMap.get(connInfo);
if (connCtxt == null) {
try {
connCtxt = getConnectionContextImpl();
connCtxt.createConnection(connInfo.getJNDIProperties());
connCtxt.setExceptionListener(new JMSExceptionListener(connInfo, connCtxt, true));
connectionMap.put(connInfo, connCtxt);
LOG.info("Connection established to JMS Server for [{0}]", connInfo);
} catch (Exception e) {
LOG.warn("Exception while establishing connection to JMS Server for [{0}]", connInfo, e);
return null;
}
}
return connCtxt;
}
use of org.apache.oozie.jms.JMSExceptionListener in project oozie by apache.
the class JMSAccessorService method createProducerConnectionContext.
public ConnectionContext createProducerConnectionContext(JMSConnectionInfo connInfo) {
if (jmsProducerConnContext != null && jmsProducerConnContext.isConnectionInitialized()) {
return jmsProducerConnContext;
} else {
synchronized (this) {
if (jmsProducerConnContext == null || !jmsProducerConnContext.isConnectionInitialized()) {
try {
jmsProducerConnContext = getConnectionContextImpl();
jmsProducerConnContext.createConnection(connInfo.getJNDIProperties());
jmsProducerConnContext.setExceptionListener(new JMSExceptionListener(connInfo, jmsProducerConnContext, false));
LOG.info("Connection established to JMS Server for [{0}]", connInfo);
} catch (Exception e) {
LOG.warn("Exception while establishing connection to JMS Server for [{0}]", connInfo, e);
return null;
}
}
}
}
return jmsProducerConnContext;
}
Aggregations