Added PersistenceContext.shutdown(), exposed shutdown() in ConnectionProvider.

This commit is contained in:
Michael Bayne
2007-07-26 19:13:34 +00:00
parent 3628ec528d
commit 07666e16a6
@@ -141,6 +141,22 @@ public class PersistenceContext
_cache = adapter;
}
/**
* Shuts this persistence context down, shutting down any caching system in use and shutting
* down the JDBC connection pool.
*/
public void shutdown ()
{
try {
if (_cache != null) {
_cache.shutdown();
}
} catch (Throwable t) {
log.log(Level.WARNING, "Failure shutting down Depot cache.", t);
}
_conprov.shutdown();
}
/**
* Create and return a new {@link SQLBuilder} for the appropriate dialect.
*
@@ -183,7 +199,8 @@ public class PersistenceContext
* and register a pre-migration for every single schema migration and they will then be
* guaranteed to be run in registration order and with predictable pre- and post-conditions.
*/
public <T extends PersistentRecord> void registerMigration (Class<T> type, EntityMigration migration)
public <T extends PersistentRecord> void registerMigration (
Class<T> type, EntityMigration migration)
{
getRawMarshaller(type).registerMigration(migration);
}