@Override public void close() { threadAwareContext.assertNotCompletionListenerThreadRuntime(); threadAwareContext.assertNotMessageListenerThreadRuntime(); try { synchronized (this) { if (session != null) session.close(); connection.closeFromContext(); closed = true; } } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }
@Override public JMSContext createContext(int sessionMode) { return connection.createContext(sessionMode); }
/** * */ private void checkSession() { if (session == null) { synchronized (this) { if (closed) throw new IllegalStateRuntimeException("Context is closed"); if (session == null) { try { if (xa) { session = ((XAConnection) connection).createXASession(); } else { session = connection.createSession(sessionMode); } } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } } } } }
@Override public void start() { try { connection.start(); } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }
@Override public void stop() { threadAwareContext.assertNotMessageListenerThreadRuntime(); try { connection.stop(); } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }
@Override public ExceptionListener getExceptionListener() { try { return connection.getExceptionListener(); } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }
@Override public String getClientID() { try { return connection.getClientID(); } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }
@Override public void setClientID(String clientID) { try { connection.setClientID(clientID); } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }
@Override public void setExceptionListener(ExceptionListener listener) { try { connection.setExceptionListener(listener); } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }
@Override public ConnectionMetaData getMetaData() { try { return connection.getMetaData(); } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }
private synchronized void checkAutoStart() throws JMSException { if (closed) throw new IllegalStateRuntimeException("Context is closed"); if (autoStart) { connection.start(); } }
@Override public void stop() { threadAwareContext.assertNotMessageListenerThreadRuntime(); try { connection.stop(); } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }
@Override public ExceptionListener getExceptionListener() { try { return connection.getExceptionListener(); } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }
@Override public String getClientID() { try { return connection.getClientID(); } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }
@Override public void setClientID(String clientID) { try { connection.setClientID(clientID); } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }
@Override public void setExceptionListener(ExceptionListener listener) { try { connection.setExceptionListener(listener); } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }
@Override public ConnectionMetaData getMetaData() { try { return connection.getMetaData(); } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }
private synchronized void checkAutoStart() throws JMSException { if (closed) throw new IllegalStateRuntimeException("Context is closed"); if (autoStart) { connection.start(); } }
@Override public void stop() { threadAwareContext.assertNotMessageListenerThreadRuntime(); try { connection.stop(); } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }
@Override public ExceptionListener getExceptionListener() { try { return connection.getExceptionListener(); } catch (JMSException e) { throw JmsExceptionUtils.convertToRuntimeException(e); } }