james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [08/29] james-project git commit: JAMES-1842: Inversion of control on GuiceProbe
Date Fri, 18 Nov 2016 09:54:01 GMT
JAMES-1842: Inversion of control on GuiceProbe


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

Branch: refs/heads/master
Commit: ebbf1e6fe6f41f568396f409a28381912d0aeebd
Parents: 2ae5e1a
Author: Quynh Nguyen <qnguyen@linagora.com>
Authored: Thu Nov 10 12:04:27 2016 +0700
Committer: Quynh Nguyen <qnguyen@linagora.com>
Committed: Fri Nov 18 09:25:34 2016 +0700

----------------------------------------------------------------------
 .../smtp/host/CassandraJamesSmtpHostSystem.java |   8 +-
 .../org/apache/james/CassandraJamesServer.java  |  58 +++
 .../apache/james/CassandraJamesServerMain.java  |   4 +-
 .../apache/james/CassandraJamesServerTest.java  |   6 +-
 .../james/JamesCapabilitiesServerTest.java      |   6 +-
 .../java/org/apache/james/GuiceJamesServer.java |  40 +-
 .../org/apache/james/GuiceJmapJamesServer.java  | 114 ------
 .../main/java/org/apache/james/JmapServer.java  |  26 ++
 .../java/org/apache/james/WebAdminServer.java   |  25 ++
 .../james/modules/CommonServicesModule.java     |   4 +
 .../apache/james/modules/ProtocolsModule.java   |   6 -
 .../modules/ProtocolsModuleWithoutJMAP.java     |  30 --
 .../modules/protocols/JMAPServerModule.java     |   3 +
 .../modules/server/WebAdminServerModule.java    |   3 +
 .../james/utils/ExtendedJmapServerProbe.java    |  31 --
 .../java/org/apache/james/utils/GuiceProbe.java |  22 ++
 .../apache/james/utils/GuiceProbeProvider.java  |  45 +++
 .../apache/james/utils/GuiceServerProbe.java    |   4 +-
 .../org/apache/james/utils/JmapGuiceProbe.java  |  56 +++
 .../james/utils/JmapGuiceServerProbe.java       | 368 -------------------
 .../apache/james/utils/WebAdminGuiceProbe.java  |  37 ++
 .../james/AbstractJmapJamesServerTest.java      |  11 +-
 .../james/utils/GuiceProbeProviderTest.java     |  68 ++++
 .../modules/data/JPASieveRepositoryModule.java  |  18 +
 .../mailbox/LuceneSearchMailboxModule.java      |   8 +-
 .../org/apache/james/MemoryJamesServer.java     |  56 +++
 .../org/apache/james/MemoryJamesServerMain.java |   4 +-
 .../org/apache/james/MemoryJamesServerTest.java |   6 +-
 .../james/mailets/TemporaryJamesServer.java     |  11 +-
 .../CassandraGetMailboxesMethodTest.java        |   8 +-
 .../CassandraGetMessageListMethodTest.java      |   8 +-
 .../CassandraGetVacationResponseTest.java       |   8 +-
 .../CassandraJmapAuthenticationTest.java        |   8 +-
 .../CassandraSetMailboxesMethodTest.java        |   8 +-
 .../CassandraSetMessagesMethodTest.java         |   8 +-
 .../CassandraSetVacationResponseTest.java       |   8 +-
 .../CassandraVacationIntegrationTest.java       |   9 +-
 .../cassandra/cucumber/CassandraStepdefs.java   |   4 +-
 .../james/jmap/JMAPAuthenticationTest.java      |  15 +-
 .../james/jmap/VacationIntegrationTest.java     |  19 +-
 .../integration/GetMailboxesMethodTest.java     |  51 +--
 .../integration/GetMessageListMethodTest.java   |  15 +-
 .../integration/GetVacationResponseTest.java    |  26 +-
 .../integration/SetMailboxesMethodTest.java     |  15 +-
 .../integration/SetMessagesMethodTest.java      |  17 +-
 .../integration/SetVacationResponseTest.java    |  33 +-
 .../integration/cucumber/MainStepdefs.java      |  14 +-
 .../memory/MemoryGetMailboxesMethodTest.java    |   8 +-
 .../memory/MemoryGetMessageListMethodTest.java  |   8 +-
 .../MemoryGetVacationResponseMethodTest.java    |   8 +-
 .../memory/MemoryJmapAuthenticationTest.java    |   8 +-
 .../memory/MemorySetMailboxesMethodTest.java    |   8 +-
 .../memory/MemorySetMessagesMethodTest.java     |   8 +-
 .../MemorySetVacationResponseMethodTest.java    |   8 +-
 .../memory/MemoryVacationIntegrationTest.java   |   8 +-
 .../jmap/memory/cucumber/MemoryStepdefs.java    |   4 +-
 .../WebAdminServerIntegrationTest.java          |  11 +-
 57 files changed, 663 insertions(+), 768 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/mpt/impl/smtp/cassandra/src/test/java/org/apache/james/mpt/smtp/host/CassandraJamesSmtpHostSystem.java
----------------------------------------------------------------------
diff --git a/mpt/impl/smtp/cassandra/src/test/java/org/apache/james/mpt/smtp/host/CassandraJamesSmtpHostSystem.java b/mpt/impl/smtp/cassandra/src/test/java/org/apache/james/mpt/smtp/host/CassandraJamesSmtpHostSystem.java
index 836e4e5..4949765 100644
--- a/mpt/impl/smtp/cassandra/src/test/java/org/apache/james/mpt/smtp/host/CassandraJamesSmtpHostSystem.java
+++ b/mpt/impl/smtp/cassandra/src/test/java/org/apache/james/mpt/smtp/host/CassandraJamesSmtpHostSystem.java
@@ -22,7 +22,7 @@ package org.apache.james.mpt.smtp.host;
 import java.util.Iterator;
 
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.GuiceJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.dnsservice.api.DNSService;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -42,7 +42,7 @@ public class CassandraJamesSmtpHostSystem extends ExternalSessionFactory impleme
     private EmbeddedCassandra embeddedCassandra;
     private EmbeddedElasticSearch embeddedElasticSearch;
 
-    private GuiceJmapJamesServer jamesServer;
+    private GuiceJamesServer jamesServer;
     private InMemoryDNSService inMemoryDNSService;
 
 
@@ -104,8 +104,8 @@ public class CassandraJamesSmtpHostSystem extends ExternalSessionFactory impleme
         return inMemoryDNSService;
     }
 
-    protected GuiceJmapJamesServer createJamesServer() {
-        return new GuiceJmapJamesServer()
+    protected GuiceJamesServer createJamesServer() {
+        return new GuiceJamesServer()
             .combineWith(CassandraJamesServerMain.cassandraServerModule)
             .overrideWith(new CassandraJmapServerModule(folder::getRoot, embeddedElasticSearch, embeddedCassandra),
                 (binder) -> binder.bind(DNSService.class).toInstance(inMemoryDNSService));

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java
new file mode 100644
index 0000000..f1ef305
--- /dev/null
+++ b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServer.java
@@ -0,0 +1,58 @@
+/****************************************************************
+ * 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;
+
+import java.util.Arrays;
+
+import org.apache.james.utils.JmapGuiceProbe;
+import org.apache.james.utils.WebAdminGuiceProbe;
+
+import com.google.common.collect.Iterables;
+import com.google.inject.Module;
+import com.google.inject.util.Modules;
+
+public class CassandraJamesServer extends GuiceJamesServer implements JmapServer, WebAdminServer {
+
+    public CassandraJamesServer() {
+        super();
+    }
+
+    public CassandraJamesServer(Module module) {
+        super(module);
+    }
+
+    public CassandraJamesServer combineWith(Module... modules) {
+        return new CassandraJamesServer(Modules.combine(Iterables.concat(Arrays.asList(module), Arrays.asList(modules))));
+    }
+
+    public CassandraJamesServer overrideWith(Module... overrides) {
+        return new CassandraJamesServer(Modules.override(module).with(overrides));
+    }
+
+    @Override
+    public JmapGuiceProbe getJmapProbe() {
+        return getGuiceProbeProvider().getProbe(JmapGuiceProbe.class);
+    }
+
+    @Override
+    public WebAdminGuiceProbe getWebAdminProbe() {
+        return getGuiceProbeProvider().getProbe(WebAdminGuiceProbe.class);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/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 12e163c..87f4a07 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
@@ -27,6 +27,7 @@ import org.apache.james.modules.data.CassandraUsersRepositoryModule;
 import org.apache.james.modules.mailbox.CassandraMailboxModule;
 import org.apache.james.modules.mailbox.CassandraSessionModule;
 import org.apache.james.modules.mailbox.ElasticSearchMailboxModule;
+import org.apache.james.modules.protocols.JMAPServerModule;
 import org.apache.james.modules.server.ActiveMQQueueModule;
 import org.apache.james.modules.server.JMXServerModule;
 import org.apache.james.modules.server.QuotaModule;
@@ -37,6 +38,7 @@ import com.google.inject.util.Modules;
 public class CassandraJamesServerMain {
 
     public static final Module cassandraServerModule = Modules.combine(
+        new JMAPServerModule(),
         new CassandraUsersRepositoryModule(),
         new CassandraDomainListModule(),
         new CassandraRecipientRewriteTableModule(),
@@ -50,7 +52,7 @@ public class CassandraJamesServerMain {
 
 
     public static void main(String[] args) throws Exception {
-        GuiceJmapJamesServer server = new GuiceJmapJamesServer()
+        GuiceJamesServer server = new GuiceJamesServer()
                     .combineWith(cassandraServerModule, new JMXServerModule());
         server.start();
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
index 2f53657..209a8d4 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/CassandraJamesServerTest.java
@@ -35,7 +35,7 @@ import com.google.inject.AbstractModule;
 import com.google.inject.Provides;
 import com.google.inject.Singleton;
 
-public class CassandraJamesServerTest extends AbstractJmapJamesServerTest {
+public class CassandraJamesServerTest extends AbstractJmapJamesServerTest<CassandraJamesServer> {
 
     private TemporaryFolder temporaryFolder = new TemporaryFolder();
     private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder);
@@ -45,8 +45,8 @@ public class CassandraJamesServerTest extends AbstractJmapJamesServerTest {
     public RuleChain chain = RuleChain.outerRule(temporaryFolder).around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJmapJamesServer createJamesServer() {
-        return new GuiceJmapJamesServer()
+    protected CassandraJamesServer createJamesServer() {
+        return new CassandraJamesServer()
                 .combineWith(CassandraJamesServerMain.cassandraServerModule)
                 .overrideWith(new TestElasticSearchModule(embeddedElasticSearch),
                         new TestFilesystemModule(temporaryFolder),

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
index 06d7872..e866369 100644
--- a/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
+++ b/server/container/guice/cassandra-guice/src/test/java/org/apache/james/JamesCapabilitiesServerTest.java
@@ -46,7 +46,7 @@ import com.google.inject.Singleton;
 
 public class JamesCapabilitiesServerTest {
 
-    private GuiceJmapJamesServer server;
+    private GuiceJamesServer server;
     private TemporaryFolder temporaryFolder = new TemporaryFolder();
     private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder);
 
@@ -58,10 +58,10 @@ public class JamesCapabilitiesServerTest {
         server.stop();
     }
     
-    private GuiceJmapJamesServer createCassandraJamesServer(final MailboxManager mailboxManager) {
+    private GuiceJamesServer createCassandraJamesServer(final MailboxManager mailboxManager) {
         Module mockMailboxManager = (binder) -> binder.bind(MailboxManager.class).toInstance(mailboxManager);
         
-        return new GuiceJmapJamesServer()
+        return new GuiceJamesServer()
             .combineWith(CassandraJamesServerMain.cassandraServerModule)
             .overrideWith(new TestElasticSearchModule(embeddedElasticSearch),
                 new TestFilesystemModule(temporaryFolder),

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
index d847783..9fa2efc 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJamesServer.java
@@ -19,19 +19,16 @@
 package org.apache.james;
 
 import java.util.Arrays;
-import java.util.Optional;
 
 import javax.annotation.PreDestroy;
 
 import org.apache.james.modules.CommonServicesModule;
 import org.apache.james.modules.MailetProcessingModule;
-import org.apache.james.modules.ProtocolsModuleWithoutJMAP;
+import org.apache.james.modules.ProtocolsModule;
 import org.apache.james.onami.lifecycle.Stager;
 import org.apache.james.utils.ConfigurationsPerformer;
-import org.apache.james.utils.ExtendedServerProbe;
+import org.apache.james.utils.GuiceProbeProvider;
 import org.apache.james.utils.GuiceServerProbe;
-import org.apache.james.webadmin.Port;
-import org.apache.james.webadmin.WebAdminServer;
 
 import com.google.common.collect.Iterables;
 import com.google.inject.Guice;
@@ -42,44 +39,34 @@ import com.google.inject.TypeLiteral;
 import com.google.inject.util.Modules;
 
 public class GuiceJamesServer {
-    private final Module module;
+    protected final Module module;
     private Stager<PreDestroy> preDestroy;
-    private GuiceServerProbe serverProbe;
-    private Optional<Port> webadminPort;
+    private GuiceProbeProvider guiceProbeProvider;
 
     public GuiceJamesServer() {
         this(Modules.combine(
                         new CommonServicesModule(),
-                        new ProtocolsModuleWithoutJMAP(),
+                        new ProtocolsModule(),
                         new MailetProcessingModule()));
     }
 
-    private GuiceJamesServer(Module module) {
+    protected GuiceJamesServer(Module module) {
         this.module = module;
     }
     
     public GuiceJamesServer combineWith(Module... modules) {
         return new GuiceJamesServer(Modules.combine(Iterables.concat(Arrays.asList(module), Arrays.asList(modules))));
     }
-    
+
     public GuiceJamesServer overrideWith(Module... overrides) {
         return new GuiceJamesServer(Modules.override(module).with(overrides));
     }
-    
+
     public void start() throws Exception {
         Injector injector = Guice.createInjector(module);
         preDestroy = injector.getInstance(Key.get(new TypeLiteral<Stager<PreDestroy>>() {}));
         injector.getInstance(ConfigurationsPerformer.class).initModules();
-        serverProbe = injector.getInstance(GuiceServerProbe.class);
-        webadminPort =locateWebAdminPort(injector);
-    }
-
-    private Optional<Port> locateWebAdminPort(Injector injector) {
-        try {
-            return Optional.of(injector.getInstance(WebAdminServer.class).getPort());
-        } catch(Exception e) {
-            return Optional.empty();
-        }
+        guiceProbeProvider = injector.getInstance(GuiceProbeProvider.class);
     }
 
     public void stop() {
@@ -88,12 +75,11 @@ public class GuiceJamesServer {
         }
     }
 
-    public ExtendedServerProbe serverProbe() {
-        return serverProbe;
+    public GuiceServerProbe serverProbe() {
+        return guiceProbeProvider.getProbe(GuiceServerProbe.class);
     }
 
-    public Optional<Port> getWebadminPort() {
-        return webadminPort;
+    protected GuiceProbeProvider getGuiceProbeProvider() {
+        return guiceProbeProvider;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJmapJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJmapJamesServer.java b/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJmapJamesServer.java
deleted file mode 100644
index 8a85b81..0000000
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/GuiceJmapJamesServer.java
+++ /dev/null
@@ -1,114 +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;
-
-import java.util.Arrays;
-import java.util.Optional;
-
-import javax.annotation.PreDestroy;
-
-import org.apache.james.jmap.JMAPServer;
-import org.apache.james.modules.CommonServicesModule;
-import org.apache.james.modules.MailetProcessingModule;
-import org.apache.james.modules.ProtocolsModule;
-import org.apache.james.onami.lifecycle.Stager;
-import org.apache.james.utils.ConfigurationsPerformer;
-import org.apache.james.utils.ExtendedJmapServerProbe;
-import org.apache.james.utils.JmapGuiceServerProbe;
-import org.apache.james.webadmin.Port;
-import org.apache.james.webadmin.WebAdminServer;
-
-import com.google.common.collect.Iterables;
-import com.google.inject.Guice;
-import com.google.inject.Injector;
-import com.google.inject.Key;
-import com.google.inject.Module;
-import com.google.inject.TypeLiteral;
-import com.google.inject.util.Modules;
-
-public class GuiceJmapJamesServer {
-
-    private final Module module;
-    private Stager<PreDestroy> preDestroy;
-    private JmapGuiceServerProbe serverProbe;
-    private Optional<Integer> jmapPort;
-    private Optional<Port> webadminPort;
-
-    public GuiceJmapJamesServer() {
-        this(Modules.combine(
-                        new CommonServicesModule(),
-                        new ProtocolsModule(),
-                        new MailetProcessingModule()));
-    }
-
-    private GuiceJmapJamesServer(Module module) {
-        this.module = module;
-    }
-    
-    public GuiceJmapJamesServer combineWith(Module... modules) {
-        return new GuiceJmapJamesServer(Modules.combine(Iterables.concat(Arrays.asList(module), Arrays.asList(modules))));
-    }
-    
-    public GuiceJmapJamesServer overrideWith(Module... overrides) {
-        return new GuiceJmapJamesServer(Modules.override(module).with(overrides));
-    }
-    
-    public void start() throws Exception {
-        Injector injector = Guice.createInjector(module);
-        preDestroy = injector.getInstance(Key.get(new TypeLiteral<Stager<PreDestroy>>() {}));
-        injector.getInstance(ConfigurationsPerformer.class).initModules();
-        serverProbe = injector.getInstance(JmapGuiceServerProbe.class);
-        jmapPort = locateJMAPPort(injector);
-        webadminPort =locateWebAdminPort(injector);
-    }
-
-    private Optional<Integer> locateJMAPPort(Injector injector) {
-        try {
-            return Optional.of(injector.getInstance(JMAPServer.class).getPort());
-        } catch(Exception e) {
-            return Optional.empty();
-        }
-    }
-
-    private Optional<Port> locateWebAdminPort(Injector injector) {
-        try {
-            return Optional.of(injector.getInstance(WebAdminServer.class).getPort());
-        } catch(Exception e) {
-            return Optional.empty();
-        }
-    }
-
-    public void stop() {
-        if (preDestroy != null) {
-            preDestroy.stage();
-        }
-    }
-
-    public ExtendedJmapServerProbe serverProbe() {
-        return serverProbe;
-    }
-
-    public Optional<Integer> getJmapPort() {
-        return jmapPort;
-    }
-
-    public Optional<Port> getWebadminPort() {
-        return webadminPort;
-    }
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/JmapServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/JmapServer.java b/server/container/guice/guice-common/src/main/java/org/apache/james/JmapServer.java
new file mode 100644
index 0000000..218c879
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/JmapServer.java
@@ -0,0 +1,26 @@
+/****************************************************************
+ * 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;
+
+import org.apache.james.utils.JmapGuiceProbe;
+
+public interface JmapServer {
+    JmapGuiceProbe getJmapProbe();
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/WebAdminServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/WebAdminServer.java b/server/container/guice/guice-common/src/main/java/org/apache/james/WebAdminServer.java
new file mode 100644
index 0000000..a08df88
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/WebAdminServer.java
@@ -0,0 +1,25 @@
+/****************************************************************
+ * 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;
+
+import org.apache.james.utils.WebAdminGuiceProbe;
+
+public interface WebAdminServer {
+    WebAdminGuiceProbe getWebAdminProbe();
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/modules/CommonServicesModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/CommonServicesModule.java b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/CommonServicesModule.java
index dfbbb8a..df0d349 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/CommonServicesModule.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/CommonServicesModule.java
@@ -24,6 +24,7 @@ import java.util.Optional;
 import javax.inject.Named;
 import javax.inject.Singleton;
 
+import com.google.inject.multibindings.Multibinder;
 import org.apache.commons.cli.MissingArgumentException;
 import org.apache.james.core.JamesServerResourceLoader;
 import org.apache.james.core.filesystem.FileSystemImpl;
@@ -37,6 +38,8 @@ import org.apache.james.onami.lifecycle.PreDestroyModule;
 import com.google.inject.AbstractModule;
 import com.google.inject.Provides;
 import com.google.inject.Scopes;
+import org.apache.james.utils.GuiceProbe;
+import org.apache.james.utils.GuiceServerProbe;
 
 public class CommonServicesModule extends AbstractModule {
     
@@ -56,6 +59,7 @@ public class CommonServicesModule extends AbstractModule {
         bind(FileSystemImpl.class).in(Scopes.SINGLETON);
 
         bind(FileSystem.class).to(FileSystemImpl.class);
+        Multibinder.newSetBinder(binder(), GuiceProbe.class).addBinding().to(GuiceServerProbe.class);
     }
 
     @Provides @Singleton @Named(CONFIGURATION_PATH)

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModule.java b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModule.java
index 28554b2..5a1822d 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModule.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModule.java
@@ -19,23 +19,19 @@
 package org.apache.james.modules;
 
 import org.apache.james.modules.protocols.IMAPServerModule;
-import org.apache.james.modules.protocols.JMAPServerModule;
 import org.apache.james.modules.protocols.LMTPServerModule;
 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.WebAdminServerModule;
-import org.apache.james.utils.JmapGuiceServerProbe;
 
 import com.google.inject.AbstractModule;
-import com.google.inject.Scopes;
 
 public class ProtocolsModule extends AbstractModule {
 
     @Override
     protected void configure() {
-        install(new JMAPServerModule());
         install(new IMAPServerModule());
         install(new ProtocolHandlerModule());
         install(new POP3ServerModule());
@@ -43,8 +39,6 @@ public class ProtocolsModule extends AbstractModule {
         install(new LMTPServerModule());
         install(new ManageSieveServerModule());
         install(new WebAdminServerModule());
-        
-        bind(JmapGuiceServerProbe.class).in(Scopes.SINGLETON);
     }
     
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModuleWithoutJMAP.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModuleWithoutJMAP.java b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModuleWithoutJMAP.java
deleted file mode 100644
index a945651..0000000
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/ProtocolsModuleWithoutJMAP.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.apache.james.modules;
-
-import org.apache.james.modules.protocols.IMAPServerModule;
-import org.apache.james.modules.protocols.LMTPServerModule;
-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.WebAdminServerModule;
-import org.apache.james.utils.GuiceServerProbe;
-
-import com.google.inject.AbstractModule;
-import com.google.inject.Scopes;
-
-public class ProtocolsModuleWithoutJMAP extends AbstractModule {
-    @Override
-    protected void configure() {
-        install(new IMAPServerModule());
-        install(new ProtocolHandlerModule());
-        install(new POP3ServerModule());
-        install(new SMTPServerModule());
-        install(new LMTPServerModule());
-        install(new ManageSieveServerModule());
-        install(new WebAdminServerModule());
-
-        bind(GuiceServerProbe.class).in(Scopes.SINGLETON);
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java
index f317b21..a04e1db 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java
@@ -27,6 +27,8 @@ import org.apache.james.jmap.JMAPServer;
 import org.apache.james.jmap.crypto.JamesSignatureHandler;
 import org.apache.james.lifecycle.api.Configurable;
 import org.apache.james.utils.ConfigurationPerformer;
+import org.apache.james.utils.GuiceProbe;
+import org.apache.james.utils.JmapGuiceProbe;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
 
 import com.google.common.base.Throwables;
@@ -42,6 +44,7 @@ public class JMAPServerModule extends AbstractModule {
     protected void configure() {
         install(new JMAPModule());
         Multibinder.newSetBinder(binder(), ConfigurationPerformer.class).addBinding().to(JMAPModuleConfigurationPerformer.class);
+        Multibinder.newSetBinder(binder(), GuiceProbe.class).addBinding().to(JmapGuiceProbe.class);
     }
 
     @Singleton

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/WebAdminServerModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/WebAdminServerModule.java b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/WebAdminServerModule.java
index 8fb0a6a..a9aed5c 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/WebAdminServerModule.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/WebAdminServerModule.java
@@ -29,7 +29,9 @@ import java.util.List;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.james.lifecycle.api.Configurable;
 import org.apache.james.utils.ConfigurationPerformer;
+import org.apache.james.utils.GuiceProbe;
 import org.apache.james.utils.PropertiesProvider;
+import org.apache.james.utils.WebAdminGuiceProbe;
 import org.apache.james.webadmin.FixedPort;
 import org.apache.james.webadmin.Port;
 import org.apache.james.webadmin.Routes;
@@ -62,6 +64,7 @@ public class WebAdminServerModule extends AbstractModule {
         routesMultibinder.addBinding().to(UserMailboxesRoutes.class);
 
         Multibinder.newSetBinder(binder(), ConfigurationPerformer.class).addBinding().to(WebAdminServerModuleConfigurationPerformer.class);
+        Multibinder.newSetBinder(binder(), GuiceProbe.class).addBinding().to(WebAdminGuiceProbe.class);
     }
 
     @Provides

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedJmapServerProbe.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedJmapServerProbe.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedJmapServerProbe.java
deleted file mode 100644
index 04f2292..0000000
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/ExtendedJmapServerProbe.java
+++ /dev/null
@@ -1,31 +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.utils;
-
-import org.apache.james.jmap.api.vacation.AccountId;
-import org.apache.james.jmap.api.vacation.Vacation;
-import org.apache.james.jmap.api.vacation.VacationPatch;
-
-public interface ExtendedJmapServerProbe extends ExtendedServerProbe {
-
-    void modifyVacation(AccountId accountId, VacationPatch vacationPatch);
-
-    Vacation retrieveVacation(AccountId accountId);
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceProbe.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceProbe.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceProbe.java
new file mode 100644
index 0000000..4d3b520
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceProbe.java
@@ -0,0 +1,22 @@
+/****************************************************************
+ * 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.utils;
+
+public interface GuiceProbe {
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceProbeProvider.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceProbeProvider.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceProbeProvider.java
new file mode 100644
index 0000000..7b98b6f
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceProbeProvider.java
@@ -0,0 +1,45 @@
+/****************************************************************
+ * 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.utils;
+
+import com.github.steveash.guavate.Guavate;
+import com.google.common.base.Preconditions;
+
+import javax.inject.Inject;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+
+public class GuiceProbeProvider {
+    private final Map<Class<GuiceProbe>, GuiceProbe> registry;
+
+    @Inject
+    public GuiceProbeProvider(Set<GuiceProbe> guiceProbes) {
+        this.registry = guiceProbes.stream()
+            .collect(Guavate.toImmutableMap(guiceProbe -> (Class<GuiceProbe>) guiceProbe.getClass()));
+    }
+
+    public <T extends GuiceProbe> T getProbe(Class<T> clazz) {
+        Preconditions.checkNotNull(clazz);
+        return Optional.ofNullable(registry.get(clazz))
+            .map(probe -> (T) probe)
+            .orElseThrow(() -> new RuntimeException("No probe registered for class: " + clazz));
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java
index 9cb8c07..e7457dd 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/GuiceServerProbe.java
@@ -54,9 +54,9 @@ import com.google.common.base.Throwables;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Iterables;
 
-public class GuiceServerProbe implements ExtendedServerProbe {
+public class GuiceServerProbe implements ExtendedServerProbe, GuiceProbe {
 
-    private static final Logger LOGGER = LoggerFactory.getLogger(JmapGuiceServerProbe.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(JmapGuiceProbe.class);
 
     private final MailboxManager mailboxManager;
     private final MailboxMapperFactory mailboxMapperFactory;

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceProbe.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceProbe.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceProbe.java
new file mode 100644
index 0000000..9d881e0
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceProbe.java
@@ -0,0 +1,56 @@
+/****************************************************************
+ * 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.utils;
+
+import org.apache.james.jmap.JMAPServer;
+import org.apache.james.jmap.api.vacation.AccountId;
+import org.apache.james.jmap.api.vacation.Vacation;
+import org.apache.james.jmap.api.vacation.VacationPatch;
+import org.apache.james.jmap.api.vacation.VacationRepository;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.inject.Inject;
+
+public class JmapGuiceProbe implements GuiceProbe {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(JmapGuiceProbe.class);
+
+    private final VacationRepository vacationRepository;
+    private final JMAPServer jmapServer;
+
+    @Inject
+    private JmapGuiceProbe(VacationRepository vacationRepository, JMAPServer jmapServer) {
+        this.vacationRepository = vacationRepository;
+        this.jmapServer = jmapServer;
+    }
+
+    public int getJmapPort() {
+        return jmapServer.getPort();
+    }
+
+    public void modifyVacation(AccountId accountId, VacationPatch vacationPatch) {
+        vacationRepository.modifyVacation(accountId, vacationPatch).join();
+    }
+
+    public Vacation retrieveVacation(AccountId accountId) {
+        return vacationRepository.retrieveVacation(accountId).join();
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceServerProbe.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceServerProbe.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceServerProbe.java
deleted file mode 100644
index b2ca5d5..0000000
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/JmapGuiceServerProbe.java
+++ /dev/null
@@ -1,368 +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.utils;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import javax.inject.Inject;
-import javax.mail.Flags;
-
-import org.apache.commons.lang.NotImplementedException;
-import org.apache.james.adapter.mailbox.SerializableQuota;
-import org.apache.james.domainlist.api.DomainList;
-import org.apache.james.jmap.api.vacation.AccountId;
-import org.apache.james.jmap.api.vacation.Vacation;
-import org.apache.james.jmap.api.vacation.VacationPatch;
-import org.apache.james.jmap.api.vacation.VacationRepository;
-import org.apache.james.mailbox.MailboxManager;
-import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.MessageManager;
-import org.apache.james.mailbox.exception.MailboxException;
-import org.apache.james.mailbox.model.MailboxConstants;
-import org.apache.james.mailbox.model.MailboxMetaData;
-import org.apache.james.mailbox.model.MailboxPath;
-import org.apache.james.mailbox.model.MailboxQuery;
-import org.apache.james.mailbox.store.mail.MailboxMapper;
-import org.apache.james.mailbox.store.mail.MailboxMapperFactory;
-import org.apache.james.mailbox.store.mail.model.Mailbox;
-import org.apache.james.rrt.api.RecipientRewriteTable;
-import org.apache.james.rrt.lib.Mappings;
-import org.apache.james.sieverepository.api.SieveRepository;
-import org.apache.james.user.api.UsersRepository;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Throwables;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-
-public class JmapGuiceServerProbe implements ExtendedJmapServerProbe {
-
-    private static final Logger LOGGER = LoggerFactory.getLogger(JmapGuiceServerProbe.class);
-
-    private final MailboxManager mailboxManager;
-    private final MailboxMapperFactory mailboxMapperFactory;
-    private final DomainList domainList;
-    private final UsersRepository usersRepository;
-    private final SieveRepository sieveRepository;
-    private final RecipientRewriteTable recipientRewriteTable;
-    private final VacationRepository vacationRepository;
-
-    @Inject
-    private JmapGuiceServerProbe(MailboxManager mailboxManager, MailboxMapperFactory mailboxMapperFactory,
-                             DomainList domainList, UsersRepository usersRepository, SieveRepository sieveRepository,
-                             RecipientRewriteTable recipientRewriteTable, VacationRepository vacationRepository) {
-        this.mailboxManager = mailboxManager;
-        this.mailboxMapperFactory = mailboxMapperFactory;
-        this.domainList = domainList;
-        this.usersRepository = usersRepository;
-        this.sieveRepository = sieveRepository;
-        this.recipientRewriteTable = recipientRewriteTable;
-        this.vacationRepository = vacationRepository;
-    }
-
-    @Override
-    public void close() throws IOException {
-    }
-
-    @Override
-    public void addUser(String userName, String password) throws Exception {
-        usersRepository.addUser(userName, password);
-    }
-
-    @Override
-    public void removeUser(String username) throws Exception {
-        usersRepository.removeUser(username);
-    }
-
-    @Override
-    public String[] listUsers() throws Exception {
-        return Iterables.toArray(ImmutableList.copyOf(usersRepository.list()), String.class);
-    }
-
-    @Override
-    public void setPassword(String userName, String password) throws Exception {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void addDomain(String domain) throws Exception {
-        domainList.addDomain(domain);
-    }
-
-    @Override
-    public boolean containsDomain(String domain) throws Exception {
-        return domainList.containsDomain(domain);
-    }
-
-    @Override
-    public String getDefaultDomain() throws Exception {
-        return domainList.getDefaultDomain();
-    }
-
-    @Override
-    public void removeDomain(String domain) throws Exception {
-        domainList.removeDomain(domain);
-    }
-
-    @Override
-    public List<String> listDomains() throws Exception {
-        return domainList.getDomains();
-    }
-
-    @Override
-    public Map<String, Mappings> listMappings() throws Exception {
-        return recipientRewriteTable.getAllMappings();
-    }
-
-    @Override
-    public void addAddressMapping(String user, String domain, String toAddress) throws Exception {
-        recipientRewriteTable.addAddressMapping(user, domain, toAddress);
-    }
-
-    @Override
-    public void removeAddressMapping(String user, String domain, String fromAddress) throws Exception {
-        recipientRewriteTable.removeAddressMapping(user, domain, fromAddress);
-    }
-
-    @Override
-    public Mappings listUserDomainMappings(String user, String domain) throws Exception {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void addRegexMapping(String user, String domain, String regex) throws Exception {
-        recipientRewriteTable.addRegexMapping(user, domain, regex);
-    }
-
-    @Override
-    public void removeRegexMapping(String user, String domain, String regex) throws Exception {
-        recipientRewriteTable.removeRegexMapping(user, domain, regex);
-    }
-
-    @Override
-    public void copyMailbox(String srcBean, String dstBean) throws Exception {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void deleteUserMailboxesNames(String user) throws Exception {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void createMailbox(String namespace, String user, String name) {
-        MailboxSession mailboxSession = null;
-        try {
-            mailboxSession = mailboxManager.createSystemSession(user, LOGGER);
-            mailboxManager.startProcessingRequest(mailboxSession);
-            mailboxManager.createMailbox(new MailboxPath(namespace, user, name), mailboxSession);
-        } catch (MailboxException e) {
-            throw Throwables.propagate(e);
-        } finally {
-            closeSession(mailboxSession);
-        }
-    }
-
-    @Override
-    public Mailbox getMailbox(String namespace, String user, String name) {
-        MailboxSession mailboxSession = null;
-        try {
-            mailboxSession = mailboxManager.createSystemSession(user, LOGGER);
-            MailboxMapper mailboxMapper = mailboxMapperFactory.getMailboxMapper(mailboxSession);
-            return mailboxMapper.findMailboxByPath(new MailboxPath(namespace, user, name));
-        } catch (MailboxException e) {
-            throw Throwables.propagate(e);
-        } finally {
-            closeSession(mailboxSession);
-        }
-    }
-
-    private void closeSession(MailboxSession session) {
-        if (session != null) {
-            mailboxManager.endProcessingRequest(session);
-            try {
-                mailboxManager.logout(session, true);
-            } catch (MailboxException e) {
-                throw Throwables.propagate(e);
-            }
-        }
-    }
-
-    @Override
-    public Collection<String> listUserMailboxes(String user) {
-        MailboxSession mailboxSession = null;
-        try {
-            mailboxSession = mailboxManager.createSystemSession(user, LOGGER);
-            mailboxManager.startProcessingRequest(mailboxSession);
-            return searchUserMailboxes(user, mailboxSession)
-                    .stream()
-                    .map(MailboxMetaData::getPath)
-                    .map(MailboxPath::getName)
-                    .collect(Collectors.toList());
-        } catch (MailboxException e) {
-            throw Throwables.propagate(e);
-        } finally {
-            closeSession(mailboxSession);
-        }
-    }
-
-    private List<MailboxMetaData> searchUserMailboxes(String username, MailboxSession session) throws MailboxException {
-        return mailboxManager.search(
-            new MailboxQuery(new MailboxPath(MailboxConstants.USER_NAMESPACE, username, ""),
-                "*",
-                session.getPathDelimiter()),
-            session);
-    }
-
-    @Override
-    public void deleteMailbox(String namespace, String user, String name) {
-        MailboxSession mailboxSession = null;
-        try {
-            mailboxSession = mailboxManager.createSystemSession(user, LOGGER);
-            mailboxManager.startProcessingRequest(mailboxSession);
-            mailboxManager.deleteMailbox(new MailboxPath(namespace, user, name), mailboxSession);
-        } catch (MailboxException e) {
-            throw Throwables.propagate(e);
-        } finally {
-            closeSession(mailboxSession);
-        }
-    }
-
-    @Override
-    public String getQuotaRoot(String namespace, String user, String name) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public SerializableQuota getMessageCountQuota(String quotaRoot) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public SerializableQuota getStorageQuota(String quotaRoot) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public long getMaxMessageCount(String quotaRoot) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public long getMaxStorage(String quotaRoot) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public long getDefaultMaxMessageCount() throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public long getDefaultMaxStorage() throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void setMaxMessageCount(String quotaRoot, long maxMessageCount) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void setMaxStorage(String quotaRoot, long maxSize) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void setDefaultMaxMessageCount(long maxDefaultMessageCount) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void setDefaultMaxStorage(long maxDefaultSize) throws MailboxException {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void appendMessage(String username, MailboxPath mailboxPath, InputStream message, Date internalDate, boolean isRecent, Flags flags) 
-            throws MailboxException {
-        
-        MailboxSession mailboxSession = mailboxManager.createSystemSession(username, LOGGER);
-        MessageManager messageManager = mailboxManager.getMailbox(mailboxPath, mailboxSession);
-        messageManager.appendMessage(message, internalDate, mailboxSession, isRecent, flags);
-    }
-
-    @Override
-    public void reIndexMailbox(String namespace, String user, String name) throws Exception {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void reIndexAll() throws Exception {
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public long getSieveQuota() throws Exception {
-        return sieveRepository.getQuota();
-    }
-
-    @Override
-    public void setSieveQuota(long quota) throws Exception {
-        sieveRepository.setQuota(quota);
-    }
-
-    @Override
-    public void removeSieveQuota() throws Exception {
-        sieveRepository.removeQuota();
-    }
-
-    @Override
-    public long getSieveQuota(String user) throws Exception {
-        return sieveRepository.getQuota(user);
-    }
-
-    @Override
-    public void setSieveQuota(String user, long quota) throws Exception {
-        sieveRepository.setQuota(user, quota);
-    }
-
-    @Override
-    public void removeSieveQuota(String user) throws Exception {
-        sieveRepository.removeQuota(user);
-    }
-
-    @Override
-    public void modifyVacation(AccountId accountId, VacationPatch vacationPatch) {
-        vacationRepository.modifyVacation(accountId, vacationPatch).join();
-    }
-
-    @Override
-    public Vacation retrieveVacation(AccountId accountId) {
-        return vacationRepository.retrieveVacation(accountId).join();
-    }
-}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/main/java/org/apache/james/utils/WebAdminGuiceProbe.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/utils/WebAdminGuiceProbe.java b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/WebAdminGuiceProbe.java
new file mode 100644
index 0000000..a68155c
--- /dev/null
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/utils/WebAdminGuiceProbe.java
@@ -0,0 +1,37 @@
+/****************************************************************
+ * 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.utils;
+
+import javax.inject.Inject;
+
+import org.apache.james.webadmin.WebAdminServer;
+
+public class WebAdminGuiceProbe implements GuiceProbe {
+    private final WebAdminServer webAdminServer;
+
+    @Inject
+    public WebAdminGuiceProbe(WebAdminServer webAdminServer) {
+        this.webAdminServer = webAdminServer;
+    }
+
+    public int getWebAdminPort() {
+        return webAdminServer.getPort().toInt();
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
index 43eb665..4de3ba6 100644
--- a/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
+++ b/server/container/guice/guice-common/src/test/java/org/apache/james/AbstractJmapJamesServerTest.java
@@ -30,6 +30,7 @@ import java.nio.ByteBuffer;
 import java.nio.channels.SocketChannel;
 import java.nio.charset.Charset;
 
+import org.apache.james.utils.JmapGuiceProbe;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -39,7 +40,7 @@ import com.jayway.restassured.RestAssured;
 import com.jayway.restassured.builder.RequestSpecBuilder;
 import com.jayway.restassured.http.ContentType;
 
-public abstract class AbstractJmapJamesServerTest {
+public abstract class AbstractJmapJamesServerTest<T extends GuiceJamesServer & JmapServer & WebAdminServer> {
 
     private static final int IMAP_PORT = 1143; // You need to be root (superuser) to bind to ports under 1024.
     private static final int IMAP_PORT_SSL = 1993;
@@ -47,7 +48,7 @@ public abstract class AbstractJmapJamesServerTest {
     private static final int SMTP_PORT = 1025;
     private static final int LMTP_PORT = 1024;
 
-    private GuiceJmapJamesServer server;
+    private T server;
     private SocketChannel socketChannel;
 
     @Before
@@ -60,12 +61,12 @@ public abstract class AbstractJmapJamesServerTest {
         		.setContentType(ContentType.JSON)
         		.setAccept(ContentType.JSON)
         		.setConfig(newConfig().encoderConfig(encoderConfig().defaultContentCharset(Charsets.UTF_8)))
-        		.setPort(server.getJmapPort()
-                        .orElseThrow(() -> new RuntimeException("Unable to locate JMAP port")))
+        		.setPort(server.getJmapProbe()
+                    .getJmapPort())
         		.build();
     }
 
-    protected abstract GuiceJmapJamesServer createJamesServer();
+    protected abstract T createJamesServer();
 
     protected abstract void clean();
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/guice-common/src/test/java/org/apache/james/utils/GuiceProbeProviderTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/test/java/org/apache/james/utils/GuiceProbeProviderTest.java b/server/container/guice/guice-common/src/test/java/org/apache/james/utils/GuiceProbeProviderTest.java
new file mode 100644
index 0000000..f4f73ec
--- /dev/null
+++ b/server/container/guice/guice-common/src/test/java/org/apache/james/utils/GuiceProbeProviderTest.java
@@ -0,0 +1,68 @@
+/****************************************************************
+ * 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.utils;
+import static  org.assertj.core.api.Assertions.assertThat;
+
+import com.google.common.collect.ImmutableSet;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+import static org.junit.Assert.*;
+
+public class GuiceProbeProviderTest {
+
+    private GuiceProbeProvider guiceProbeProvider;
+    @Rule
+    public ExpectedException expectedException = ExpectedException.none();
+    private GuiceProbe1 guiceProbe1;
+
+    @Before
+    public void setUp() throws Exception {
+        guiceProbe1 = new GuiceProbe1();
+        guiceProbeProvider = new GuiceProbeProvider(ImmutableSet.of(guiceProbe1));
+    }
+
+    @Test
+    public void getProveShouldThrowExcpetionWhenNull() {
+        expectedException.expect(NullPointerException.class);
+
+        guiceProbeProvider.getProbe(null);
+    }
+    @Test
+    public void getProbeShouldThrowRuntimeExceptionWhenEmpty() {
+        expectedException.expect(RuntimeException.class);
+
+        guiceProbeProvider.getProbe(GuiceProbe2.class);
+    }
+
+    @Test
+    public void getProbeShouldReturnRightProbe() {
+        assertThat(guiceProbeProvider.getProbe(GuiceProbe1.class)).isEqualTo(guiceProbe1);
+    }
+
+    class GuiceProbe1 implements GuiceProbe {
+
+    }
+
+    class GuiceProbe2 implements GuiceProbe {
+
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPASieveRepositoryModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPASieveRepositoryModule.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPASieveRepositoryModule.java
index 13fff5b..d5dac1c 100644
--- a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPASieveRepositoryModule.java
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/data/JPASieveRepositoryModule.java
@@ -1,3 +1,21 @@
+/****************************************************************
+ * 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.data;
 
 import org.apache.james.sieverepository.api.SieveRepository;

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java
index dbb3435..53cbc01 100644
--- a/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java
+++ b/server/container/guice/jpa-guice/src/main/java/org/apache/james/modules/mailbox/LuceneSearchMailboxModule.java
@@ -22,6 +22,10 @@ package org.apache.james.modules.mailbox;
 import java.io.File;
 import java.io.IOException;
 
+import org.apache.james.core.JamesServerResourceLoader;
+import org.apache.james.core.filesystem.FileSystemImpl;
+import org.apache.james.filesystem.api.FileSystem;
+import org.apache.james.filesystem.api.JamesDirectoriesProvider;
 import org.apache.james.mailbox.lucene.search.LuceneMessageSearchIndex;
 import org.apache.james.mailbox.store.search.ListeningMessageSearchIndex;
 import org.apache.james.mailbox.store.search.MessageSearchIndex;
@@ -44,7 +48,7 @@ public class LuceneSearchMailboxModule extends AbstractModule {
 
     @Provides
     @Singleton
-    Directory provideDirectory() throws IOException {
-        return FSDirectory.open(new File("Lucene"));
+    Directory provideDirectory(FileSystem fileSystem) throws IOException {
+        return FSDirectory.open(fileSystem.getBasedir());
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServer.java
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServer.java b/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServer.java
new file mode 100644
index 0000000..7a5e52f
--- /dev/null
+++ b/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServer.java
@@ -0,0 +1,56 @@
+/****************************************************************
+ * 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;
+
+import java.util.Arrays;
+
+import org.apache.james.utils.JmapGuiceProbe;
+import org.apache.james.utils.WebAdminGuiceProbe;
+
+import com.google.common.collect.Iterables;
+import com.google.inject.Module;
+import com.google.inject.util.Modules;
+
+public class MemoryJamesServer extends GuiceJamesServer implements JmapServer, WebAdminServer {
+    public MemoryJamesServer() {
+        super();
+    }
+
+    public MemoryJamesServer(Module module) {
+        super(module);
+    }
+
+    public MemoryJamesServer combineWith(Module... modules) {
+        return new MemoryJamesServer(Modules.combine(Iterables.concat(Arrays.asList(module), Arrays.asList(modules))));
+    }
+
+    public MemoryJamesServer overrideWith(Module... overrides) {
+        return new MemoryJamesServer(Modules.override(module).with(overrides));
+    }
+
+    @Override
+    public JmapGuiceProbe getJmapProbe() {
+        return getGuiceProbeProvider().getProbe(JmapGuiceProbe.class);
+    }
+
+    @Override
+    public WebAdminGuiceProbe getWebAdminProbe() {
+        return getGuiceProbeProvider().getProbe(WebAdminGuiceProbe.class);
+    }
+}

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServerMain.java
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServerMain.java b/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServerMain.java
index 43d6532..cfeeb42 100644
--- a/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServerMain.java
+++ b/server/container/guice/memory-guice/src/main/java/org/apache/james/MemoryJamesServerMain.java
@@ -22,6 +22,7 @@ package org.apache.james;
 import org.apache.james.modules.data.MemoryDataJmapModule;
 import org.apache.james.modules.data.MemoryDataModule;
 import org.apache.james.modules.mailbox.MemoryMailboxModule;
+import org.apache.james.modules.protocols.JMAPServerModule;
 import org.apache.james.modules.server.JMXServerModule;
 import org.apache.james.modules.server.MemoryMailQueueModule;
 import org.apache.james.modules.server.QuotaModule;
@@ -32,6 +33,7 @@ import com.google.inject.util.Modules;
 public class MemoryJamesServerMain {
 
     public static final Module inMemoryServerModule = Modules.combine(
+        new JMAPServerModule(),
         new MemoryDataModule(),
         new MemoryDataJmapModule(),
         new MemoryMailboxModule(),
@@ -39,7 +41,7 @@ public class MemoryJamesServerMain {
         new MemoryMailQueueModule());
 
     public static void main(String[] args) throws Exception {
-        new GuiceJmapJamesServer()
+        new MemoryJamesServer()
             .combineWith(inMemoryServerModule, new JMXServerModule())
             .start();
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
----------------------------------------------------------------------
diff --git a/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java b/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
index 424c772..14d85ea 100644
--- a/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
+++ b/server/container/guice/memory-guice/src/test/java/org/apache/james/MemoryJamesServerTest.java
@@ -25,14 +25,14 @@ import org.apache.james.modules.TestJMAPServerModule;
 import org.junit.Rule;
 import org.junit.rules.TemporaryFolder;
 
-public class MemoryJamesServerTest extends AbstractJmapJamesServerTest {
+public class MemoryJamesServerTest extends AbstractJmapJamesServerTest<MemoryJamesServer> {
 
     @Rule
     public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
     @Override
-    protected GuiceJmapJamesServer createJamesServer() {
-        return new GuiceJmapJamesServer()
+    protected MemoryJamesServer createJamesServer() {
+        return new MemoryJamesServer()
                 .combineWith(MemoryJamesServerMain.inMemoryServerModule)
                 .overrideWith(new TestFilesystemModule(temporaryFolder),
                         new TestJMAPServerModule(GetMessageListMethod.DEFAULT_MAXIMUM_LIMIT));

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
----------------------------------------------------------------------
diff --git a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
index e440250..a23d552 100644
--- a/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
+++ b/server/mailet/integration-testing/src/test/java/org/apache/james/mailets/TemporaryJamesServer.java
@@ -28,11 +28,12 @@ import java.util.Arrays;
 
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.io.IOUtils;
-import org.apache.james.GuiceJmapJamesServer;
+import org.apache.james.GuiceJamesServer;
+import org.apache.james.MemoryJamesServer;
 import org.apache.james.MemoryJamesServerMain;
 import org.apache.james.mailets.configuration.MailetContainer;
 import org.apache.james.modules.TestJMAPServerModule;
-import org.apache.james.utils.ExtendedJmapServerProbe;
+import org.apache.james.utils.GuiceServerProbe;
 import org.junit.rules.TemporaryFolder;
 
 import com.google.common.collect.ImmutableList;
@@ -44,13 +45,13 @@ public class TemporaryJamesServer {
 
     private static final int LIMIT_TO_3_MESSAGES = 3;
 
-    private final GuiceJmapJamesServer jamesServer;
+    private final MemoryJamesServer jamesServer;
 
 
     public TemporaryJamesServer(TemporaryFolder temporaryFolder, MailetContainer mailetContainer, Module... additionalModules) throws Exception {
         appendMailetConfigurations(temporaryFolder, mailetContainer);
 
-        jamesServer = new GuiceJmapJamesServer()
+        jamesServer = new MemoryJamesServer()
             .combineWith(MemoryJamesServerMain.inMemoryServerModule)
             .overrideWith(ImmutableList.<Module>builder().addAll(Arrays.asList(additionalModules))
                 .add(new TestJMAPServerModule(LIMIT_TO_3_MESSAGES))
@@ -76,7 +77,7 @@ public class TemporaryJamesServer {
         jamesServer.stop();
     }
 
-    public ExtendedJmapServerProbe getServerProbe() {
+    public GuiceServerProbe getServerProbe() {
         return jamesServer.serverProbe();
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMailboxesMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMailboxesMethodTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMailboxesMethodTest.java
index c9c4207..ff36364 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMailboxesMethodTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMailboxesMethodTest.java
@@ -19,8 +19,8 @@
 
 package org.apache.james.jmap.cassandra;
 
+import org.apache.james.CassandraJamesServer;
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.methods.integration.GetMailboxesMethodTest;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -30,7 +30,7 @@ import org.junit.rules.RuleChain;
 import org.junit.rules.TemporaryFolder;
 
 
-public class CassandraGetMailboxesMethodTest extends GetMailboxesMethodTest {
+public class CassandraGetMailboxesMethodTest extends GetMailboxesMethodTest<CassandraJamesServer> {
 
     private TemporaryFolder temporaryFolder = new TemporaryFolder();
     private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder);
@@ -42,8 +42,8 @@ public class CassandraGetMailboxesMethodTest extends GetMailboxesMethodTest {
         .around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJmapJamesServer createJmapServer() {
-        return new GuiceJmapJamesServer()
+    protected CassandraJamesServer createJmapServer() {
+        return new CassandraJamesServer()
                     .combineWith(CassandraJamesServerMain.cassandraServerModule)
                     .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMessageListMethodTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMessageListMethodTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMessageListMethodTest.java
index 387c801..c6b62f9 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMessageListMethodTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetMessageListMethodTest.java
@@ -19,8 +19,8 @@
 
 package org.apache.james.jmap.cassandra;
 
+import org.apache.james.CassandraJamesServer;
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.methods.integration.GetMessageListMethodTest;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -29,7 +29,7 @@ import org.junit.Rule;
 import org.junit.rules.RuleChain;
 import org.junit.rules.TemporaryFolder;
 
-public class CassandraGetMessageListMethodTest extends GetMessageListMethodTest {
+public class CassandraGetMessageListMethodTest extends GetMessageListMethodTest<CassandraJamesServer> {
 
     private TemporaryFolder temporaryFolder = new TemporaryFolder();
     private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder);
@@ -41,8 +41,8 @@ public class CassandraGetMessageListMethodTest extends GetMessageListMethodTest
         .around(embeddedElasticSearch);
     
     @Override
-    protected GuiceJmapJamesServer createJmapServer() {
-        return new GuiceJmapJamesServer()
+    protected CassandraJamesServer createJmapServer() {
+        return new CassandraJamesServer()
                 .combineWith(CassandraJamesServerMain.cassandraServerModule)
                 .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/ebbf1e6f/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetVacationResponseTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetVacationResponseTest.java b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetVacationResponseTest.java
index 3aeca25..14227f6 100644
--- a/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetVacationResponseTest.java
+++ b/server/protocols/jmap-integration-testing/cassandra-jmap-integration-testing/src/test/java/org/apache/james/jmap/cassandra/CassandraGetVacationResponseTest.java
@@ -19,8 +19,8 @@
 
 package org.apache.james.jmap.cassandra;
 
+import org.apache.james.CassandraJamesServer;
 import org.apache.james.CassandraJamesServerMain;
-import org.apache.james.GuiceJmapJamesServer;
 import org.apache.james.backends.cassandra.EmbeddedCassandra;
 import org.apache.james.jmap.methods.integration.GetVacationResponseTest;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
@@ -30,7 +30,7 @@ import org.junit.Rule;
 import org.junit.rules.RuleChain;
 import org.junit.rules.TemporaryFolder;
 
-public class CassandraGetVacationResponseTest extends GetVacationResponseTest {
+public class CassandraGetVacationResponseTest extends GetVacationResponseTest<CassandraJamesServer> {
 
     private TemporaryFolder temporaryFolder = new TemporaryFolder();
     private EmbeddedElasticSearch embeddedElasticSearch = new EmbeddedElasticSearch(temporaryFolder);
@@ -42,8 +42,8 @@ public class CassandraGetVacationResponseTest extends GetVacationResponseTest {
         .around(embeddedElasticSearch);
 
     @Override
-    protected GuiceJmapJamesServer createJmapServer(ZonedDateTimeProvider zonedDateTimeProvider) {
-        return new GuiceJmapJamesServer()
+    protected CassandraJamesServer createJmapServer(ZonedDateTimeProvider zonedDateTimeProvider) {
+        return new CassandraJamesServer()
                     .combineWith(CassandraJamesServerMain.cassandraServerModule)
                     .overrideWith(new CassandraJmapServerModule(temporaryFolder, embeddedElasticSearch, cassandra),
                         binder -> binder.bind(ZonedDateTimeProvider.class).toInstance(zonedDateTimeProvider));


---------------------------------------------------------------------
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