Class ClosingFuture.CloseableList
java.lang.Object
java.util.AbstractMap<K,V>
java.util.IdentityHashMap<AutoCloseable,Executor>
com.google.common.util.concurrent.ClosingFuture.CloseableList
- All Implemented Interfaces:
Closeable,Serializable,AutoCloseable,Cloneable,Map<AutoCloseable,Executor>
- Enclosing class:
- ClosingFuture<V>
private static final class ClosingFuture.CloseableList
extends IdentityHashMap<AutoCloseable,Executor>
implements Closeable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate final ClosingFuture.DeferredCloserprivate CountDownLatch -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidadd(AutoCloseable closeable, Executor executor) (package private) <V,U> FluentFuture<U> applyAsyncClosingFunction(ClosingFuture.AsyncClosingFunction<V, U> transformation, V input) (package private) <V,U> ListenableFuture<U> applyClosingFunction(ClosingFuture.ClosingFunction<? super V, U> transformation, V input) voidclose()(package private) CountDownLatchReturns a latch that reaches zero when this objects' deferred closeables have been closed.Methods inherited from class java.util.IdentityHashMap
clear, clone, containsKey, containsValue, entrySet, equals, forEach, get, hashCode, isEmpty, keySet, put, putAll, remove, replaceAll, size, valuesMethods inherited from class java.util.AbstractMap
toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, getOrDefault, merge, putIfAbsent, remove, replace, replace
-
Field Details
-
closer
-
closed
private volatile boolean closed -
whenClosed
-
-
Constructor Details
-
CloseableList
private CloseableList()
-
-
Method Details
-
applyClosingFunction
<V,U> ListenableFuture<U> applyClosingFunction(ClosingFuture.ClosingFunction<? super V, U> transformation, V input) throws Exception- Throws:
Exception
-
applyAsyncClosingFunction
<V,U> FluentFuture<U> applyAsyncClosingFunction(ClosingFuture.AsyncClosingFunction<V, U> transformation, V input) throws Exception- Throws:
Exception
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
add
-
whenClosedCountDown
CountDownLatch whenClosedCountDown()Returns a latch that reaches zero when this objects' deferred closeables have been closed.
-