001    /**
002     * Copyright 2007-2008 Arthur Blake
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     *    http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package net.sf.log4jdbc;
017    
018    /**
019     * Common interface that all Spy classes can implement.
020     * This is used so that any class that is being spied upon can transmit generic information about
021     * itself to the whoever is doing the spying.
022     *
023     * @author Arthur Blake
024     */
025    public interface Spy
026    {
027    
028      /**
029       * Get the type of class being spied upon.  For example, "Statement", "ResultSet", etc.
030       *
031       * @return a description of the type of class being spied upon.
032       */
033      public String getClassType();
034    
035      /**
036       * Get the connection number.  In general, this is used to track which underlying connection is being
037       * used from the database.  The number will be incremented each time a new Connection is retrieved from the
038       * real underlying jdbc driver.  This is useful for debugging and tracking down problems with connection pooling.
039       *
040       * @return the connection instance number.
041       */
042      public int getConnectionNumber();
043    }