Class DefaultClosureMonitor

  • All Implemented Interfaces:
    ClosureMonitor

    public class DefaultClosureMonitor
    extends Object
    implements ClosureMonitor
    A basic ClosureMonitor that simply uses a boolean for state and a cause exception. Note that we consciously chose not to synchronize close() operations with checks to see if the monitor state is closed because it costs to synchronize and it's OK for the Cursor not to stop immediately when close() is called.
    Author:
    Apache Directory Project
    • Method Detail

      • close

        public final void close()
        Sets monitor state to closed, and sets the cause to a CursorClosedException without an error message string.
        Specified by:
        close in interface ClosureMonitor
      • close

        public final void close​(String cause)
        Sets monitor state to closed, and sets the cause to a CursorClosedException with a specific error message string.
        Specified by:
        close in interface ClosureMonitor
        Parameters:
        cause - error message string
      • close

        public final void close​(Exception cause)
        Sets monitor state to closed, and sets the cause to a specific Exception.
        Specified by:
        close in interface ClosureMonitor
        Parameters:
        cause - the exception to associate with the closure
      • isClosed

        public final boolean isClosed()
        Gets whether the state of this ClosureMonitor is set to closed.
        Specified by:
        isClosed in interface ClosureMonitor
        Returns:
        true if state is closed, false if open