Repository: camel Updated Branches: refs/heads/camel-2.11.x fda86665a -> d2fb2296b refs/heads/master 62bce5144 -> 9a575cd85
Improved javadoc contract of idempotent repo. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9a575cd8 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9a575cd8 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9a575cd8 Branch: refs/heads/master Commit: 9a575cd850f4df15f8b085fcd0548f8ba886bdff Parents: 62bce51 Author: Claus Ibsen <davscl...@apache.org> Authored: Thu Feb 20 09:53:16 2014 +0100 Committer: Claus Ibsen <davscl...@apache.org> Committed: Thu Feb 20 09:56:07 2014 +0100 ---------------------------------------------------------------------- .../org/apache/camel/spi/IdempotentRepository.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/9a575cd8/camel-core/src/main/java/org/apache/camel/spi/IdempotentRepository.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/spi/IdempotentRepository.java b/camel-core/src/main/java/org/apache/camel/spi/IdempotentRepository.java index 65a484a..29d6d1b 100644 --- a/camel-core/src/main/java/org/apache/camel/spi/IdempotentRepository.java +++ b/camel-core/src/main/java/org/apache/camel/spi/IdempotentRepository.java @@ -23,6 +23,13 @@ import org.apache.camel.Service; * <a href="http://camel.apache.org/idempotent-consumer.html">Idempotent Consumer</a> pattern. * <p/> * The <tt>add</tt> and <tt>contains</tt> methods is operating according to the {@link java.util.Set} contract. + * <p/> + * The repository supports eager (default) and non-eager mode. + * <ul> + * <li>eager: calls <tt>add</tt> and <tt>confirm</tt> if complete, or <tt>remove</tt> if failed</li> + * <li>non-eager: calls <tt>contains</tt> and <tt>add</tt> if complete, or <tt>remove</tt> if failed</li> + * </ul> + * Notice the remove callback, can be configured to be disabled. * * @version */ @@ -30,6 +37,8 @@ public interface IdempotentRepository<E> extends Service { /** * Adds the key to the repository. + * <p/> + * <b>Important:</b> Read the class javadoc about eager vs non-eager mode. * * @param key the key of the message for duplicate test * @return <tt>true</tt> if this repository did <b>not</b> already contain the specified element @@ -39,7 +48,7 @@ public interface IdempotentRepository<E> extends Service { /** * Returns <tt>true</tt> if this repository contains the specified element. * <p/> - * This operation is used if the option <tt>eager</tt> has been enabled. + * <b>Important:</b> Read the class javadoc about eager vs non-eager mode. * * @param key the key of the message * @return <tt>true</tt> if this repository contains the specified element @@ -50,6 +59,8 @@ public interface IdempotentRepository<E> extends Service { * Removes the key from the repository. * <p/> * Is usually invoked if the exchange failed. + * <p/> + * <b>Important:</b> Read the class javadoc about eager vs non-eager mode. * * @param key the key of the message for duplicate test * @return <tt>true</tt> if the key was removed @@ -59,7 +70,7 @@ public interface IdempotentRepository<E> extends Service { /** * Confirms the key, after the exchange has been processed successfully. * <p/> - * This operation is used if the option <tt>eager</tt> has been enabled. + * <b>Important:</b> Read the class javadoc about eager vs non-eager mode. * * @param key the key of the message for duplicate test * @return <tt>true</tt> if the key was confirmed