Class ClosingFuture.CloseableList
java.lang.Object
java.util.AbstractMap<AutoCloseable,Executor>
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,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private final ClosingFuture.DeferredCloser
private CountDownLatch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
add
(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) void
close()
(package private) CountDownLatch
Returns 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, remove, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, getOrDefault, merge, putIfAbsent, 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
add
-
whenClosedCountDown
CountDownLatch whenClosedCountDown()Returns a latch that reaches zero when this objects' deferred closeables have been closed.
-