public class DefaultClosureMonitor extends java.lang.Object implements ClosureMonitor
| Modifier and Type | Field and Description |
|---|---|
private java.lang.Exception |
cause
If we get an exception, the cause is stored in this variable
|
private boolean |
closed
Tells if the monitor is closed or not
|
| Constructor and Description |
|---|
DefaultClosureMonitor() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
private boolean closed
private java.lang.Exception cause
public final void close()
close in interface ClosureMonitorpublic final void close(java.lang.String cause)
close in interface ClosureMonitorcause - error message stringpublic final void close(java.lang.Exception cause)
close in interface ClosureMonitorcause - the exception to associate with the closurepublic final java.lang.Exception getCause()
getCause in interface ClosureMonitorpublic final boolean isClosed()
isClosed in interface ClosureMonitorpublic void checkNotClosed()
throws CursorClosedException
checkNotClosed in interface ClosureMonitorCursorClosedException - the cause of the closure