Class GridEmbeddedFuture<A,B>
- java.lang.Object
-
- org.apache.ignite.internal.util.future.GridFutureAdapter<A>
-
- org.apache.ignite.internal.util.future.GridEmbeddedFuture<A,B>
-
- All Implemented Interfaces:
IgniteInternalFuture<A>
- Direct Known Subclasses:
GridDhtEmbeddedFuture
public class GridEmbeddedFuture<A,B> extends GridFutureAdapter<A>
Future which waits for embedded future to complete and then asynchronously executes provided closure with embedded future result.
-
-
Constructor Summary
Constructors Constructor Description GridEmbeddedFuture(IgniteInternalFuture<B> embedded, IgniteBiClosure<B,Exception,IgniteInternalFuture<A>> c)Embeds futures.GridEmbeddedFuture(IgniteInternalFuture<B> embedded, IgniteBiClosure<B,Exception,IgniteInternalFuture<A>> c1, IgniteBiClosure<A,Exception,A> c2)Embeds futures.GridEmbeddedFuture(IgniteInternalFuture<B> embedded, IgniteOutClosure<IgniteInternalFuture<A>> c)GridEmbeddedFuture(IgniteBiClosure<B,Exception,A> c, IgniteInternalFuture<B> embedded)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancel()Default no-op implementation that always returnsfalse.booleanisCancelled()Returnstrueif this computation was cancelled before it completed normally.StringtoString()-
Methods inherited from class org.apache.ignite.internal.util.future.GridFutureAdapter
chain, chain, chain, chain, chainCompose, chainCompose, error, get, get, get, getUninterruptibly, ignoreInterrupts, isDone, isFailed, listen, listen, logger, onCancelled, onDone, onDone, onDone, onDone, onDone, reset, result
-
-
-
-
Constructor Detail
-
GridEmbeddedFuture
public GridEmbeddedFuture(IgniteBiClosure<B,Exception,A> c, IgniteInternalFuture<B> embedded)
- Parameters:
c- Closure to execute upon completion of embedded future.embedded- Embedded future.
-
GridEmbeddedFuture
public GridEmbeddedFuture(IgniteInternalFuture<B> embedded, IgniteBiClosure<B,Exception,IgniteInternalFuture<A>> c)
Embeds futures. Specific change order of arguments to avoid conflicts.- Parameters:
embedded- Embedded future.c- Closure which runs upon completion of embedded closure and which returns another future.
-
GridEmbeddedFuture
public GridEmbeddedFuture(IgniteInternalFuture<B> embedded, IgniteBiClosure<B,Exception,IgniteInternalFuture<A>> c1, IgniteBiClosure<A,Exception,A> c2)
Embeds futures.- Parameters:
embedded- Future.c1- Closure which runs upon completion of embedded future and which returns another future.c2- Closure will runs upon completion of future returned byc1closure.
-
GridEmbeddedFuture
public GridEmbeddedFuture(IgniteInternalFuture<B> embedded, IgniteOutClosure<IgniteInternalFuture<A>> c)
- Parameters:
embedded- Embedded future.c- Closure to create next future.
-
-
Method Detail
-
cancel
public boolean cancel() throws IgniteCheckedExceptionDefault no-op implementation that always returnsfalse. Futures that do support cancellation should override this method and callGridFutureAdapter.onCancelled()callback explicitly if cancellation indeed did happen.- Specified by:
cancelin interfaceIgniteInternalFuture<A>- Overrides:
cancelin classGridFutureAdapter<A>- Returns:
Trueif future was canceled (i.e. was not finished prior to this call).- Throws:
IgniteCheckedException- If cancellation failed.
-
isCancelled
public boolean isCancelled()
Returnstrueif this computation was cancelled before it completed normally.- Specified by:
isCancelledin interfaceIgniteInternalFuture<A>- Overrides:
isCancelledin classGridFutureAdapter<A>- Returns:
Trueif this computation was cancelled before it completed normally.
-
toString
public String toString()
- Overrides:
toStringin classGridFutureAdapter<A>
-
-