summaryrefslogtreecommitdiff
path: root/src/main/java/com/zaxxer/hikari/HikariDataSource.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/zaxxer/hikari/HikariDataSource.java')
-rw-r--r--src/main/java/com/zaxxer/hikari/HikariDataSource.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/main/java/com/zaxxer/hikari/HikariDataSource.java b/src/main/java/com/zaxxer/hikari/HikariDataSource.java
index 29b8953..bc0f16c 100644
--- a/src/main/java/com/zaxxer/hikari/HikariDataSource.java
+++ b/src/main/java/com/zaxxer/hikari/HikariDataSource.java
@@ -264,6 +264,28 @@ public class HikariDataSource extends HikariConfig implements DataSource, Closea
}
/**
+ * Get the {@code HikariPoolMXBean} for this HikariDataSource instance. If this method is called on
+ * a {@code HikariDataSource} that has been constructed without a {@code HikariConfig} instance,
+ * and before an initial call to {@code #getConnection()}, the return value will be {@code null}.
+ *
+ * @return the {@code HikariPoolMXBean} instance, or {@code null}.
+ */
+ public HikariPoolMXBean getHikariPoolMXBean()
+ {
+ return pool;
+ }
+
+ /**
+ * Get the {@code HikariConfigMXBean} for this HikariDataSource instance.
+ *
+ * @return the {@code HikariConfigMXBean} instance.
+ */
+ public HikariConfigMXBean getHikariConfigMXBean()
+ {
+ return this;
+ }
+
+ /**
* Evict a connection from the pool. If the connection has already been closed (returned to the pool)
* this may result in a "soft" eviction; the connection will be evicted sometime in the future if it is
* currently in use. If the connection has not been closed, the eviction is immediate.
@@ -281,7 +303,11 @@ public class HikariDataSource extends HikariConfig implements DataSource, Closea
/**
* Suspend allocation of connections from the pool. All callers to <code>getConnection()</code>
* will block indefinitely until <code>resumePool()</code> is called.
+ *
+ * @deprecated Call the {@code HikariPoolMXBean#suspendPool()} method on the {@code HikariPoolMXBean}
+ * obtained by {@code #getHikariPoolMXBean()} or JMX lookup.
*/
+ @Deprecated
public void suspendPool()
{
HikariPool p;
@@ -292,7 +318,11 @@ public class HikariDataSource extends HikariConfig implements DataSource, Closea
/**
* Resume allocation of connections from the pool.
+ *
+ * @deprecated Call the {@code HikariPoolMXBean#resumePool()} method on the {@code HikariPoolMXBean}
+ * obtained by {@code #getHikariPoolMXBean()} or JMX lookup.
*/
+ @Deprecated
public void resumePool()
{
HikariPool p;