Class AbstractUpdatingDataSource

java.lang.Object
org.dellroad.stuff.schema.AbstractUpdatingDataSource
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource
Direct Known Subclasses:
SchemaUpdatingDataSource, UpdatingDataSource

public abstract class AbstractUpdatingDataSource extends Object implements DataSource
A DataSource that wraps an inner DataSource and automatically performs some update operation on the inner DataSource on first access.

The update operation is triggered by an invocation of triggerUpdate() or any DataSource method.

Instances can operate in synchronous or asychronous mode.

In synchronous mode, the update is performed by the thread that triggers the update, and simultaneous invocations of any DataSource method will block until the update is complete.

In asynchronous mode, the update is performed in a separate thread, and invocations of any DataSource method before the update is complete will throw an UpdateInProgressException.

The getUpdateCompleteFuture() returns a Future that waits for completion of the initial update; isUpdated() checks whether the update is complete.

The dataSource property is required.