@Internal public class CloseableRegistry extends AbstractAutoCloseableRegistry<Closeable,Closeable,Object,IOException> implements Closeable
Closeable
, which are all closed if this
registry is closed.
Registering to an already closed registry will throw an exception and close the provided
Closeable
All methods in this class are thread-safe.
This class closes all registered Closeable
s in the reverse registration order.
closeableToRef
Constructor and Description |
---|
CloseableRegistry() |
Modifier and Type | Method and Description |
---|---|
void |
doClose(List<Closeable> toClose)
This implementation doesn't imply any exception during closing due to backward compatibility.
|
protected void |
doRegister(Closeable closeable,
Map<Closeable,Object> closeableMap)
Does the actual registration of the closeable with the registry map.
|
protected boolean |
doUnRegister(Closeable closeable,
Map<Closeable,Object> closeableMap)
Does the actual un-registration of the closeable from the registry map.
|
close, getNumberOfRegisteredCloseables, getSynchronizationLock, isCloseableRegistered, isClosed, registerCloseable, removeCloseableInternal, unregisterCloseable
protected void doRegister(@Nonnull Closeable closeable, @Nonnull Map<Closeable,Object> closeableMap)
AbstractAutoCloseableRegistry
doRegister
in class AbstractAutoCloseableRegistry<Closeable,Closeable,Object,IOException>
protected boolean doUnRegister(@Nonnull Closeable closeable, @Nonnull Map<Closeable,Object> closeableMap)
AbstractAutoCloseableRegistry
doUnRegister
in class AbstractAutoCloseableRegistry<Closeable,Closeable,Object,IOException>
public void doClose(List<Closeable> toClose) throws IOException
doClose
in class AbstractAutoCloseableRegistry<Closeable,Closeable,Object,IOException>
IOException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.