james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [3/4] james-project git commit: JAMES-1741 use .in(Scopes.SINGLETON) rather than .in(Singleton.class) in Guice modules
Date Fri, 20 May 2016 12:05:00 GMT
JAMES-1741 use .in(Scopes.SINGLETON) rather than .in(Singleton.class) in Guice modules


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

Branch: refs/heads/master
Commit: 8d8950866b1754f1561db3a9793dec4b4bf64a59
Parents: 0b4cf7e
Author: Benoit Tellier <btellier@linagora.com>
Authored: Thu May 19 17:39:51 2016 +0700
Committer: Benoit Tellier <btellier@linagora.com>
Committed: Fri May 20 19:04:10 2016 +0700

----------------------------------------------------------------------
 .../main/java/org/apache/james/jmap/JMAPCommonModule.java    | 8 +++-----
 .../src/main/java/org/apache/james/jmap/JMAPModule.java      | 2 +-
 .../src/main/java/org/apache/james/jmap/MethodsModule.java   | 8 ++++----
 .../org/apache/james/modules/server/ActiveMQQueueModule.java | 2 +-
 4 files changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/8d895086/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPCommonModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPCommonModule.java
b/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPCommonModule.java
index a3a7f02..df546e7 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPCommonModule.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPCommonModule.java
@@ -39,7 +39,6 @@ import com.google.common.collect.ImmutableList;
 import com.google.inject.AbstractModule;
 import com.google.inject.Provides;
 import com.google.inject.Scopes;
-import com.google.inject.Singleton;
 import com.google.inject.name.Names;
 
 public class JMAPCommonModule extends AbstractModule {
@@ -51,14 +50,13 @@ public class JMAPCommonModule extends AbstractModule {
         bind(SignatureHandler.class).to(JamesSignatureHandler.class).in(Scopes.SINGLETON);
         bind(ZonedDateTimeProvider.class).to(DefaultZonedDateTimeProvider.class).in(Scopes.SINGLETON);
         bind(ContinuationTokenManager.class).to(SignedContinuationTokenManager.class).in(Scopes.SINGLETON);
+        bind(MailSpool.class).in(Scopes.SINGLETON);
+        bind(MailFactory.class).in(Scopes.SINGLETON);
+        bind(AutomaticallySentMailDetectorImpl.class).in(Scopes.SINGLETON);
 
         bindConstant().annotatedWith(Names.named(AccessTokenRepository.TOKEN_EXPIRATION_IN_MS)).to(DEFAULT_TOKEN_EXPIRATION_IN_MS);
         bind(AccessTokenManager.class).to(AccessTokenManagerImpl.class).in(Scopes.SINGLETON);
 
-        bind(MailSpool.class).in(Singleton.class);
-        bind(MailFactory.class).in(Singleton.class);
-
-        bind(AutomaticallySentMailDetectorImpl.class).in(Scopes.SINGLETON);
         bind(AutomaticallySentMailDetector.class).to(AutomaticallySentMailDetectorImpl.class);
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d895086/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPModule.java
b/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPModule.java
index b7c809f..0744b49 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPModule.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/JMAPModule.java
@@ -56,7 +56,7 @@ public class JMAPModule extends AbstractModule {
         install(new JMAPCommonModule());
         install(new MethodsModule());
         bind(JMAPServer.class).in(Scopes.SINGLETON);
-        bind(RequestHandler.class).in(Singleton.class);
+        bind(RequestHandler.class).in(Scopes.SINGLETON);
         Multibinder.newSetBinder(binder(), ConfigurationPerformer.class).addBinding().to(MoveCapabilityPrecondition.class);
 
         Multibinder<CamelMailetContainerModule.TransportProcessorCheck> transportProcessorChecks
= Multibinder.newSetBinder(binder(), CamelMailetContainerModule.TransportProcessorCheck.class);

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d895086/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/MethodsModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/MethodsModule.java
b/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/MethodsModule.java
index c8dc863..710ff2c 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/MethodsModule.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/jmap/MethodsModule.java
@@ -42,7 +42,7 @@ import org.apache.james.jmap.methods.SetMessagesUpdateProcessor;
 import org.apache.james.jmap.methods.SetVacationResponseMethod;
 
 import com.google.inject.AbstractModule;
-import com.google.inject.Singleton;
+import com.google.inject.Scopes;
 import com.google.inject.multibindings.Multibinder;
 import com.google.inject.name.Names;
 
@@ -50,9 +50,9 @@ public class MethodsModule extends AbstractModule {
 
     @Override
     protected void configure() {
-        bind(JmapRequestParser.class).to(JmapRequestParserImpl.class).in(Singleton.class);
-        bind(JmapResponseWriter.class).to(JmapResponseWriterImpl.class).in(Singleton.class);
-        bind(ObjectMapperFactory.class).in(Singleton.class);
+        bind(JmapRequestParser.class).to(JmapRequestParserImpl.class).in(Scopes.SINGLETON);
+        bind(JmapResponseWriter.class).to(JmapResponseWriterImpl.class).in(Scopes.SINGLETON);
+        bind(ObjectMapperFactory.class).in(Scopes.SINGLETON);
 
         bindConstant().annotatedWith(Names.named(GetMessageListMethod.MAXIMUM_LIMIT)).to(GetMessageListMethod.DEFAULT_MAXIMUM_LIMIT);
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/8d895086/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/ActiveMQQueueModule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/ActiveMQQueueModule.java
b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/ActiveMQQueueModule.java
index e39bfbd..ae267d7 100644
--- a/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/ActiveMQQueueModule.java
+++ b/server/container/guice/guice-common/src/main/java/org/apache/james/modules/server/ActiveMQQueueModule.java
@@ -40,7 +40,7 @@ public class ActiveMQQueueModule extends AbstractModule {
     @Override
     protected void configure() {
         bind(EmbeddedActiveMQ.class).in(Scopes.SINGLETON);
-        bind(MailQueueItemDecoratorFactory.class).to(PostDequeueDecoratorFactory.class).in(Singleton.class);
+        bind(MailQueueItemDecoratorFactory.class).to(PostDequeueDecoratorFactory.class).in(Scopes.SINGLETON);
     }
     
     @Provides


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