Skip to content

Commit d994398

Browse files
committed
#11 - ENH: Add isOnline() and shutdown(); (without the deregister driver option)
1 parent f093861 commit d994398

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

src/main/java/io/ebean/datasource/DataSourcePool.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ public interface DataSourcePool extends DataSource {
1818
*/
1919
boolean isAutoCommit();
2020

21+
/**
22+
* Return true if the DataSource is online.
23+
* <p>
24+
* Effectively the same as (synonym for) {@link #isDataSourceUp()}.
25+
*/
26+
boolean isOnline();
27+
2128
/**
2229
* Bring the DataSource online ensuring min connections and start heart beat checking.
2330
*/
@@ -28,6 +35,15 @@ public interface DataSourcePool extends DataSource {
2835
*/
2936
void offline();
3037

38+
/**
39+
* Shutdown the pool.
40+
* <p>
41+
* This is functionally the same as {@link #offline()} but generally we expect to only
42+
* shutdown the pool once where as we can expect to making many calls to offline() and
43+
* online().
44+
*/
45+
void shutdown();
46+
3147
/**
3248
* Shutdown the pool with the option to deregister the driver.
3349
*/
@@ -55,6 +71,8 @@ public interface DataSourcePool extends DataSource {
5571

5672
/**
5773
* Returns false when the dataSource is down.
74+
* <p>
75+
* Effectively the same as (synonym for) {@link #isOnline()}.
5876
*/
5977
boolean isDataSourceUp();
6078

0 commit comments

Comments
 (0)