001package org.avaje.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 * <p> 014 * Example: datasource.ora10.poolListener=my.very.fancy.PoolListener 015 * </p> 016 * <p> 017 * <p> 018 * Notice: This listener only works if you are using the default Avaje 019 * {@link DataSourcePool}. 020 * </p> 021 */ 022public interface DataSourcePoolListener { 023 024 /** 025 * Called after a connection has been retrieved from the connection pool 026 */ 027 void onAfterBorrowConnection(Connection connection); 028 029 /** 030 * Called before a connection will be put back to the connection pool 031 */ 032 void onBeforeReturnConnection(Connection connection); 033 034}