SQLFire 1.1

com.vmware.sqlfire.callbacks
Class DBSynchronizer

java.lang.Object
  extended by com.vmware.sqlfire.callbacks.DBSynchronizer
All Implemented Interfaces:
AsyncEventListener

public class DBSynchronizer
extends Object
implements AsyncEventListener

DBSynchronizer class instance persists the SQLFire operations to an external database having a JDBC driver.


Constructor Summary
DBSynchronizer()
           
 
Method Summary
 void basicClose()
          Basic actions to be performed to close the DBSynchronizer instance though the instance will itself not be marked as having shut down.
 void close()
          Close this DBSynchronizer instance.
 void init(String initParamStr)
          Initialize this DBSynchronizer instance, creating a new JDBC connection to the backend database as per the provided parameter.
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBSynchronizer

public DBSynchronizer()
Method Detail

close

public void close()
Close this DBSynchronizer instance. To prevent a possible concurrency issue between closing thread & the processor thread, access to this method is synchronized on 'this'

Specified by:
close in interface AsyncEventListener

basicClose

public final void basicClose()
Basic actions to be performed to close the DBSynchronizer instance though the instance will itself not be marked as having shut down. To prevent a possible concurrency issue between closing thread & the processor thread, access to this method is synchronized on 'this'


init

public void init(String initParamStr)
Initialize this DBSynchronizer instance, creating a new JDBC connection to the backend database as per the provided parameter. The format of the parameter string is: <driver-class>,<JDBC URL>[,<user>[,<password>]] The user and password parts are optional and can be possibly embedded in the JDBC URL itself.

Specified by:
init in interface AsyncEventListener
Parameters:
initParamStr - String containing initialisation parameters for the AsyncEventListener

processEvents

public boolean processEvents(List<Event> events)
Description copied from interface: AsyncEventListener
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()

Specified by:
processEvents in interface AsyncEventListener
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.

start

public void start()
Description copied from interface: AsyncEventListener
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.

Specified by:
start in interface AsyncEventListener

SQLFire 1.1

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