@Override public String getClientID() throws JMSException { checkClosed(); return clientID; }
@Override public void setExceptionListener(final ExceptionListener listener) throws JMSException { checkClosed(); exceptionListener = listener; }
/** * @return {@link FailoverEventListener} the current failover event listener for this connection * @throws JMSException */ public FailoverEventListener getFailoverListener() throws JMSException { checkClosed(); justCreated = false; return failoverEventListener; }
@Override public ExceptionListener getExceptionListener() throws JMSException { checkClosed(); return exceptionListener; }
/** * Sets a FailureListener for the session which is notified if a failure occurs on the session. * * @param listener the listener to add * @throws JMSException */ public void setFailoverListener(final FailoverEventListener listener) throws JMSException { checkClosed(); justCreated = false; this.failoverEventListener = listener; }
/** * This internal method serves basically the Resource Adapter. * The resource adapter plays with an XASession and a non XASession. * When there is no enlisted transaction, the EE specification mandates that the commit should * be done as if it was a nonXA Session (i.e. SessionTransacted). * For that reason we have this method to force that nonXASession, since the JMS Javadoc * mandates createSession to return a XASession. */ public Session createNonXATopicSession(final boolean transacted, final int acknowledgeMode) throws JMSException { checkClosed(); return createSessionInternal(false, transacted, acknowledgeMode, ActiveMQConnection.TYPE_TOPIC_CONNECTION); }
/** * This internal method serves basically the Resource Adapter. * The resource adapter plays with an XASession and a non XASession. * When there is no enlisted transaction, the EE specification mandates that the commit should * be done as if it was a nonXA Session (i.e. SessionTransacted). * For that reason we have this method to force that nonXASession, since the JMS Javadoc * mandates createSession to return a XASession. */ public Session createNonXAQueueSession(final boolean transacted, final int acknowledgeMode) throws JMSException { checkClosed(); return createSessionInternal(false, transacted, acknowledgeMode, ActiveMQConnection.TYPE_QUEUE_CONNECTION); }
@Override public Session createSession() throws JMSException { checkClosed(); return createSessionInternal(false, false, Session.AUTO_ACKNOWLEDGE, ActiveMQSession.TYPE_GENERIC_SESSION); }
/** * This internal method serves basically the Resource Adapter. * The resource adapter plays with an XASession and a non XASession. * When there is no enlisted transaction, the EE specification mandates that the commit should * be done as if it was a nonXA Session (i.e. SessionTransacted). * For that reason we have this method to force that nonXASession, since the JMS Javadoc * mandates createSession to return a XASession. */ public Session createNonXASession(final boolean transacted, final int acknowledgeMode) throws JMSException { checkClosed(); return createSessionInternal(false, transacted, acknowledgeMode, ActiveMQConnection.TYPE_GENERIC_CONNECTION); }
@Override public synchronized void start() throws JMSException { checkClosed(); for (ActiveMQSession session : sessions) { session.start(); } justCreated = false; started = true; }
@Override public Session createSession(int sessionMode) throws JMSException { checkClosed(); return createSessionInternal(false, sessionMode == Session.SESSION_TRANSACTED, sessionMode, ActiveMQSession.TYPE_GENERIC_SESSION); }
@Override public ConnectionMetaData getMetaData() throws JMSException { checkClosed(); if (metaData == null) { metaData = new ActiveMQConnectionMetaData(thisVersion); } return metaData; }
@Override public ConnectionConsumer createConnectionConsumer(final Topic topic, final String messageSelector, final ServerSessionPool sessionPool, final int maxMessages) throws JMSException { checkClosed(); checkTempQueues(topic); return null; }
@Override public ConnectionConsumer createConnectionConsumer(final Destination destination, final String messageSelector, final ServerSessionPool sessionPool, final int maxMessages) throws JMSException { checkClosed(); checkTempQueues(destination); // We offer a RA, so no need to implement this for MDBs return null; }
@Override public ConnectionConsumer createConnectionConsumer(final Queue queue, final String messageSelector, final ServerSessionPool sessionPool, final int maxMessages) throws JMSException { checkClosed(); checkTempQueues(queue); return null; }
@Override public synchronized Session createSession(final boolean transacted, final int acknowledgeMode) throws JMSException { checkClosed(); return createSessionInternal(false, transacted, checkAck(transacted, acknowledgeMode), ActiveMQConnection.TYPE_GENERIC_CONNECTION); }
@Override public QueueSession createQueueSession(final boolean transacted, int acknowledgeMode) throws JMSException { checkClosed(); return createSessionInternal(false, transacted, checkAck(transacted, acknowledgeMode), ActiveMQSession.TYPE_QUEUE_SESSION); }
@Override public TopicSession createTopicSession(final boolean transacted, final int acknowledgeMode) throws JMSException { checkClosed(); return createSessionInternal(false, transacted, checkAck(transacted, acknowledgeMode), ActiveMQSession.TYPE_TOPIC_SESSION); }
@Override public synchronized void stop() throws JMSException { threadAwareContext.assertNotMessageListenerThread(); checkClosed(); for (ActiveMQSession session : sessions) { session.stop(); } started = false; }
@Override public ConnectionConsumer createDurableConnectionConsumer(final Topic topic, final String subscriptionName, final String messageSelector, final ServerSessionPool sessionPool, final int maxMessages) throws JMSException { checkClosed(); // As spec. section 4.11 if (connectionType == ActiveMQConnection.TYPE_QUEUE_CONNECTION) { String msg = "Cannot create a durable connection consumer on a QueueConnection"; throw new javax.jms.IllegalStateException(msg); } checkTempQueues(topic); // We offer RA, so no need for this return null; }