public class SimpleCloseable extends IoBaseCloseable
Modifier and Type | Field and Description |
---|---|
protected AtomicBoolean |
closing |
protected DefaultCloseFuture |
future |
log
Constructor and Description |
---|
SimpleCloseable(Object lock) |
Modifier and Type | Method and Description |
---|---|
CloseFuture |
close(boolean immediately)
Close this resource asynchronously and return a future.
|
protected void |
doClose(boolean immediately) |
boolean |
isClosed()
Returns
true if this object has been closed. |
boolean |
isClosing()
Returns
true if the Closeable.close(boolean) method
has been called. |
close, isOpen
protected final DefaultCloseFuture future
protected final AtomicBoolean closing
public SimpleCloseable(Object lock)
public boolean isClosed()
Closeable
true
if this object has been closed.true
if closingpublic boolean isClosing()
Closeable
true
if the Closeable.close(boolean)
method
has been called.
Note that this method will return true
even if
this Closeable.isClosed()
returns true
.true
if closingpublic CloseFuture close(boolean immediately)
Closeable
immediately
- true
if the resource should be shut down abruptly,
false
for a graceful closeprotected void doClose(boolean immediately)
Copyright © 2008–2016 The Apache Software Foundation. All rights reserved.