public abstract class ConcurrentCloseable extends Object implements IConcurrentCloseable
CloseableListenable.Impl| Constructor and Description |
|---|
ConcurrentCloseable() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCloseListener(Listener<CloseableListenable> listener)
Add a listener to be called once this resource is closed.
|
void |
addCloseListener(Runnable listener)
Add a listener to be called once this resource is closed.
|
void |
close()
Close.
|
ISynchronizationPoint<Exception> |
closeAsync()
Close asynchronously.
|
protected abstract void |
closeResources(SynchronizationPoint<Exception> ondone) |
protected abstract ISynchronizationPoint<?> |
closeUnderlyingResources() |
abstract byte |
getPriority()
Return the priority.
|
boolean |
isClosed()
Return true if closed.
|
boolean |
isClosing() |
boolean |
lockClose()
Calling this method avoid this resource to be closed.
|
protected <T extends ISynchronizationPoint<?>> |
operation(T op) |
protected <T extends Task<?,?>> |
operation(T task) |
void |
removeCloseListener(Listener<CloseableListenable> listener)
Remove a listener.
|
void |
removeCloseListener(Runnable listener)
Remove a listener.
|
void |
unlockClose()
Allow to close this resource, if this is the last lock on it.
|
public abstract byte getPriority()
protected abstract ISynchronizationPoint<?> closeUnderlyingResources()
protected abstract void closeResources(SynchronizationPoint<Exception> ondone)
public boolean isClosing()
public boolean isClosed()
CloseableListenableisClosed in interface CloseableListenablepublic void addCloseListener(Listener<CloseableListenable> listener)
CloseableListenableaddCloseListener in interface CloseableListenablepublic void addCloseListener(Runnable listener)
CloseableListenableaddCloseListener in interface CloseableListenablepublic void removeCloseListener(Listener<CloseableListenable> listener)
CloseableListenableremoveCloseListener in interface CloseableListenablepublic void removeCloseListener(Runnable listener)
CloseableListenableremoveCloseListener in interface CloseableListenablepublic boolean lockClose()
IConcurrentCloseablelockClose in interface IConcurrentCloseablepublic void unlockClose()
IConcurrentCloseableunlockClose in interface IConcurrentCloseablepublic void close()
throws Exception
CloseableListenableclose in interface AutoCloseableclose in interface CloseableListenableExceptionpublic ISynchronizationPoint<Exception> closeAsync()
AsyncCloseablecloseAsync in interface AsyncCloseable<Exception>protected <T extends ISynchronizationPoint<?>> T operation(T op)
protected <T extends Task<?,?>> T operation(T task)
Copyright © 2017. All rights reserved.