|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.shared.ldap.cursor.DefaultClosureMonitor
public class DefaultClosureMonitor
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.
Constructor Summary | |
---|---|
DefaultClosureMonitor()
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultClosureMonitor()
Method Detail |
---|
public final void close()
close
in interface ClosureMonitor
public final void close(java.lang.String cause)
close
in interface ClosureMonitor
cause
- error message stringpublic final void close(java.lang.Exception cause)
close
in interface ClosureMonitor
cause
- the exception to associate with the closurepublic final java.lang.Exception getCause()
getCause
in interface ClosureMonitor
public final boolean isClosed()
isClosed
in interface ClosureMonitor
public void checkNotClosed() throws java.lang.Exception
checkNotClosed
in interface ClosureMonitor
java.lang.Exception
- the cause of the closure
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |