Class RefFutureImpl<T>
java.lang.Object
org.apache.jena.sparql.service.enhancer.claimingcache.RefDelegateBase<CompletableFuture<T>,Ref<CompletableFuture<T>>>
org.apache.jena.sparql.service.enhancer.claimingcache.RefFutureImpl<T>
- All Implemented Interfaces:
AutoCloseable
,Ref<CompletableFuture<T>>
,RefDelegate<CompletableFuture<T>,
,Ref<CompletableFuture<T>>> RefFuture<T>
public class RefFutureImpl<T>
extends RefDelegateBase<CompletableFuture<T>,Ref<CompletableFuture<T>>>
implements RefFuture<T>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionacquire()
static void
cancelFutureOrCloseRef
(CompletableFuture<? extends Ref<?>> future) static <T> void
cancelFutureOrCloseValue
(CompletableFuture<T> future, Consumer<? super T> valueCloseAction) Registers a whenComplete action that closes the value if loaded.static <T> RefFuture<T>
fromFuture
(CompletableFuture<Ref<T>> future, Object synchronizer) Create a ref that upon close cancels the future or closes the ref when it is available sstatic <T> RefFuture<T>
Wrap an existing ref with completed futurestatic <T> RefFuture<T>
wrap
(Ref<CompletableFuture<T>> delegate) A simple wrapping of an instance ofRef<CompletableFuture<T>>
as a more handy instance ofRefFuture<T>
.Methods inherited from class org.apache.jena.sparql.service.enhancer.claimingcache.RefDelegateBase
getDelegate
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.jena.sparql.service.enhancer.claimingcache.Ref
acquireMapped
Methods inherited from interface org.apache.jena.sparql.service.enhancer.claimingcache.RefDelegate
acquire, close, get, getAcquisitionStackTrace, getCloseStackTrace, getCloseTriggerStackTrace, getDelegate, getRootRef, getSynchronizer, isAlive, isClosed
Methods inherited from interface org.apache.jena.sparql.service.enhancer.claimingcache.RefFuture
acquireTransformed, acquireTransformedAndCloseThis, await
-
Constructor Details
-
RefFutureImpl
-
-
Method Details
-
acquire
-
wrap
A simple wrapping of an instance ofRef<CompletableFuture<T>>
as a more handy instance ofRefFuture<T>
. All methods of the returned RefFuture delegate to the original Ref. Note, thatRefFuture<T>
is a sub-interface ofRef<CompletableFuture<T>>
. -
fromRef
Wrap an existing ref with completed future -
fromFuture
Create a ref that upon close cancels the future or closes the ref when it is available s -
cancelFutureOrCloseRef
-
cancelFutureOrCloseValue
public static <T> void cancelFutureOrCloseValue(CompletableFuture<T> future, Consumer<? super T> valueCloseAction) Registers a whenComplete action that closes the value if loaded. Then immediately attempts to cancel the future.
-