001package io.ebean.datasource; 002 003import java.sql.Connection; 004 005 006/** 007 * A {@link DataSourcePool} listener which allows you to hook on the 008 * borrow/return process of getting or returning connections from the pool. 009 * <p> 010 * In the configuration use the poolListener key to configure which listener to 011 * use. 012 * <p> 013 * Example: datasource.ora10.poolListener=my.very.fancy.PoolListener 014 */ 015public interface DataSourcePoolListener { 016 017 /** 018 * Called after a connection has been retrieved from the connection pool 019 */ 020 void onAfterBorrowConnection(Connection connection); 021 022 /** 023 * Called before a connection will be put back to the connection pool 024 */ 025 void onBeforeReturnConnection(Connection connection); 026 027}