D - Driver or DataSourcepublic class SynchronizationContextImpl<D> extends java.lang.Object implements SynchronizationContext<D>
| Constructor and Description |
|---|
SynchronizationContextImpl(DatabaseCluster<D> cluster,
Database<D> database) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes any open database connections and shuts down the executor service.
|
java.util.Set<Database<D>> |
getActiveDatabaseSet()
Returns a snapshot of the activate databases in the cluster at the time synchronization started.
|
java.sql.Connection |
getConnection(Database<D> database)
Returns a connection to the specified database.
|
Dialect |
getDialect()
Returns the dialect of the cluster.
|
java.util.concurrent.ExecutorService |
getExecutor()
An executor service for executing tasks asynchronously.
|
Database<D> |
getSourceDatabase()
Returns the database from which to synchronize.
|
DatabaseProperties |
getSourceDatabaseProperties()
Returns a cache of database meta data for the source database.
|
Database<D> |
getTargetDatabase()
Returns the database to synchronize.
|
DatabaseProperties |
getTargetDatabaseProperties()
Returns a cache of database meta data for the target database.
|
public SynchronizationContextImpl(DatabaseCluster<D> cluster, Database<D> database) throws java.sql.SQLException
cluster - database - java.sql.SQLExceptionpublic java.sql.Connection getConnection(Database<D> database) throws java.sql.SQLException
SynchronizationContextgetConnection in interface SynchronizationContext<D>database - a database to which to connectjava.sql.SQLException - if connection could not be obtainedSynchronizationContext.getConnection(net.sf.hajdbc.Database)public Database<D> getSourceDatabase()
SynchronizationContextgetSourceDatabase in interface SynchronizationContext<D>SynchronizationContext.getSourceDatabase()public Database<D> getTargetDatabase()
SynchronizationContextgetTargetDatabase in interface SynchronizationContext<D>SynchronizationContext.getTargetDatabase()public java.util.Set<Database<D>> getActiveDatabaseSet()
SynchronizationContextgetActiveDatabaseSet in interface SynchronizationContext<D>SynchronizationContext.getActiveDatabaseSet()public DatabaseProperties getSourceDatabaseProperties()
SynchronizationContextgetSourceDatabaseProperties in interface SynchronizationContext<D>SynchronizationContext.getSourceDatabaseProperties()public DatabaseProperties getTargetDatabaseProperties()
SynchronizationContextgetTargetDatabaseProperties in interface SynchronizationContext<D>SynchronizationContext.getTargetDatabaseProperties()public Dialect getDialect()
SynchronizationContextgetDialect in interface SynchronizationContext<D>SynchronizationContext.getDialect()public java.util.concurrent.ExecutorService getExecutor()
SynchronizationContextgetExecutor in interface SynchronizationContext<D>SynchronizationContext.getExecutor()public void close()
SynchronizationContextclose in interface SynchronizationContext<D>SynchronizationContext.close()