JAMES-2332 Connection is not required in JMS mail queue items

Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/ffe34674
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/ffe34674
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/ffe34674

Branch: refs/heads/master
Commit: ffe3467456b808186e43392a90c39196974d4c70
Parents: 67d6b67
Author: benwa <btell...@linagora.com>
Authored: Tue Feb 6 10:44:15 2018 +0700
Committer: benwa <btell...@linagora.com>
Committed: Tue Feb 6 10:44:15 2018 +0700

----------------------------------------------------------------------
 .../org/apache/james/queue/activemq/ActiveMQMailQueue.java     | 5 ++---
 .../org/apache/james/queue/activemq/ActiveMQMailQueueItem.java | 5 ++---
 .../src/main/java/org/apache/james/queue/jms/JMSMailQueue.java | 6 +++---
 .../main/java/org/apache/james/queue/jms/JMSMailQueueItem.java | 5 +----
 4 files changed, 8 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/ffe34674/server/queue/queue-activemq/src/main/java/org/apache/james/queue/activemq/ActiveMQMailQueue.java
----------------------------------------------------------------------
diff --git 
a/server/queue/queue-activemq/src/main/java/org/apache/james/queue/activemq/ActiveMQMailQueue.java
 
b/server/queue/queue-activemq/src/main/java/org/apache/james/queue/activemq/ActiveMQMailQueue.java
index e968196..7a887c1 100644
--- 
a/server/queue/queue-activemq/src/main/java/org/apache/james/queue/activemq/ActiveMQMailQueue.java
+++ 
b/server/queue/queue-activemq/src/main/java/org/apache/james/queue/activemq/ActiveMQMailQueue.java
@@ -23,7 +23,6 @@ import java.net.MalformedURLException;
 import java.util.List;
 import java.util.Map;
 
-import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.JMSException;
 import javax.jms.MapMessage;
@@ -217,9 +216,9 @@ public class ActiveMQMailQueue extends JMSMailQueue 
implements ActiveMQSupport {
     }
 
     @Override
-    protected MailQueueItem createMailQueueItem(Connection connection, Session 
session, MessageConsumer consumer, Message message) throws JMSException, 
MessagingException {
+    protected MailQueueItem createMailQueueItem(Session session, 
MessageConsumer consumer, Message message) throws JMSException, 
MessagingException {
         Mail mail = createMail(message);
-        ActiveMQMailQueueItem activeMQMailQueueItem = new 
ActiveMQMailQueueItem(mail, connection, session, consumer, message);
+        ActiveMQMailQueueItem activeMQMailQueueItem = new 
ActiveMQMailQueueItem(mail, session, consumer, message);
         return mailQueueItemDecoratorFactory.decorate(activeMQMailQueueItem);
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ffe34674/server/queue/queue-activemq/src/main/java/org/apache/james/queue/activemq/ActiveMQMailQueueItem.java
----------------------------------------------------------------------
diff --git 
a/server/queue/queue-activemq/src/main/java/org/apache/james/queue/activemq/ActiveMQMailQueueItem.java
 
b/server/queue/queue-activemq/src/main/java/org/apache/james/queue/activemq/ActiveMQMailQueueItem.java
index 4cb1f90..cb8f5ce 100644
--- 
a/server/queue/queue-activemq/src/main/java/org/apache/james/queue/activemq/ActiveMQMailQueueItem.java
+++ 
b/server/queue/queue-activemq/src/main/java/org/apache/james/queue/activemq/ActiveMQMailQueueItem.java
@@ -21,7 +21,6 @@ package org.apache.james.queue.activemq;
 
 import java.io.IOException;
 
-import javax.jms.Connection;
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
@@ -44,8 +43,8 @@ public class ActiveMQMailQueueItem extends JMSMailQueueItem 
implements ActiveMQS
 
     private final Message message;
 
-    public ActiveMQMailQueueItem(Mail mail, Connection connection, Session 
session, MessageConsumer consumer, Message message) {
-        super(mail, connection, session, consumer);
+    public ActiveMQMailQueueItem(Mail mail, Session session, MessageConsumer 
consumer, Message message) {
+        super(mail,  session, consumer);
         this.message = message;
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ffe34674/server/queue/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java
----------------------------------------------------------------------
diff --git 
a/server/queue/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java
 
b/server/queue/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java
index dd545a6..81f4e38 100644
--- 
a/server/queue/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java
+++ 
b/server/queue/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueue.java
@@ -204,7 +204,7 @@ public class JMSMailQueue implements ManageableMailQueue, 
JMSSupport, MailPriori
 
                 if (message != null) {
                     mailQueueSize.decrement();
-                    return createMailQueueItem(connection, session, consumer, 
message);
+                    return createMailQueueItem(session, consumer, message);
                 } else {
                     session.commit();
                     closeConsumer(consumer);
@@ -473,9 +473,9 @@ public class JMSMailQueue implements ManageableMailQueue, 
JMSSupport, MailPriori
      * @throws JMSException
      * @throws MessagingException
      */
-    protected MailQueueItem createMailQueueItem(Connection connection, Session 
session, MessageConsumer consumer, Message message) throws JMSException, 
MessagingException {
+    protected MailQueueItem createMailQueueItem(Session session, 
MessageConsumer consumer, Message message) throws JMSException, 
MessagingException {
         final Mail mail = createMail(message);
-        JMSMailQueueItem jmsMailQueueItem = new JMSMailQueueItem(mail, 
connection, session, consumer);
+        JMSMailQueueItem jmsMailQueueItem = new JMSMailQueueItem(mail, 
session, consumer);
         return mailQueueItemDecoratorFactory.decorate(jmsMailQueueItem);
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ffe34674/server/queue/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueueItem.java
----------------------------------------------------------------------
diff --git 
a/server/queue/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueueItem.java
 
b/server/queue/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueueItem.java
index 5f195bd..ad10836 100644
--- 
a/server/queue/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueueItem.java
+++ 
b/server/queue/queue-jms/src/main/java/org/apache/james/queue/jms/JMSMailQueueItem.java
@@ -19,7 +19,6 @@
 
 package org.apache.james.queue.jms;
 
-import javax.jms.Connection;
 import javax.jms.JMSException;
 import javax.jms.MessageConsumer;
 import javax.jms.Session;
@@ -34,13 +33,11 @@ import org.apache.mailet.Mail;
 public class JMSMailQueueItem implements MailQueueItem {
 
     protected final Mail mail;
-    protected final Connection connection;
     protected final Session session;
     protected final MessageConsumer consumer;
 
-    public JMSMailQueueItem(Mail mail, Connection connection, Session session, 
MessageConsumer consumer) {
+    public JMSMailQueueItem(Mail mail, Session session, MessageConsumer 
consumer) {
         this.mail = mail;
-        this.connection = connection;
         this.session = session;
         this.consumer = consumer;
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to