Interface ExceptionallyCloseable
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
- All Known Implementing Classes:
Queue
public interface ExceptionallyCloseable extends java.io.Closeable
Implemented by closeable objects which might be able to report an error when closed due to exceptional conditions.
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description static void
close(java.lang.Throwable t, java.io.Closeable c)
default void
closeExceptionally(java.lang.Throwable cause)
Called when an instance ofExceptionallyCloseable
is closed due to some exceptional condition revealed bycause
.
-
-
-
Method Detail
-
closeExceptionally
default void closeExceptionally(java.lang.Throwable cause) throws java.io.IOException
Called when an instance ofExceptionallyCloseable
is closed due to some exceptional condition revealed bycause
.- Parameters:
cause
- The reason for which the object is closed.- Throws:
java.io.IOException
- ifCloseable.close()
fails.
-
close
static void close(java.lang.Throwable t, java.io.Closeable c) throws java.io.IOException
- Throws:
java.io.IOException
-
-