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 Details

    • connectionPoolOpened

      @Deprecated default void connectionPoolOpened(ConnectionPoolOpenedEvent event)
      Deprecated.
      Prefer connectionPoolCreated(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 and paused. The default implementation does nothing.
      Parameters:
      event - the event
      Since:
      4.0
    • connectionPoolReady

      default void connectionPoolReady(ConnectionPoolReadyEvent event)
      Invoked when a connection pool is ready. The default implementation does nothing.
      Parameters:
      event - the event
      Since:
      4.3
    • 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.
      Prefer connectionCreated(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.
      Prefer connectionClosed(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