Interface SafeDisposable

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean dispose()
      Explicitly call this method to force object to dispose its unmanaged resources.
      boolean isDisposable()
      Returns a boolean flag which indicates if it is safe to call dispose() on the object.
    • Method Detail

      • isDisposable

        boolean isDisposable()
        Returns a boolean flag which indicates if it is safe to call dispose() on the object.
        Returns:
        true if the object can be disposed in a safe manner
        Throws:
        java.lang.IllegalStateException - if the object is already disposed
      • dispose

        boolean dispose()
        Explicitly call this method to force object to dispose its unmanaged resources.

        Call isDisposable() method first to know if this object can be disposed in a safe manner.
        The object may not be reused in the application code after this call.

        Returns:
        true if this object native resources were successfully disposed.
        Throws:
        java.lang.IllegalStateException - if the object is already disposed or is being used