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()
CloseableListenable
isClosed
in interface CloseableListenable
public void addCloseListener(Listener<CloseableListenable> listener)
CloseableListenable
addCloseListener
in interface CloseableListenable
public void addCloseListener(Runnable listener)
CloseableListenable
addCloseListener
in interface CloseableListenable
public void removeCloseListener(Listener<CloseableListenable> listener)
CloseableListenable
removeCloseListener
in interface CloseableListenable
public void removeCloseListener(Runnable listener)
CloseableListenable
removeCloseListener
in interface CloseableListenable
public boolean lockClose()
IConcurrentCloseable
lockClose
in interface IConcurrentCloseable
public void unlockClose()
IConcurrentCloseable
unlockClose
in interface IConcurrentCloseable
public void close() throws Exception
CloseableListenable
close
in interface AutoCloseable
close
in interface CloseableListenable
Exception
public ISynchronizationPoint<Exception> closeAsync()
AsyncCloseable
closeAsync
in interface AsyncCloseable<Exception>
protected <T extends ISynchronizationPoint<?>> T operation(T op)
protected <T extends Task<?,?>> T operation(T task)
Copyright © 2018. All rights reserved.