Package com.mongodb.event
Interface ConnectionPoolListener
-
- All Superinterfaces:
EventListener
- All Known Implementing Classes:
ConnectionPoolListenerAdapter
,JMXConnectionPoolListener
public interface ConnectionPoolListener extends EventListener
A listener for connection pool-related events.- Since:
- 3.5
-
-
Method Summary
All Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description default void
connectionAdded(ConnectionAddedEvent event)
Deprecated.PreferconnectionCreated(com.mongodb.event.ConnectionCreatedEvent)
Implementations should NOT implement this method at all, instead relying on the default no-op implementation.default void
connectionCheckedIn(ConnectionCheckedInEvent event)
Invoked when a connection is checked in to a pool.default void
connectionCheckedOut(ConnectionCheckedOutEvent event)
Invoked when a connection is checked out of a pool.default void
connectionCheckOutFailed(ConnectionCheckOutFailedEvent event)
Invoked when an attempt to check out a connection from a pool fails.default void
connectionCheckOutStarted(ConnectionCheckOutStartedEvent event)
Invoked when attempting to check out a connection from a pool.default void
connectionClosed(ConnectionClosedEvent event)
Invoked when a connection is removed from a pool.default void
connectionCreated(ConnectionCreatedEvent event)
Invoked when a connection is created.default void
connectionPoolCleared(ConnectionPoolClearedEvent event)
Invoked when a connection pool is cleared.default void
connectionPoolClosed(ConnectionPoolClosedEvent event)
Invoked when a connection pool is closed.default void
connectionPoolCreated(ConnectionPoolCreatedEvent event)
Invoked when a connection pool is created.default void
connectionPoolOpened(ConnectionPoolOpenedEvent event)
Deprecated.PreferconnectionPoolCreated(com.mongodb.event.ConnectionPoolCreatedEvent)
Implementations should NOT implement this method at all, instead relying on the default no-op implementation.default void
connectionReady(ConnectionReadyEvent event)
Invoked when a connection is ready for use.default void
connectionRemoved(ConnectionRemovedEvent event)
Deprecated.PreferconnectionClosed(com.mongodb.event.ConnectionClosedEvent)
Implementations should NOT implement this method at all, instead relying on the default no-op implementation.
-
-
-
Method Detail
-
connectionPoolOpened
@Deprecated default void connectionPoolOpened(ConnectionPoolOpenedEvent event)
Deprecated.PreferconnectionPoolCreated(com.mongodb.event.ConnectionPoolCreatedEvent)
Implementations should NOT implement this method at all, instead relying on the default no-op implementation. If an application implements both this method and connectionPoolCreated, the application risks double-counting events.Invoked when a connection pool is opened. The default implementation does nothing.- Parameters:
event
- the event
-
connectionPoolCreated
default void connectionPoolCreated(ConnectionPoolCreatedEvent event)
Invoked when a connection pool is created. The default implementation does nothing.- Parameters:
event
- the event- Since:
- 4.0
-
connectionPoolCleared
default void connectionPoolCleared(ConnectionPoolClearedEvent event)
Invoked when a connection pool is cleared. The default implementation does nothing.- Parameters:
event
- the event- Since:
- 4.0
-
connectionPoolClosed
default void connectionPoolClosed(ConnectionPoolClosedEvent event)
Invoked when a connection pool is closed. The default implementation does nothing.- Parameters:
event
- the event
-
connectionCheckOutStarted
default void connectionCheckOutStarted(ConnectionCheckOutStartedEvent event)
Invoked when attempting to check out a connection from a pool. The default implementation does nothing.- Parameters:
event
- the event- Since:
- 4.0
-
connectionCheckedOut
default void connectionCheckedOut(ConnectionCheckedOutEvent event)
Invoked when a connection is checked out of a pool. The default implementation does nothing.- Parameters:
event
- the event
-
connectionCheckOutFailed
default void connectionCheckOutFailed(ConnectionCheckOutFailedEvent event)
Invoked when an attempt to check out a connection from a pool fails. The default implementation does nothing.- Parameters:
event
- the event- Since:
- 4.0
-
connectionCheckedIn
default void connectionCheckedIn(ConnectionCheckedInEvent event)
Invoked when a connection is checked in to a pool. The default implementation does nothing.- Parameters:
event
- the event
-
connectionAdded
@Deprecated default void connectionAdded(ConnectionAddedEvent event)
Deprecated.PreferconnectionCreated(com.mongodb.event.ConnectionCreatedEvent)
Implementations should NOT implement this method at all, instead relying on the default no-op implementation. If an application implements both this method and connectionCreated, the application risks double-counting events.Invoked when a connection is added to a pool. The default implementation does nothing.- Parameters:
event
- the event
-
connectionCreated
default void connectionCreated(ConnectionCreatedEvent event)
Invoked when a connection is created. The default implementation does nothing.- Parameters:
event
- the event- Since:
- 4.0
-
connectionReady
default void connectionReady(ConnectionReadyEvent event)
Invoked when a connection is ready for use. The default implementation does nothing.- Parameters:
event
- the event- Since:
- 4.0
-
connectionRemoved
@Deprecated default void connectionRemoved(ConnectionRemovedEvent event)
Deprecated.PreferconnectionClosed(com.mongodb.event.ConnectionClosedEvent)
Implementations should NOT implement this method at all, instead relying on the default no-op implementation. If an application implements both this method and connectionClosed, the application risks double-counting events.Invoked when a connection is removed from a pool. The default implementation does nothing.- Parameters:
event
- the event
-
connectionClosed
default void connectionClosed(ConnectionClosedEvent event)
Invoked when a connection is removed from a pool. The default implementation does nothing.- Parameters:
event
- the event- Since:
- 4.0
-
-