james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rouaz...@apache.org
Subject [james-project] 03/09: MAILBOX-383 JMAPServer only needs to be startable
Date Tue, 11 Jun 2019 13:22:33 GMT
This is an automated email from the ASF dual-hosted git repository.

rouazana pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit b2c8d5a4edf9c0f2917d5448486e26aa6b2b8da8
Author: Benoit Tellier <btellier@linagora.com>
AuthorDate: Wed Jun 5 15:22:52 2019 +0700

    MAILBOX-383 JMAPServer only needs to be startable
    
    No configuration operation actually takes place so `Configurable` implementation is inapropriate...
---
 .../org/apache/james/modules/protocols/JMAPServerModule.java     | 5 +----
 .../jmap/src/main/java/org/apache/james/jmap/JMAPServer.java     | 9 +++------
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java
b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java
index 972c721..f51549c 100644
--- a/server/container/guice/protocols/jmap/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java
+++ b/server/container/guice/protocols/jmap/src/main/java/org/apache/james/modules/protocols/JMAPServerModule.java
@@ -22,7 +22,6 @@ package org.apache.james.modules.protocols;
 import java.security.Security;
 import java.util.List;
 
-import org.apache.commons.configuration.HierarchicalConfiguration;
 import org.apache.james.jmap.JMAPConfiguration;
 import org.apache.james.jmap.JMAPModule;
 import org.apache.james.jmap.JMAPServer;
@@ -42,8 +41,6 @@ import com.google.inject.multibindings.Multibinder;
 
 public class JMAPServerModule extends AbstractModule {
 
-    private static final HierarchicalConfiguration NULL_CONFIGURATION = null;
-
     @Override
     protected void configure() {
         install(new JMAPModule());
@@ -71,7 +68,7 @@ public class JMAPServerModule extends AbstractModule {
             try {
                 if (jmapConfiguration.isEnabled()) {
                     signatureHandler.init();
-                    server.configure(NULL_CONFIGURATION);
+                    server.start();
                     registerPEMWithSecurityProvider();
                 }
             } catch (Exception e) {
diff --git a/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPServer.java b/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPServer.java
index 2881e68..efde946 100644
--- a/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPServer.java
+++ b/server/protocols/jmap/src/main/java/org/apache/james/jmap/JMAPServer.java
@@ -27,12 +27,10 @@ import java.util.Optional;
 import javax.annotation.PreDestroy;
 import javax.inject.Inject;
 
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.configuration.HierarchicalConfiguration;
 import org.apache.james.http.jetty.Configuration;
 import org.apache.james.http.jetty.Configuration.Builder;
 import org.apache.james.http.jetty.JettyHttpServer;
-import org.apache.james.lifecycle.api.Configurable;
+import org.apache.james.lifecycle.api.Startable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.zalando.logbook.DefaultHttpLogWriter;
@@ -42,7 +40,7 @@ import org.zalando.logbook.servlet.LogbookFilter;
 
 import com.github.fge.lambdas.Throwing;
 
-public class JMAPServer implements Configurable {
+public class JMAPServer implements Startable {
 
     private static final Logger HTTP_JMAP_LOGGER = LoggerFactory.getLogger("http.jmap");
     private final Optional<JettyHttpServer> server;
@@ -104,8 +102,7 @@ public class JMAPServer implements Configurable {
                 .build();
     }
 
-    @Override
-    public void configure(HierarchicalConfiguration config) throws ConfigurationException
{
+    public void start() {
         server.ifPresent(Throwing.consumer(JettyHttpServer::start).sneakyThrow());
     }
 


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