org.apache.directory.shared.ldap.cursor
Interface ClosureMonitor

All Known Implementing Classes:
DefaultClosureMonitor

public interface ClosureMonitor

A monitor used by Cursors to detect conditions when they should stop performing some work during advance operations such as next(), previous(), first() etc, and release resources.

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Method Summary
 void checkNotClosed()
          Checks if state of this ClosureMonitor is set to closed and if so, throws the causing Exception.
 void close()
          Sets monitor state to closed, and sets the cause to a CursorClosedException without an error message string.
 void close(java.lang.Exception cause)
          Sets monitor state to closed, and sets the cause to a specific Exception.
 void close(java.lang.String cause)
          Sets monitor state to closed, and sets the cause to a CursorClosedException with a specific error message string.
 java.lang.Exception getCause()
          Gets the cause of the closure.
 boolean isClosed()
          Gets whether the state of this ClosureMonitor is set to closed.
 

Method Detail

close

void close()
Sets monitor state to closed, and sets the cause to a CursorClosedException without an error message string.


close

void close(java.lang.String cause)
Sets monitor state to closed, and sets the cause to a CursorClosedException with a specific error message string.

Parameters:
cause - error message string

close

void close(java.lang.Exception cause)
Sets monitor state to closed, and sets the cause to a specific Exception.

Parameters:
cause - the exception to associate with the closure

isClosed

boolean isClosed()
Gets whether the state of this ClosureMonitor is set to closed.

Returns:
true if state is closed, false if open

checkNotClosed

void checkNotClosed()
                    throws java.lang.Exception
Checks if state of this ClosureMonitor is set to closed and if so, throws the causing Exception.

Throws:
java.lang.Exception - the cause of the closure

getCause

java.lang.Exception getCause()
Gets the cause of the closure.

Returns:
the causing Exception


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.