SQLFire 1.0

com.vmware.sqlfire.callbacks
Interface AsyncEventListener

All Known Implementing Classes:
DBSynchronizer

public interface AsyncEventListener

Interface used for implementing an event handler that is invoked asynchronously. Installed by calling the system procedure SYS.ADD_ASYNC_EVENT_LISTENER.


Method Summary
 void close()
          This is invoked when the AsyncEventListener configuration is stopped.
 void init(String initParamStr)
          The AsyncListener implemented by the user can be initialized via this method.
 boolean processEvents(List<Event> events)
          Process the list of Events.
 void start()
          This is invoked just prior to starting the async invocation thread for processing the events.
 

Method Detail

processEvents

boolean processEvents(List<Event> events)
Process the list of Events. This method will be invoked asynchronously when events are queued for processing. For AsyncEventListener, the Event.getOldRow() will always return null indicating that old value is not available. Event.getNewRow() will return the column values for a row created. For update operations it will only return meaningful values for modified columns and null for unmodified columns. The positions of columns modified can be obtained from Event.getModifiedColumns()

Parameters:
events - The list of Events to process
Returns:
whether the events were successfully processed. If returned false, the events will not be deleted from the internal queue.

close

void close()
This is invoked when the AsyncEventListener configuration is stopped. User can do any necessary cleanup in this method.


init

void init(String initParamStr)
The AsyncListener implemented by the user can be initialized via this method. This is invoked after the creation of an instance of the class during the initialization of AsyncEventListener configuration. This can be used to populate fields which can be used during processing of the events. init is invoked only once, after configuring the AsyncEventListener.

Parameters:
initParamStr - String containing initialisation parameters for the AsyncEventListener

start

void start()
This is invoked just prior to starting the async invocation thread for processing the events. User can do any initialisation like creating the file handles etc , which would be used in processing of events.


SQLFire 1.0

Copyright © 2010-2011 VMware, Inc. All rights reserved.