All Packages Class Hierarchy This Package Previous Next Index
Class PREDATOR.ServerErrorBuffer
java.lang.Object
|
+----PREDATOR.ServerErrorBuffer
- public class ServerErrorBuffer
- extends Object
The ServerErrorBuffer is the error buffer between the ErrorReader thread
and the main thread operating the Connection object. It provides the
means for the ErrorReader thread to read in the (essentially) asynchronous
server errors and allow the Connection object to present them synchronously.
- See Also:
- ErrorReader, Connection
-
EMPTY
- If the status variable has this value, then the server indicated that
no error occurred during the query.
-
error
- The error buffer
-
FULL
- If the status variable has this value, then the server indicated that
an error occurred during the query.
-
status
- A status code, indicating if an error has been received or not.
-
WAITING
- If the status variable has this value, then the the server has not yet
communicated the error status.
-
ServerErrorBuffer()
-
-
clear()
- Resets this buffer to be empty, without any error information.
-
complete()
- Waits until this error buffer is filled (with an error or an A-OK signal).
-
getError()
- If an error exists, returns the error and clears the error buffer.
-
isError()
- Checks to see if there is a pending server error.
-
noError()
- Signals that no error occurred during a query.
-
noteError(ServerError)
- Places an error in the buffer, replacing any error already buffered.
-
reset()
- Resets this buffer to be empty, without any error information, and
waiting for an error (or an A-OK) signal to be sent.
error
protected ServerError error
- The error buffer
status
protected int status
- A status code, indicating if an error has been received or not.
EMPTY
protected static final int EMPTY
- If the status variable has this value, then the server indicated that
no error occurred during the query.
FULL
protected static final int FULL
- If the status variable has this value, then the server indicated that
an error occurred during the query.
WAITING
protected static final int WAITING
- If the status variable has this value, then the the server has not yet
communicated the error status.
ServerErrorBuffer
public ServerErrorBuffer()
reset
public synchronized void reset()
- Resets this buffer to be empty, without any error information, and
waiting for an error (or an A-OK) signal to be sent.
clear
public synchronized void clear()
- Resets this buffer to be empty, without any error information.
complete
public synchronized void complete()
- Waits until this error buffer is filled (with an error or an A-OK signal).
isError
public synchronized boolean isError()
- Checks to see if there is a pending server error.
- Returns:
- true if the server has registered an error, false otherwise
getError
public synchronized ServerError getError()
- If an error exists, returns the error and clears the error buffer. If
none exists, returns null.
- Returns:
- The server error
noteError
public synchronized void noteError(ServerError E)
- Places an error in the buffer, replacing any error already buffered.
noError
public synchronized void noError()
- Signals that no error occurred during a query.
All Packages Class Hierarchy This Package Previous Next Index