com.atlassian.crowd.manager.webhook
Class KeyedExecutor<K>
java.lang.Object
com.atlassian.crowd.manager.webhook.KeyedExecutor<K>
public class KeyedExecutor<K>
- extends Object
A task executor that discards tasks if there is another existing task with the same key queued for execution.
Keys must be valid Map keys, i.e., they must be immutable and have equals() and hashMap().
- Since:
- v2.7
|
Method Summary |
void |
execute(Runnable runnable,
K key)
Adds a Runnable to the executor queue. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KeyedExecutor
public KeyedExecutor(Executor delegateExecutor)
execute
public void execute(Runnable runnable,
K key)
- Adds a Runnable to the executor queue. If there is another Runnable with the same key that is awaiting
its execution, then the new Runnable is discarded.
- Parameters:
runnable - the runnable task.key - task key. Must be immutable and have equals() and hashMap().
Copyright © 2014 Atlassian. All Rights Reserved.