usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdun...@apache.org
Subject [1/4] usergrid git commit: Add OnlyOnceJob fix to 9f45130
Date Fri, 08 Apr 2016 17:02:52 GMT
Repository: usergrid
Updated Branches:
  refs/heads/release-2.1.1 4326b105e -> e0a995243


Add OnlyOnceJob fix to 9f45130


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

Branch: refs/heads/release-2.1.1
Commit: 55271ce9347bd4f35224a2c31494b23fa371ae67
Parents: 9f45130
Author: Mike Dunker <mdunker@apigee.com>
Authored: Thu Apr 7 15:33:43 2016 -0700
Committer: Mike Dunker <mdunker@apigee.com>
Committed: Thu Apr 7 15:33:43 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/usergrid/batch/job/OnlyOnceJob.java | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/55271ce9/stack/core/src/main/java/org/apache/usergrid/batch/job/OnlyOnceJob.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/batch/job/OnlyOnceJob.java b/stack/core/src/main/java/org/apache/usergrid/batch/job/OnlyOnceJob.java
index f857d05..afbddc3 100644
--- a/stack/core/src/main/java/org/apache/usergrid/batch/job/OnlyOnceJob.java
+++ b/stack/core/src/main/java/org/apache/usergrid/batch/job/OnlyOnceJob.java
@@ -19,7 +19,7 @@ package org.apache.usergrid.batch.job;
 
 import java.util.concurrent.TimeUnit;
 
-import org.elasticsearch.common.inject.Inject;
+import com.google.inject.Injector;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.apache.usergrid.batch.Job;
@@ -28,6 +28,8 @@ import org.apache.usergrid.locking.Lock;
 import org.apache.usergrid.locking.LockManager;
 import org.apache.usergrid.persistence.EntityManagerFactory;
 
+import javax.annotation.PostConstruct;
+
 
 /**
  * Simple abstract job class that performs additional locking to ensure that the job is only
executing once. This can be
@@ -38,12 +40,14 @@ import org.apache.usergrid.persistence.EntityManagerFactory;
 @Component("OnlyOnceJob")
 public abstract class OnlyOnceJob implements Job {
 
-    @Inject
     private LockManager lockManager;
 
     @Autowired
     private EntityManagerFactory emf;
 
+    @Autowired
+    private Injector injector;
+
 
     /**
      *
@@ -51,6 +55,10 @@ public abstract class OnlyOnceJob implements Job {
     public OnlyOnceJob() {
     }
 
+    @PostConstruct
+    public void initLockManager() throws Exception {
+        this.lockManager = injector.getInstance(LockManager.class);
+    }
 
     /*
      * (non-Javadoc)


Mime
View raw message