Skip to content

Commit 45901fa

Browse files
rozzajyemin
authored andcommitted
Implement connectionCheckOutStarted in the ConnectionPoolListenerMulticaster (#669)
JAVA-4015
1 parent 0b44199 commit 45901fa

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

driver-core/src/main/com/mongodb/internal/event/ConnectionPoolListenerMulticaster.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.mongodb.diagnostics.logging.Logger;
2020
import com.mongodb.diagnostics.logging.Loggers;
2121
import com.mongodb.event.ConnectionCheckOutFailedEvent;
22+
import com.mongodb.event.ConnectionCheckOutStartedEvent;
2223
import com.mongodb.event.ConnectionCheckedInEvent;
2324
import com.mongodb.event.ConnectionCheckedOutEvent;
2425
import com.mongodb.event.ConnectionClosedEvent;
@@ -98,6 +99,19 @@ public void connectionPoolClosed(final ConnectionPoolClosedEvent event) {
9899
}
99100
}
100101

102+
@Override
103+
public void connectionCheckOutStarted(final ConnectionCheckOutStartedEvent event) {
104+
for (ConnectionPoolListener cur : connectionPoolListeners) {
105+
try {
106+
cur.connectionCheckOutStarted(event);
107+
} catch (Exception e) {
108+
if (LOGGER.isWarnEnabled()) {
109+
LOGGER.warn(format("Exception thrown raising connection check out started event to listener %s", cur), e);
110+
}
111+
}
112+
}
113+
}
114+
101115
@Override
102116
public void connectionCheckedOut(final ConnectionCheckedOutEvent event) {
103117
for (ConnectionPoolListener cur : connectionPoolListeners) {

0 commit comments

Comments
 (0)