cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abulat...@apache.org
Subject [cayenne] 02/03: CAY-2562 Make ROPServerModule autoloaded
Date Fri, 26 Apr 2019 10:19:08 GMT
This is an automated email from the ASF dual-hosted git repository.

abulatski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git

commit 8d953094d9ebab1a75f4cc662a3d00c11eb85bd0
Author: Arseni Bulatski <ancarseni@gmail.com>
AuthorDate: Thu Apr 11 15:31:05 2019 +0300

    CAY-2562 Make ROPServerModule autoloaded
---
 .../configuration/rop/server/ROPServerModule.java     | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/cayenne-rop-server/src/main/java/org/apache/cayenne/configuration/rop/server/ROPServerModule.java
b/cayenne-rop-server/src/main/java/org/apache/cayenne/configuration/rop/server/ROPServerModule.java
index f6a5dea..e883758 100644
--- a/cayenne-rop-server/src/main/java/org/apache/cayenne/configuration/rop/server/ROPServerModule.java
+++ b/cayenne-rop-server/src/main/java/org/apache/cayenne/configuration/rop/server/ROPServerModule.java
@@ -18,6 +18,8 @@
  ****************************************************************/
 package org.apache.cayenne.configuration.rop.server;
 
+import java.util.Map;
+
 import org.apache.cayenne.configuration.Constants;
 import org.apache.cayenne.di.Binder;
 import org.apache.cayenne.di.MapBuilder;
@@ -35,6 +37,8 @@ import org.apache.cayenne.rop.ServerHttpRemoteService;
  */
 public class ROPServerModule implements Module {
 
+    protected Map<String, String> eventBridgeProperties;
+
     /**
      * @since 4.0
      */
@@ -42,7 +46,22 @@ public class ROPServerModule implements Module {
         return binder.bindMap(String.class, Constants.SERVER_ROP_EVENT_BRIDGE_PROPERTIES_MAP);
     }
 
+    public ROPServerModule() {}
+
+    /**
+     * @deprecated since 4.2 ROPServerModule became autoloaded.
+     * You need to contribute eventBridgeProperties yourself.
+     */
+    @Deprecated
+    public ROPServerModule(Map<String, String> eventBridgeProperties) {
+        this.eventBridgeProperties = eventBridgeProperties;
+    }
+
     public void configure(Binder binder) {
+        if(eventBridgeProperties != null) {
+            MapBuilder<String> mapBuilder = contributeROPBridgeProperties(binder);
+            mapBuilder.putAll(eventBridgeProperties);
+        }
         binder.bind(RemoteService.class).to(ServerHttpRemoteService.class);
 		binder.bind(ROPSerializationService.class).toProvider(ServerHessianSerializationServiceProvider.class);
     }


Mime
View raw message