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 of ExceptionallyCloseable is closed due to some exceptional condition revealed by cause.
      • Methods inherited from interface java.io.Closeable

        close
    • Method Detail

      • closeExceptionally

        default void closeExceptionally(java.lang.Throwable cause)
                                 throws java.io.IOException
        Called when an instance of ExceptionallyCloseable is closed due to some exceptional condition revealed by cause.
        Parameters:
        cause - The reason for which the object is closed.
        Throws:
        java.io.IOException - if Closeable.close() fails.
      • close

        static void close(java.lang.Throwable t,
                          java.io.Closeable c)
                   throws java.io.IOException
        Throws:
        java.io.IOException