camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [04/13] camel git commit: CAMEL-8728: Hazelcast idempotent repository - Should use locks
Date Sun, 03 May 2015 09:03:58 GMT
CAMEL-8728: Hazelcast idempotent repository - Should use locks


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

Branch: refs/heads/master
Commit: 511aa2e2546b8505ba214a1da33037e5140487ef
Parents: 855a925
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Sun May 3 07:58:00 2015 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sun May 3 10:52:35 2015 +0200

----------------------------------------------------------------------
 .../idempotent/hazelcast/HazelcastIdempotentRepository.java   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/511aa2e2/components/camel-hazelcast/src/main/java/org/apache/camel/processor/idempotent/hazelcast/HazelcastIdempotentRepository.java
----------------------------------------------------------------------
diff --git a/components/camel-hazelcast/src/main/java/org/apache/camel/processor/idempotent/hazelcast/HazelcastIdempotentRepository.java
b/components/camel-hazelcast/src/main/java/org/apache/camel/processor/idempotent/hazelcast/HazelcastIdempotentRepository.java
index a8c1003..4061240 100644
--- a/components/camel-hazelcast/src/main/java/org/apache/camel/processor/idempotent/hazelcast/HazelcastIdempotentRepository.java
+++ b/components/camel-hazelcast/src/main/java/org/apache/camel/processor/idempotent/hazelcast/HazelcastIdempotentRepository.java
@@ -68,7 +68,12 @@ public class HazelcastIdempotentRepository extends ServiceSupport implements
Ide
 
     @Override
     public boolean contains(String key) {
-        return this.repo.containsKey(key);
+        repo.lock(key);
+        try {
+            return this.repo.containsKey(key);
+        } finally {
+            repo.unlock(key);
+        }
     }
 
     @Override


Mime
View raw message