|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.continuent.tungsten.replicator.util.Watch<E>
public class Watch<E>
Implements a "watch" operation that waits for a predicate to be fulfilled on a particular event in an event processing queue.
| Constructor Summary | |
|---|---|
Watch(WatchPredicate<E> predicate,
int taskCount)
Create watch with predicate and task count. |
|
Watch(WatchPredicate<E> predicate,
int taskCount,
WatchAction<E> action)
Create watch with all components. |
|
| Method Summary | |
|---|---|
boolean |
cancel(boolean mayInterruptIfRunning)
|
E |
get()
|
E |
get(long timeout,
java.util.concurrent.TimeUnit unit)
|
WatchAction<E> |
getAction()
Returns the action or null if no action is defined. |
boolean[] |
getMatched()
Returns the array of matched conditions. |
WatchPredicate<E> |
getPredicate()
Returns the watch predicate. |
boolean |
isCancelled()
|
boolean |
isDone()
|
boolean |
offer(E event,
int taskId)
Offer an event to this watch instance. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Watch(WatchPredicate<E> predicate,
int taskCount)
public Watch(WatchPredicate<E> predicate,
int taskCount,
WatchAction<E> action)
predicate - Predicate to matchaction - Action to executetaskCount - Number of tasks that must report for a match| Method Detail |
|---|
public WatchPredicate<E> getPredicate()
public WatchAction<E> getAction()
public boolean[] getMatched()
public boolean cancel(boolean mayInterruptIfRunning)
cancel in interface java.util.concurrent.Future<E>Future.cancel(boolean)
public E get()
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException
get in interface java.util.concurrent.Future<E>java.lang.InterruptedException
java.util.concurrent.ExecutionExceptionFuture.get()
public E get(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException,
java.util.concurrent.TimeoutException
get in interface java.util.concurrent.Future<E>java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutExceptionFuture.get(long, java.util.concurrent.TimeUnit)public boolean isCancelled()
isCancelled in interface java.util.concurrent.Future<E>Future.isCancelled()public boolean isDone()
isDone in interface java.util.concurrent.Future<E>Future.isDone()
public boolean offer(E event,
int taskId)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||