You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2018/10/02 02:57:11 UTC
[9/9] james-project git commit: JAMES-2544 Moving activemq to a new
dedicated maven module
JAMES-2544 Moving activemq to a new dedicated maven module
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/88821f8b
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/88821f8b
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/88821f8b
Branch: refs/heads/master
Commit: 88821f8b77301a3695032da755a6b0924c2ae04c
Parents: 2d6d67f
Author: duc <dt...@linagora.com>
Authored: Mon Oct 1 17:53:24 2018 +0700
Committer: Benoit Tellier <bt...@linagora.com>
Committed: Tue Oct 2 09:21:43 2018 +0700
----------------------------------------------------------------------
pom.xml | 5 ++
server/container/guice/activemq/pom.xml | 49 +++++++++++++++++
.../modules/activemq/ActiveMQQueueModule.java | 57 ++++++++++++++++++++
server/container/guice/cassandra-guice/pom.xml | 4 ++
.../apache/james/CassandraJamesServerMain.java | 2 +-
server/container/guice/guice-common/pom.xml | 4 --
.../modules/server/ActiveMQQueueModule.java | 56 -------------------
server/container/guice/jpa-guice/pom.xml | 4 ++
.../org/apache/james/JPAJamesServerMain.java | 2 +-
server/container/guice/jpa-smtp-common/pom.xml | 4 ++
.../org/apache/james/JPAJamesServerMain.java | 2 +-
server/container/guice/jpa-smtp/pom.xml | 12 +++--
server/container/guice/memory-guice/pom.xml | 4 ++
server/container/guice/pom.xml | 6 +++
server/mailet/integration-testing/pom.xml | 5 ++
.../james/transport/mailets/AddFooterTest.java | 2 +-
16 files changed, 150 insertions(+), 68 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/james-project/blob/88821f8b/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 0b0b457..6a3dda1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1283,6 +1283,11 @@
</dependency>
<dependency>
<groupId>${james.groupId}</groupId>
+ <artifactId>james-server-guice-activemq</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${james.groupId}</groupId>
<artifactId>james-server-guice-common</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/james-project/blob/88821f8b/server/container/guice/activemq/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/activemq/pom.xml b/server/container/guice/activemq/pom.xml
new file mode 100644
index 0000000..91e6ad3
--- /dev/null
+++ b/server/container/guice/activemq/pom.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.james</groupId>
+ <artifactId>james-server-guice</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>james-server-guice-activemq</artifactId>
+
+ <name>Apache James :: Server :: Guice :: ActiveMQ</name>
+ <description>Guice Module for ActiveMQ</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>${james.groupId}</groupId>
+ <artifactId>james-server-guice-configuration</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${james.groupId}</groupId>
+ <artifactId>james-server-queue-activemq</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.inject</groupId>
+ <artifactId>guice</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/james-project/blob/88821f8b/server/container/guice/activemq/src/main/java/org/apache/james/modules/activemq/ActiveMQQueueModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/activemq/src/main/java/org/apache/james/modules/activemq/ActiveMQQueueModule.java b/server/container/guice/activemq/src/main/java/org/apache/james/modules/activemq/ActiveMQQueueModule.java
new file mode 100644
index 0000000..8b2cbd1
--- /dev/null
+++ b/server/container/guice/activemq/src/main/java/org/apache/james/modules/activemq/ActiveMQQueueModule.java
@@ -0,0 +1,57 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.james.modules.activemq;
+
+import javax.jms.ConnectionFactory;
+
+import org.apache.activemq.store.PersistenceAdapter;
+import org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter;
+import org.apache.james.queue.activemq.ActiveMQMailQueueFactory;
+import org.apache.james.queue.activemq.EmbeddedActiveMQ;
+import org.apache.james.queue.api.MailQueueFactory;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Provides;
+import com.google.inject.Scopes;
+import com.google.inject.Singleton;
+
+public class ActiveMQQueueModule extends AbstractModule {
+
+ @Override
+ protected void configure() {
+ bind(PersistenceAdapter.class).to(KahaDBPersistenceAdapter.class);
+ bind(KahaDBPersistenceAdapter.class).in(Scopes.SINGLETON);
+ bind(EmbeddedActiveMQ.class).in(Scopes.SINGLETON);
+ }
+
+ @Provides
+ @Singleton
+ ConnectionFactory provideEmbededActiveMQ(EmbeddedActiveMQ embeddedActiveMQ) {
+ return embeddedActiveMQ.getConnectionFactory();
+ }
+
+ @Provides
+ @Singleton
+ public MailQueueFactory<?> createActiveMailQueueFactory(ActiveMQMailQueueFactory activeMQMailQueueFactory) {
+ activeMQMailQueueFactory.setUseJMX(true);
+ activeMQMailQueueFactory.init();
+ return activeMQMailQueueFactory;
+ }
+}
http://git-wip-us.apache.org/repos/asf/james-project/blob/88821f8b/server/container/guice/cassandra-guice/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/pom.xml b/server/container/guice/cassandra-guice/pom.xml
index d13b33f..d741c11 100644
--- a/server/container/guice/cassandra-guice/pom.xml
+++ b/server/container/guice/cassandra-guice/pom.xml
@@ -115,6 +115,10 @@
</dependency>
<dependency>
<groupId>${james.groupId}</groupId>
+ <artifactId>james-server-guice-activemq</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${james.groupId}</groupId>
<artifactId>james-server-guice-common</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/james-project/blob/88821f8b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java
index 4a1b8ca..25768c0 100644
--- a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java
+++ b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java
@@ -20,6 +20,7 @@
package org.apache.james;
import org.apache.james.modules.MailboxModule;
+import org.apache.james.modules.activemq.ActiveMQQueueModule;
import org.apache.james.modules.data.CassandraDLPConfigurationStoreModule;
import org.apache.james.modules.data.CassandraDomainListModule;
import org.apache.james.modules.data.CassandraJmapModule;
@@ -43,7 +44,6 @@ import org.apache.james.modules.protocols.POP3ServerModule;
import org.apache.james.modules.protocols.ProtocolHandlerModule;
import org.apache.james.modules.protocols.SMTPServerModule;
import org.apache.james.modules.rabbitmq.RabbitMQModule;
-import org.apache.james.modules.server.ActiveMQQueueModule;
import org.apache.james.modules.server.CassandraRoutesModule;
import org.apache.james.modules.server.DLPRoutesModule;
import org.apache.james.modules.server.DataRoutesModules;
http://git-wip-us.apache.org/repos/asf/james-project/blob/88821f8b/server/container/guice/guice-common/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/pom.xml b/server/container/guice/guice-common/pom.xml
index 8e64644..8c85fef 100644
--- a/server/container/guice/guice-common/pom.xml
+++ b/server/container/guice/guice-common/pom.xml
@@ -129,10 +129,6 @@
</dependency>
<dependency>
<groupId>${james.groupId}</groupId>
- <artifactId>james-server-queue-activemq</artifactId>
- </dependency>
- <dependency>
- <groupId>${james.groupId}</groupId>
<artifactId>james-server-queue-api</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/james-project/blob/88821f8b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/ActiveMQQueueModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/ActiveMQQueueModule.java b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/ActiveMQQueueModule.java
deleted file mode 100644
index 2121094..0000000
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/ActiveMQQueueModule.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one *
- * or more contributor license agreements. See the NOTICE file *
- * distributed with this work for additional information *
- * regarding copyright ownership. The ASF licenses this file *
- * to you under the Apache License, Version 2.0 (the *
- * "License"); you may not use this file except in compliance *
- * with the License. You may obtain a copy of the License at *
- * *
- * http://www.apache.org/licenses/LICENSE-2.0 *
- * *
- * Unless required by applicable law or agreed to in writing, *
- * software distributed under the License is distributed on an *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
- * KIND, either express or implied. See the License for the *
- * specific language governing permissions and limitations *
- * under the License. *
- ****************************************************************/
-
-package org.apache.james.modules.server;
-
-import javax.jms.ConnectionFactory;
-
-import org.apache.activemq.store.PersistenceAdapter;
-import org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter;
-import org.apache.james.queue.activemq.ActiveMQMailQueueFactory;
-import org.apache.james.queue.activemq.EmbeddedActiveMQ;
-import org.apache.james.queue.api.MailQueueFactory;
-
-import com.google.inject.AbstractModule;
-import com.google.inject.Provides;
-import com.google.inject.Scopes;
-import com.google.inject.Singleton;
-
-public class ActiveMQQueueModule extends AbstractModule {
- @Override
- protected void configure() {
- bind(PersistenceAdapter.class).to(KahaDBPersistenceAdapter.class);
- bind(KahaDBPersistenceAdapter.class).in(Scopes.SINGLETON);
- bind(EmbeddedActiveMQ.class).in(Scopes.SINGLETON);
- }
-
- @Provides
- @Singleton
- ConnectionFactory provideEmbededActiveMQ(EmbeddedActiveMQ embeddedActiveMQ) {
- return embeddedActiveMQ.getConnectionFactory();
- }
-
- @Provides
- @Singleton
- public MailQueueFactory<?> createActiveMailQueueFactory(ActiveMQMailQueueFactory activeMQMailQueueFactory) {
- activeMQMailQueueFactory.setUseJMX(true);
- activeMQMailQueueFactory.init();
- return activeMQMailQueueFactory;
- }
-}
http://git-wip-us.apache.org/repos/asf/james-project/blob/88821f8b/server/container/guice/jpa-guice/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/pom.xml b/server/container/guice/jpa-guice/pom.xml
index 915bc40..40e2e8d 100644
--- a/server/container/guice/jpa-guice/pom.xml
+++ b/server/container/guice/jpa-guice/pom.xml
@@ -63,6 +63,10 @@
</dependency>
<dependency>
<groupId>${james.groupId}</groupId>
+ <artifactId>james-server-guice-activemq</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${james.groupId}</groupId>
<artifactId>james-server-guice-common</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/james-project/blob/88821f8b/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
index 76580f5..61eba68 100644
--- a/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/JPAJamesServerMain.java
@@ -20,6 +20,7 @@
package org.apache.james;
import org.apache.james.modules.MailboxModule;
+import org.apache.james.modules.activemq.ActiveMQQueueModule;
import org.apache.james.modules.data.JPADataModule;
import org.apache.james.modules.data.SieveFileRepositoryModule;
import org.apache.james.modules.mailbox.DefaultEventModule;
@@ -31,7 +32,6 @@ import org.apache.james.modules.protocols.ManageSieveServerModule;
import org.apache.james.modules.protocols.POP3ServerModule;
import org.apache.james.modules.protocols.ProtocolHandlerModule;
import org.apache.james.modules.protocols.SMTPServerModule;
-import org.apache.james.modules.server.ActiveMQQueueModule;
import org.apache.james.modules.server.DataRoutesModules;
import org.apache.james.modules.server.DefaultProcessorsConfigurationProviderModule;
import org.apache.james.modules.server.ElasticSearchMetricReporterModule;
http://git-wip-us.apache.org/repos/asf/james-project/blob/88821f8b/server/container/guice/jpa-smtp-common/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp-common/pom.xml b/server/container/guice/jpa-smtp-common/pom.xml
index ac62ede..fa6afa0 100644
--- a/server/container/guice/jpa-smtp-common/pom.xml
+++ b/server/container/guice/jpa-smtp-common/pom.xml
@@ -39,6 +39,10 @@
</dependency>
<dependency>
<groupId>${james.groupId}</groupId>
+ <artifactId>james-server-guice-activemq</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${james.groupId}</groupId>
<artifactId>james-server-guice-common</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/james-project/blob/88821f8b/server/container/guice/jpa-smtp-common/src/main/java/org/apache/james/JPAJamesServerMain.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp-common/src/main/java/org/apache/james/JPAJamesServerMain.java b/server/container/guice/jpa-smtp-common/src/main/java/org/apache/james/JPAJamesServerMain.java
index af19662..3fd88a9 100644
--- a/server/container/guice/jpa-smtp-common/src/main/java/org/apache/james/JPAJamesServerMain.java
+++ b/server/container/guice/jpa-smtp-common/src/main/java/org/apache/james/JPAJamesServerMain.java
@@ -19,11 +19,11 @@
package org.apache.james;
+import org.apache.james.modules.activemq.ActiveMQQueueModule;
import org.apache.james.modules.data.JPADataModule;
import org.apache.james.modules.data.JPAEntityManagerModule;
import org.apache.james.modules.protocols.ProtocolHandlerModule;
import org.apache.james.modules.protocols.SMTPServerModule;
-import org.apache.james.modules.server.ActiveMQQueueModule;
import org.apache.james.modules.server.DataRoutesModules;
import org.apache.james.modules.server.DefaultProcessorsConfigurationProviderModule;
import org.apache.james.modules.server.ElasticSearchMetricReporterModule;
http://git-wip-us.apache.org/repos/asf/james-project/blob/88821f8b/server/container/guice/jpa-smtp/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-smtp/pom.xml b/server/container/guice/jpa-smtp/pom.xml
index ee320a8..265dcc5 100644
--- a/server/container/guice/jpa-smtp/pom.xml
+++ b/server/container/guice/jpa-smtp/pom.xml
@@ -48,17 +48,21 @@
</dependency>
<dependency>
<groupId>${james.groupId}</groupId>
+ <artifactId>james-server-jpa-common-guice</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${james.groupId}</groupId>
<artifactId>james-server-jpa-smtp-common-guice</artifactId>
</dependency>
<dependency>
<groupId>${james.groupId}</groupId>
- <artifactId>james-server-guice-common</artifactId>
- <type>test-jar</type>
- <scope>test</scope>
+ <artifactId>james-server-guice-activemq</artifactId>
</dependency>
<dependency>
<groupId>${james.groupId}</groupId>
- <artifactId>james-server-jpa-common-guice</artifactId>
+ <artifactId>james-server-guice-common</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
http://git-wip-us.apache.org/repos/asf/james-project/blob/88821f8b/server/container/guice/memory-guice/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/pom.xml b/server/container/guice/memory-guice/pom.xml
index f52116e..8be7a8a 100644
--- a/server/container/guice/memory-guice/pom.xml
+++ b/server/container/guice/memory-guice/pom.xml
@@ -68,6 +68,10 @@
</dependency>
<dependency>
<groupId>${james.groupId}</groupId>
+ <artifactId>james-server-guice-activemq</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${james.groupId}</groupId>
<artifactId>james-server-guice-common</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/james-project/blob/88821f8b/server/container/guice/pom.xml
----------------------------------------------------------------------
diff --git a/server/container/guice/pom.xml b/server/container/guice/pom.xml
index 41c0a9a..d4c51f3 100644
--- a/server/container/guice/pom.xml
+++ b/server/container/guice/pom.xml
@@ -65,6 +65,7 @@
<module>protocols/webadmin-mailqueue</module>
<module>protocols/webadmin-mailrepository</module>
<module>protocols/webadmin-swagger</module>
+ <module>activemq</module>
<module>rabbitmq</module>
</modules>
@@ -133,6 +134,11 @@
</dependency>
<dependency>
<groupId>${james.groupId}</groupId>
+ <artifactId>james-server-guice-activemq</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${james.groupId}</groupId>
<artifactId>james-server-guice-rabbitmq</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/james-project/blob/88821f8b/server/mailet/integration-testing/pom.xml
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/pom.xml b/server/mailet/integration-testing/pom.xml
index 5ddb093..a1ddfe5 100644
--- a/server/mailet/integration-testing/pom.xml
+++ b/server/mailet/integration-testing/pom.xml
@@ -59,6 +59,11 @@
</dependency>
<dependency>
<groupId>${james.groupId}</groupId>
+ <artifactId>james-server-guice-activemq</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${james.groupId}</groupId>
<artifactId>james-server-guice-common</artifactId>
<type>test-jar</type>
<scope>test</scope>
http://git-wip-us.apache.org/repos/asf/james-project/blob/88821f8b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AddFooterTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AddFooterTest.java b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AddFooterTest.java
index e475af7..1941e0d 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AddFooterTest.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/transport/mailets/AddFooterTest.java
@@ -32,9 +32,9 @@ import org.apache.james.mailets.TemporaryJamesServer;
import org.apache.james.mailets.configuration.CommonProcessors;
import org.apache.james.mailets.configuration.MailetConfiguration;
import org.apache.james.mailets.configuration.ProcessorConfiguration;
+import org.apache.james.modules.activemq.ActiveMQQueueModule;
import org.apache.james.modules.protocols.ImapGuiceProbe;
import org.apache.james.modules.protocols.SmtpGuiceProbe;
-import org.apache.james.modules.server.ActiveMQQueueModule;
import org.apache.james.probe.DataProbe;
import org.apache.james.transport.matchers.All;
import org.apache.james.utils.DataProbeImpl;
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org