You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/02/19 11:36:03 UTC

camel git commit: Validte that the lock has been configured with mandatory options

Repository: camel
Updated Branches:
  refs/heads/master b7667a422 -> 34e2c13b7


Validte that the lock has been configured with mandatory options


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/34e2c13b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/34e2c13b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/34e2c13b

Branch: refs/heads/master
Commit: 34e2c13b7f495e80d42ea3ccedc4c44dae9406d9
Parents: b7667a4
Author: Claus Ibsen <da...@apache.org>
Authored: Sun Feb 19 12:34:02 2017 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun Feb 19 12:34:02 2017 +0100

----------------------------------------------------------------------
 .../component/hazelcast/policy/HazelcastRoutePolicy.java      | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/34e2c13b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/policy/HazelcastRoutePolicy.java
----------------------------------------------------------------------
diff --git a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/policy/HazelcastRoutePolicy.java b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/policy/HazelcastRoutePolicy.java
index 8d9e142..45bb421 100644
--- a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/policy/HazelcastRoutePolicy.java
+++ b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/policy/HazelcastRoutePolicy.java
@@ -30,6 +30,8 @@ import org.apache.camel.NonManagedService;
 import org.apache.camel.Route;
 import org.apache.camel.component.hazelcast.HazelcastUtil;
 import org.apache.camel.support.RoutePolicySupport;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.StringHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -99,6 +101,11 @@ public class HazelcastRoutePolicy extends RoutePolicySupport implements NonManag
 
     @Override
     protected void doStart() throws Exception {
+        // validate
+        StringHelper.notEmpty(lockMapName, "lockMapName", this);
+        StringHelper.notEmpty(lockKey, "lockKey", this);
+        StringHelper.notEmpty(lockValue, "lockValue", this);
+
         locks = instance.getMap(lockMapName);
         future = executorService.submit(this::acquireLeadership);