Skip to content

Commit 8747f8c

Browse files
committed
Add getName() to DataSourcePool API
1 parent ff20c78 commit 8747f8c

2 files changed

Lines changed: 5 additions & 14 deletions

File tree

src/main/java/org/avaje/datasource/pool/ConnectionPool.java

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ public <T> T unwrap(Class<T> arg0) throws SQLException {
293293
/**
294294
* Return the dataSource name.
295295
*/
296+
@Override
296297
public String getName() {
297298
return name;
298299
}
@@ -874,15 +875,16 @@ public void setPstmtCacheSize(int pstmtCacheSize) {
874875
* hitCount, waitCount and highWaterMark are reset.
875876
* </p>
876877
*/
878+
@Override
877879
public PoolStatus getStatus(boolean reset) {
878880
return queue.getStatus(reset);
879881
}
880882

881883
/**
882884
* Return the aggregated load statistics collected on all the connections in the pool.
883885
*/
886+
@Override
884887
public PoolStatistics getStatistics(boolean reset) {
885-
886888
return queue.getStatistics(reset);
887889
}
888890

@@ -900,7 +902,6 @@ private void deregisterDriver() {
900902

901903
public static class Status implements PoolStatus {
902904

903-
private final String name;
904905
private final int minSize;
905906
private final int maxSize;
906907
private final int free;
@@ -910,9 +911,7 @@ public static class Status implements PoolStatus {
910911
private final int waitCount;
911912
private final int hitCount;
912913

913-
protected Status(String name, int minSize, int maxSize, int free, int busy, int waiting, int highWaterMark,
914-
int waitCount, int hitCount) {
915-
this.name = name;
914+
protected Status(int minSize, int maxSize, int free, int busy, int waiting, int highWaterMark, int waitCount, int hitCount) {
916915
this.minSize = minSize;
917916
this.maxSize = maxSize;
918917
this.free = free;
@@ -928,14 +927,6 @@ public String toString() {
928927
+ "] highWaterMark[" + highWaterMark + "] waitCount[" + waitCount + "] hitCount[" + hitCount + "]";
929928
}
930929

931-
/**
932-
* Return the DataSource name.
933-
*/
934-
@Override
935-
public String getName() {
936-
return name;
937-
}
938-
939930
/**
940931
* Return the min pool size.
941932
*/

src/main/java/org/avaje/datasource/pool/PooledConnectionQueue.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public class PooledConnectionQueue {
115115
}
116116

117117
private PoolStatus createStatus() {
118-
return new Status(name, minSize, maxSize, freeList.size(), busyList.size(), waitingThreads, highWaterMark, waitCount, hitCount);
118+
return new Status(minSize, maxSize, freeList.size(), busyList.size(), waitingThreads, highWaterMark, waitCount, hitCount);
119119
}
120120

121121
public String toString() {

0 commit comments

Comments
 (0)