Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D565D18EB3 for ; Mon, 1 Feb 2016 13:05:35 +0000 (UTC) Received: (qmail 58615 invoked by uid 500); 1 Feb 2016 13:05:35 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 58579 invoked by uid 500); 1 Feb 2016 13:05:35 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 58570 invoked by uid 99); 1 Feb 2016 13:05:35 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Feb 2016 13:05:35 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6F753DFC3C; Mon, 1 Feb 2016 13:05:35 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: cshannon@apache.org To: commits@activemq.apache.org Date: Mon, 01 Feb 2016 13:05:37 -0000 Message-Id: <7eab388b142e4ef885eac336a2f92c49@git.apache.org> In-Reply-To: <86a80b18839041629723f9ae366eb966@git.apache.org> References: <86a80b18839041629723f9ae366eb966@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/3] activemq git commit: https://issues.apache.org/jira/browse/AMQ-6150 https://issues.apache.org/jira/browse/AMQ-6150 code cleanup Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/161730fd Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/161730fd Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/161730fd Branch: refs/heads/master Commit: 161730fda2a15c41a3f620a476ba49f841b87545 Parents: 9361bc6 Author: Christopher L. Shannon (cshannon) Authored: Mon Feb 1 13:04:07 2016 +0000 Committer: Christopher L. Shannon (cshannon) Committed: Mon Feb 1 13:04:07 2016 +0000 ---------------------------------------------------------------------- .../org/apache/activemq/ra/ServerSessionPoolImpl.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/161730fd/activemq-ra/src/main/java/org/apache/activemq/ra/ServerSessionPoolImpl.java ---------------------------------------------------------------------- diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ServerSessionPoolImpl.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ServerSessionPoolImpl.java index 9db6df5..94bca0c 100755 --- a/activemq-ra/src/main/java/org/apache/activemq/ra/ServerSessionPoolImpl.java +++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ServerSessionPoolImpl.java @@ -31,9 +31,7 @@ import javax.resource.spi.UnavailableException; import javax.resource.spi.endpoint.MessageEndpoint; import org.apache.activemq.ActiveMQConnection; -import org.apache.activemq.ActiveMQQueueSession; import org.apache.activemq.ActiveMQSession; -import org.apache.activemq.ActiveMQTopicSession; import org.apache.activemq.command.MessageDispatch; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -76,11 +74,11 @@ public class ServerSessionPoolImpl implements ServerSessionPool { if (activationSpec.isUseRAManagedTransactionEnabled()) { // The RA will manage the transaction commit. endpoint = createEndpoint(null); - return new ServerSessionImpl(this, (ActiveMQSession)session, activeMQAsfEndpointWorker.workManager, endpoint, true, batchSize); + return new ServerSessionImpl(this, session, activeMQAsfEndpointWorker.workManager, endpoint, true, batchSize); } else { // Give the container an object to manage to transaction with. endpoint = createEndpoint(new LocalAndXATransaction(session.getTransactionContext())); - return new ServerSessionImpl(this, (ActiveMQSession)session, activeMQAsfEndpointWorker.workManager, endpoint, false, batchSize); + return new ServerSessionImpl(this, session, activeMQAsfEndpointWorker.workManager, endpoint, false, batchSize); } } catch (UnavailableException e) { // The container could be limiting us on the number of endpoints @@ -102,6 +100,7 @@ public class ServerSessionPoolImpl implements ServerSessionPool { /** */ + @Override public ServerSession getServerSession() throws JMSException { if (LOG.isDebugEnabled()) { LOG.debug("ServerSession requested."); @@ -226,12 +225,12 @@ public class ServerSessionPoolImpl implements ServerSessionPool { } try { ActiveMQSession session = (ActiveMQSession)ss.getSession(); - List l = session.getUnconsumedMessages(); + List l = session.getUnconsumedMessages(); if (!l.isEmpty()) { ActiveMQConnection connection = activeMQAsfEndpointWorker.getConnection(); if (connection != null) { - for (Iterator i = l.iterator(); i.hasNext();) { - MessageDispatch md = (MessageDispatch)i.next(); + for (Iterator i = l.iterator(); i.hasNext();) { + MessageDispatch md = i.next(); if (connection.hasDispatcher(md.getConsumerId())) { dispatchToSession(md); LOG.trace("on remove of {} redispatch of {}", session, md);