borland Packages  Class Hierarchy  dx.dataset Package 

ResponseEvent class

java.lang.Object
   +----java.util.EventObject
           +----com.borland.jb.util.DispatchableEvent
                   +----com.borland.dx.dataset.ResponseEvent

About the ResponseEvent class

Variables  Constructors  Properties  Methods  

Implements Serializable

The ResponseEvent class is used for collecting a response from an application about how to deal with error conditons, table restructuring operations, key violations, etc.


ResponseEvent variables

Variables implemented in this class

Variables implemented in java.util.EventObject

ResponseEvent constructors

ResponseEvent properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in com.borland.jb.util.DispatchableEvent

Properties implemented in java.lang.Object

Properties implemented in java.util.EventObject

ResponseEvent methods

Methods implemented in this class

Methods implemented in com.borland.jb.util.DispatchableEvent

Methods implemented in java.lang.Object


ResponseEvent variables

CANCEL

  public static final int CANCEL = 2
Response code requesting that the operation be cancelled.

COMMIT_ON_CLOSE

  public static final int COMMIT_ON_CLOSE = 12
DataStoreConnection is closing and the current transaction is about to be committed.
  1. Call ok() to proceed with the commit().
  2. Call cancel() to cause rollback() to be called on the connection.

DATASTORE_ALREADY_OPEN

  public static final int DATASTORE_ALREADY_OPEN = 5
The DataStore appears to already be open by this process or another process. Call ok() to attempt to determine if the DataStore is really still open. If it is determined that the DataStore is not open, a DATASTORE_CAN_REOPEN ResponseEvent is sent, and the the open process continues. Call cancel() to cause this open operation to fail.

DATASTORE_CAN_REOPEN

  public static final int DATASTORE_CAN_REOPEN = 6
The DataStore was left open, but the process that had it open has terminated. This message comes after DATASTORE_ALREADY_OPEN. Call ok() to continue the DataStore open operation. Call cancel() to cause this open operation to fail.

DATASTORE_RECOVERING

  public static final int DATASTORE_RECOVERING = 11
The DataStore.shutdown() method was not called for the source DataStore by the last process that accessed it. This notification comes just before the system attempts to recover. Call ok() to proceed with recovery. Call cancel() to cause this operation to fail.

DROP_LOG

  public static final int DROP_LOG = 10
A DataStore log file is about to be deleted because it is no longer needed for any active transaction or for crash recovery. This will be called for the "A" log files, "B" log files (if the log is being duplexed), and status log files (if status logging is enabled). Call the ok() method if you have deleted the file so that the operation can continue. Call the cancel() method to cause this operation to fail.

FILE_EXISTS

  public static final int FILE_EXISTS = 9

Operation cannot continue because the file name in the message already exists. Call ok() if you have deleted the file so that the operation can continue. Call cancel() to cause this operation to fail.

IGNORE_ALL

  public static final int IGNORE_ALL = 3
Response code requesting that any more error/response requests of this code should be ignored for the duration of this operation.

IOEXCEPTION

  public static final int IOEXCEPTION = 7
The DataStore sends this response out whenever there is a read or write failure. A common source for this response event would be when there is insufficient disk space to increase the size of the DataStore file when needed. The source of the error is set to the DataStore instance and exception is set to the IOException that was encountered. Call ok() to have the I/O operation retried. Call cancel() to cause this operation to fail.

OK

  public static final int OK = 1
Response code requesting that the operation be continued.

READ_ONLY_OPEN

  public static final int READ_ONLY_OPEN = 13
The DataStore file cannot be opened. An attempt to open the file in read-only mode is about to be made.
  1. Call ok() to proceed open the file in readOnly mode.
  2. Call cancel() to fail to open the file and to throw an exception.

TYPE_CHANGE_DATA_LOSS

  public static final int TYPE_CHANGE_DATA_LOSS = 1
The restructure operation is converting data from one type to another. Old values will not be converted to the new data type.
  1. Call ok() to continue.
  2. Call cancel() to abort.
  3. Call ignoreAll() to continue and ignore any future messages of this type.

TYPE_CHANGE_PARSE_ERROR

  public static final int TYPE_CHANGE_PARSE_ERROR = 3
The restructure operation is converting data from one type to another. A parse error occurred while converting a String data type to a non-String data type.
  1. Call ok() to continue.
  2. Call cancel() to abort.
  3. Call ignoreAll() to continue and ignore any future messages of this type.

TYPE_CHANGE_PARSE_ERROR_TOTAL

  public static final int TYPE_CHANGE_PARSE_ERROR_TOTAL = 4
The restructure operation encountered one or more TYPE_CHANGE_PARSE_ERROR occurrances. The error is sent out just before the restructure operation is about to be committed.
  1. Call ok() to continue.
  2. Call cancel() to abort the restructure operation.
  3. Call ignoreAll() to continue and ignore any future messages of this type.

TYPE_CHANGE_PRECISION_LOSS

  public static final int TYPE_CHANGE_PRECISION_LOSS = 2
The restructure operation is converting data from one type to another. This conversion might result in a loss of precision when values of the old data type are converted to values of the new data type.
  1. Call ok() to continue.
  2. Call cancel() to abort the restructure operation.
  3. Call ignoreAll() to continue and ignore any future messages of this type.

ResponseEvent constructors

ResponseEvent(java.lang.Object, int, java.lang.Exception)

  public ResponseEvent(Object source, int code, Exception ex)
Constructs a ResponseEvent object.

Parameters:

source
The object that generates the ResponseEvent.
code
The integer code associated with this event. Pre-defined constants for this property are listed under ResponseEvent variables.
ex
The exception associated with this event.

ResponseEvent(java.lang.Object, int, java.lang.String)

  public ResponseEvent(Object source, int code, String message)
Constructs a ResponseEvent object.

Parameters:

source
The object that generates the ResponseEvent.
code
The integer code associated with this event. Pre-defined constants for this property are listed under ResponseEvent variables.
message
The String message associated with this event.

ResponseEvent properties

cancel

 public final boolean isCancel()
Read-only property that returns true if the response is CANCEL.

code

 public final int getCode()
Read-only property that returns the code value of the ResponseEvent. See code constants listed under ResponseEvent variables.

exception

 public final Exception getException()
Returns an Exception if set. Otherwise this method returns null.

ignoreAll

 public final boolean isIgnoreAll()
Read-only property that returns true if the response is IGNORE_ALL.

message

 public final String getMessage()
Read-only property that returns String information on what needs to be responded to.

ok

 public final boolean isOk()
Read-only property that returns true if response is OK.

response

 public final int getResponse()
Read-only property that returns the response setting of OK or CANCEL.

ResponseEvent methods

cancel()

  public final void cancel()
Fails the operation. An Exception may be thrown to cancel the operation.

dispatch(java.util.EventListener)

  public void dispatch(EventListener listener)

This method is an implementation of DispatchableEvent that an EventMulticaster uses to dispatch an event of this type to the listener.

Parameters:

listener
The listener to dispatch this event to.

See also: com.borland.jb.util.DispatchableEvent, com.borland.jb.util.EventMulticaster

Overrides: com.borland.jb.util.DispatchableEvent.dispatch(java.util.EventListener)

ignoreAll()

  public final void ignoreAll()
Causes all future errors/response requests with this event's code to be ignored. The operation then continues, if possible.

ok()

  public final void ok()
Acknowledges receipt of the ResponseEvent. The operation then continues, if possible.