james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject james-project git commit: JAMES-1939 TestMessageHook should be thread safe
Date Tue, 14 Feb 2017 00:32:08 GMT
Repository: james-project
Updated Branches:
  refs/heads/master 3c8cec1de -> c4d797e0d


JAMES-1939 TestMessageHook should be thread safe


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

Branch: refs/heads/master
Commit: c4d797e0df535de1832321f02dc1ef605b509bba
Parents: 3c8cec1
Author: Benoit Tellier <btellier@linagora.com>
Authored: Mon Feb 13 17:43:12 2017 +0700
Committer: Benoit Tellier <btellier@linagora.com>
Committed: Tue Feb 14 07:31:10 2017 +0700

----------------------------------------------------------------------
 .../protocols/smtp/utils/TestMessageHook.java   | 26 ++++++++++----------
 1 file changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/c4d797e0/protocols/smtp/src/test/java/org/apache/james/protocols/smtp/utils/TestMessageHook.java
----------------------------------------------------------------------
diff --git a/protocols/smtp/src/test/java/org/apache/james/protocols/smtp/utils/TestMessageHook.java
b/protocols/smtp/src/test/java/org/apache/james/protocols/smtp/utils/TestMessageHook.java
index d9fffa1..0623356 100644
--- a/protocols/smtp/src/test/java/org/apache/james/protocols/smtp/utils/TestMessageHook.java
+++ b/protocols/smtp/src/test/java/org/apache/james/protocols/smtp/utils/TestMessageHook.java
@@ -18,11 +18,11 @@
  ****************************************************************/
 package org.apache.james.protocols.smtp.utils;
 
-import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
 
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.ConfigurationException;
 import org.apache.james.protocols.smtp.MailEnvelope;
 import org.apache.james.protocols.smtp.SMTPSession;
 import org.apache.james.protocols.smtp.hook.HookResult;
@@ -31,7 +31,7 @@ import org.apache.james.protocols.smtp.hook.MessageHook;
 
 public class TestMessageHook implements MessageHook {
 
-    private final List<MailEnvelope> queued = new ArrayList<MailEnvelope>();
+    private final CopyOnWriteArrayList<MailEnvelope> queued = new CopyOnWriteArrayList<MailEnvelope>();
     
     public HookResult onMessage(SMTPSession session, MailEnvelope mail) {
         queued.add(mail);
@@ -42,13 +42,13 @@ public class TestMessageHook implements MessageHook {
         return queued;
     }
 
-    @Override
-    public void init(Configuration config) throws ConfigurationException {
-
-    }
-
-    @Override
-    public void destroy() {
-
-    }
+    @Override
+    public void init(Configuration config) throws ConfigurationException {
+
+    }
+
+    @Override
+    public void destroy() {
+
+    }
 }


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


Mime
View raw message