newConnection.setExceptionListener(new ExceptionListener() { @Override public void onException(JMSException exception) {
newConnection.setExceptionListener(new ExceptionListener() { @Override public void onException(JMSException exception) {
private void subscribe() throws JMSException { // get context / create connection and session / etc. TopicConnection connection = ... connection.setExceptionListener(this::handleExceptions); connection.start(); }
private TopicConnection getTopicConnection() throws Exception { if (topicConnection == null) { synchronized(monitor) { if (topicConnection == null) { topicConnection = topicConnectionInstance.get(); topicConnection.setExceptionListener(new ExceptionListener() { public void onException(JMSException ex) { // swallow the exception for now - do we need to try and reconnect??? } }); topicConnection.start(); } } } return topicConnection; }
private TopicConnection getTopicConnection() throws Exception { if (topicConnection == null) { synchronized(monitor) { if (topicConnection == null) { topicConnection = org.jboss.seam.jms.TopicConnection.instance(); topicConnection.setExceptionListener(new ExceptionListener() { public void onException(JMSException ex) { // swallow the exception for now - do we need to try and reconnect??? } }); topicConnection.start(); } } } return topicConnection; }
result.setExceptionListener(this); log.debug("Using topic connection " + result); return result;
protected void connect() { try { Context ctx = newContext(); TopicConnectionFactory tcf = (TopicConnectionFactory) ctx.lookup(_tcfName); Topic topic = (Topic) ctx.lookup(_topicName); ctx.close(); _connection = tcf.createTopicConnection(); // false == not transacted. _session = _connection.createTopicSession (false, Session.AUTO_ACKNOWLEDGE); // create a publisher _publisher = _session.createPublisher(topic); // create a subscriber. TopicSubscriber s = _session.createSubscriber(topic, null, /* noLocal: */ true); MessageListener l = getMessageListener(); s.setMessageListener(l); _connection.start(); _connection.setExceptionListener(this); if (log.isInfoEnabled()) log.info(s_loc.get("jms-start-listener", _topicName)); } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new UserException(s_loc.get("jms-provider-config", _topicName, _tcfName), e).setFatal(true); } }
newConnection.setExceptionListener(new ExceptionListener() { @Override public void onException(JMSException exception) {
protected void connect() { try { Context ctx = newContext(); TopicConnectionFactory tcf = (TopicConnectionFactory) ctx.lookup(_tcfName); Topic topic = (Topic) ctx.lookup(_topicName); ctx.close(); _connection = tcf.createTopicConnection(); // false == not transacted. _session = _connection.createTopicSession (false, Session.AUTO_ACKNOWLEDGE); // create a publisher _publisher = _session.createPublisher(topic); // create a subscriber. TopicSubscriber s = _session.createSubscriber(topic, null, /* noLocal: */ true); MessageListener l = getMessageListener(); s.setMessageListener(l); _connection.start(); _connection.setExceptionListener(this); if (log.isInfoEnabled()) log.info(s_loc.get("jms-start-listener", _topicName)); } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new UserException(s_loc.get("jms-provider-config", _topicName, _tcfName), e).setFatal(true); } }
protected void connect() { try { Context ctx = newContext(); TopicConnectionFactory tcf = (TopicConnectionFactory) ctx.lookup(_tcfName); Topic topic = (Topic) ctx.lookup(_topicName); ctx.close(); _connection = tcf.createTopicConnection(); // false == not transacted. _session = _connection.createTopicSession (false, Session.AUTO_ACKNOWLEDGE); // create a publisher _publisher = _session.createPublisher(topic); // create a subscriber. TopicSubscriber s = _session.createSubscriber(topic, null, /* noLocal: */ true); MessageListener l = getMessageListener(); s.setMessageListener(l); _connection.start(); _connection.setExceptionListener(this); if (log.isInfoEnabled()) log.info(s_loc.get("jms-start-listener", _topicName)); } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new UserException(s_loc.get("jms-provider-config", _topicName, _tcfName), e).setFatal(true); } }
newConnection.setExceptionListener(new ExceptionListener() { @Override public void onException(JMSException exception) {
protected void connect() { try { Context ctx = newContext(); TopicConnectionFactory tcf = (TopicConnectionFactory) ctx.lookup(_tcfName); Topic topic = (Topic) ctx.lookup(_topicName); ctx.close(); _connection = tcf.createTopicConnection(); // false == not transacted. _session = _connection.createTopicSession (false, Session.AUTO_ACKNOWLEDGE); // create a publisher _publisher = _session.createPublisher(topic); // create a subscriber. TopicSubscriber s = _session.createSubscriber(topic, null, /* noLocal: */ true); MessageListener l = getMessageListener(); s.setMessageListener(l); _connection.start(); _connection.setExceptionListener(this); if (log.isInfoEnabled()) log.info(s_loc.get("jms-start-listener", _topicName)); } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new UserException(s_loc.get("jms-provider-config", _topicName, _tcfName), e).setFatal(true); } }
protected void connect() { try { Context ctx = newContext(); TopicConnectionFactory tcf = (TopicConnectionFactory) ctx.lookup(_tcfName); Topic topic = (Topic) ctx.lookup(_topicName); ctx.close(); _connection = tcf.createTopicConnection(); // false == not transacted. _session = _connection.createTopicSession (false, Session.AUTO_ACKNOWLEDGE); // create a publisher _publisher = _session.createPublisher(topic); // create a subscriber. TopicSubscriber s = _session.createSubscriber(topic, null, /* noLocal: */ true); MessageListener l = getMessageListener(); s.setMessageListener(l); _connection.start(); _connection.setExceptionListener(this); if (log.isInfoEnabled()) log.info(s_loc.get("jms-start-listener", _topicName)); } catch (OpenJPAException ke) { throw ke; } catch (Exception e) { throw new UserException(s_loc.get("jms-provider-config", _topicName, _tcfName), e).setFatal(true); } }
newConnection.setExceptionListener(new ExceptionListener() { @Override public void onException(JMSException exception) {
newConnection.setExceptionListener(new ExceptionListener() { @Override public void onException(JMSException exception) {
newConnection.setExceptionListener(new ExceptionListener() { @Override public void onException(JMSException exception) {
newConnection.setExceptionListener(new ExceptionListener() { @Override public void onException(JMSException exception) {
con.setExceptionListener(this); session = con.createTopicSession(false, Session.AUTO_ACKNOWLEDGE); topic = (Topic) jndi.lookup(topicName);
replicationTopicConnection.setExceptionListener(new ExceptionListener() {
replicationTopicConnection.setExceptionListener(new ExceptionListener() {