cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [1/3] cayenne git commit: CAY-2442 Broken EventBridge providers implementations
Date Fri, 06 Jul 2018 08:02:04 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 22c2e789e -> b2c611036


CAY-2442 Broken EventBridge providers implementations

(cherry picked from commit 7c849e7)


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/5bd1ff0d
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/5bd1ff0d
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/5bd1ff0d

Branch: refs/heads/master
Commit: 5bd1ff0d53ce26491e02b72e1eee8b873ea5dcf3
Parents: 22c2e78
Author: Nikita Timofeev <stariy95@gmail.com>
Authored: Thu Jul 5 17:43:42 2018 +0300
Committer: Nikita Timofeev <stariy95@gmail.com>
Committed: Fri Jul 6 10:59:09 2018 +0300

----------------------------------------------------------------------
 .../cayenne/access/DefaultDataRowStoreFactory.java     | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/5bd1ff0d/cayenne-server/src/main/java/org/apache/cayenne/access/DefaultDataRowStoreFactory.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/DefaultDataRowStoreFactory.java
b/cayenne-server/src/main/java/org/apache/cayenne/access/DefaultDataRowStoreFactory.java
index 22b5e2f..4925a6d 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/DefaultDataRowStoreFactory.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/DefaultDataRowStoreFactory.java
@@ -23,9 +23,10 @@ import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.di.DIRuntimeException;
 import org.apache.cayenne.di.Inject;
+import org.apache.cayenne.di.Provider;
 import org.apache.cayenne.event.EventBridge;
 import org.apache.cayenne.event.EventManager;
-import org.apache.cayenne.event.NoopEventBridge;
+import org.apache.cayenne.event.NoopEventBridgeProvider;
 
 import java.util.Map;
 
@@ -36,7 +37,7 @@ import java.util.Map;
  */
 public class DefaultDataRowStoreFactory implements DataRowStoreFactory {
 
-    EventBridge eventBridge;
+    Provider<EventBridge> eventBridgeProvider;
 
     EventManager eventManager;
 
@@ -44,13 +45,13 @@ public class DefaultDataRowStoreFactory implements DataRowStoreFactory
{
 
     boolean isNoopEventBridge;
 
-    public DefaultDataRowStoreFactory(@Inject EventBridge eventBridge,
+    public DefaultDataRowStoreFactory(@Inject Provider<EventBridge> eventBridgeProvider,
                                       @Inject EventManager eventManager,
                                       @Inject RuntimeProperties properties) {
-        this.eventBridge = eventBridge;
+        this.eventBridgeProvider = eventBridgeProvider;
         this.eventManager = eventManager;
         this.properties = properties;
-        isNoopEventBridge = eventBridge instanceof NoopEventBridge;
+        isNoopEventBridge = eventBridgeProvider instanceof NoopEventBridgeProvider;
     }
 
     @Override
@@ -65,7 +66,7 @@ public class DefaultDataRowStoreFactory implements DataRowStoreFactory {
             return;
         }
         try {
-            store.setEventBridge(eventBridge);
+            store.setEventBridge(eventBridgeProvider.get());
             store.startListeners();
         } catch (Exception ex) {
             throw new CayenneRuntimeException("Error initializing DataRowStore.", ex);


Mime
View raw message