Class ClosingFuture.CloseableList
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.IdentityHashMap<java.lang.AutoCloseable,java.util.concurrent.Executor>
-
- com.google.common.util.concurrent.ClosingFuture.CloseableList
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Serializable
,java.lang.AutoCloseable
,java.lang.Cloneable
,java.util.Map<java.lang.AutoCloseable,java.util.concurrent.Executor>
- Enclosing class:
- ClosingFuture<V>
private static final class ClosingFuture.CloseableList extends java.util.IdentityHashMap<java.lang.AutoCloseable,java.util.concurrent.Executor> implements java.io.Closeable
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
closed
private ClosingFuture.DeferredCloser
closer
private java.util.concurrent.CountDownLatch
whenClosed
-
Constructor Summary
Constructors Modifier Constructor Description private
CloseableList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
add(java.lang.AutoCloseable closeable, java.util.concurrent.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) java.util.concurrent.CountDownLatch
whenClosedCountDown()
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, replaceAll, size, values
-
-
-
-
Field Detail
-
closer
private final ClosingFuture.DeferredCloser closer
-
closed
private volatile boolean closed
-
whenClosed
private volatile java.util.concurrent.CountDownLatch whenClosed
-
-
Method Detail
-
applyClosingFunction
<V,U> ListenableFuture<U> applyClosingFunction(ClosingFuture.ClosingFunction<? super V,U> transformation, V input) throws java.lang.Exception
- Throws:
java.lang.Exception
-
applyAsyncClosingFunction
<V,U> FluentFuture<U> applyAsyncClosingFunction(ClosingFuture.AsyncClosingFunction<V,U> transformation, V input) throws java.lang.Exception
- Throws:
java.lang.Exception
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
add
void add(java.lang.AutoCloseable closeable, java.util.concurrent.Executor executor)
-
whenClosedCountDown
java.util.concurrent.CountDownLatch whenClosedCountDown()
Returns a latch that reaches zero when this objects' deferred closeables have been closed.
-
-