Interface Closeable

All Superinterfaces:
AutoCloseable
All Known Subinterfaces:
Browser, Engine, JsPromise

public interface Closeable extends AutoCloseable
An object that may hold resources until it is closed.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes this object and releases all resources associated with it.
    boolean
    Returns true if the current object is closed.
  • Method Details

    • close

      void close()
      Closes this object and releases all resources associated with it. If the object is already closed then invoking this method has no effect.

      Implementers of this interface are strongly advised to not have the close method throw any exception. It is supposed that the close operation cannot fail. Only in case of an unexpected error the implementers can throw a runtime exception.

      Specified by:
      close in interface AutoCloseable
      API Note:
      As noted in AutoCloseable.close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing an exception.
    • isClosed

      boolean isClosed()
      Returns true if the current object is closed.