usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [10/12] usergrid git commit: Ensure the lock manager is injected as a singleton.
Date Sat, 16 Jan 2016 00:44:50 GMT
Ensure the lock manager is injected as a singleton.


Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/289cc97c
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/289cc97c
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/289cc97c

Branch: refs/heads/master
Commit: 289cc97c34d5fbe4ec16ac376da85621055524a1
Parents: 0071df0
Author: Michael Russo <michaelarusso@gmail.com>
Authored: Fri Jan 15 12:26:20 2016 -0800
Committer: Michael Russo <michaelarusso@gmail.com>
Committed: Fri Jan 15 12:26:20 2016 -0800

----------------------------------------------------------------------
 .../apache/usergrid/locking/cassandra/AstyanaxLockManagerImpl.java | 2 ++
 .../main/java/org/apache/usergrid/locking/guice/LockModule.java    | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/289cc97c/stack/core/src/main/java/org/apache/usergrid/locking/cassandra/AstyanaxLockManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/locking/cassandra/AstyanaxLockManagerImpl.java
b/stack/core/src/main/java/org/apache/usergrid/locking/cassandra/AstyanaxLockManagerImpl.java
index f310118..1fcd1b7 100644
--- a/stack/core/src/main/java/org/apache/usergrid/locking/cassandra/AstyanaxLockManagerImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/locking/cassandra/AstyanaxLockManagerImpl.java
@@ -19,6 +19,7 @@ package org.apache.usergrid.locking.cassandra;
 
 import com.google.common.collect.ImmutableMap;
 import com.google.inject.Inject;
+import com.google.inject.Singleton;
 import com.netflix.astyanax.Keyspace;
 import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
 import com.netflix.astyanax.ddl.ColumnFamilyDefinition;
@@ -41,6 +42,7 @@ import java.util.Map;
 import java.util.UUID;
 import java.util.concurrent.TimeUnit;
 
+@Singleton
 public class AstyanaxLockManagerImpl implements LockManager {
 
     private static final Logger logger = LoggerFactory.getLogger( AstyanaxLockManagerImpl.class
);

http://git-wip-us.apache.org/repos/asf/usergrid/blob/289cc97c/stack/core/src/main/java/org/apache/usergrid/locking/guice/LockModule.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/locking/guice/LockModule.java b/stack/core/src/main/java/org/apache/usergrid/locking/guice/LockModule.java
index 49c58fe..79e2b67 100644
--- a/stack/core/src/main/java/org/apache/usergrid/locking/guice/LockModule.java
+++ b/stack/core/src/main/java/org/apache/usergrid/locking/guice/LockModule.java
@@ -32,7 +32,7 @@ public class LockModule extends AbstractModule {
     @Override
     protected void configure() {
 
-        bind( LockManager.class ).to( AstyanaxLockManagerImpl.class );
+        bind( LockManager.class ).to( AstyanaxLockManagerImpl.class ).asEagerSingleton();
 
     }
 }


Mime
View raw message