Create SQL data source utils class

- Extract logic used in SQLite and MySQL for logging and closing SQL objects
    - Decided to leave buildAuthFromResultSet methods individually as this might be more implementation-specific
- Rename DataSource#close to DataSource#closeConnection to fix conflict with static import
This commit is contained in:
ljacqu
2017-04-18 22:55:39 +02:00
parent 04ca36fe53
commit 07633a89c8
9 changed files with 226 additions and 69 deletions
@@ -152,7 +152,7 @@ public class CacheDataSource implements DataSource {
}
@Override
public void close() {
public void closeConnection() {
executorService.shutdown();
try {
executorService.awaitTermination(5, TimeUnit.SECONDS);
@@ -160,7 +160,7 @@ public class CacheDataSource implements DataSource {
ConsoleLogger.logException("Could not close executor service:", e);
}
cachedAuths.invalidateAll();
source.close();
source.closeConnection();
}
@Override