1 | /* |
---|
2 | Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. |
---|
3 | |
---|
4 | |
---|
5 | The MySQL Connector/J is licensed under the terms of the GPLv2 |
---|
6 | <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most MySQL Connectors. |
---|
7 | There are special exceptions to the terms and conditions of the GPLv2 as it is applied to |
---|
8 | this software, see the FLOSS License Exception |
---|
9 | <http://www.mysql.com/about/legal/licensing/foss-exception.html>. |
---|
10 | |
---|
11 | This program is free software; you can redistribute it and/or modify it under the terms |
---|
12 | of the GNU General Public License as published by the Free Software Foundation; version 2 |
---|
13 | of the License. |
---|
14 | |
---|
15 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
---|
16 | without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
---|
17 | See the GNU General Public License for more details. |
---|
18 | |
---|
19 | You should have received a copy of the GNU General Public License along with this |
---|
20 | program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth |
---|
21 | Floor, Boston, MA 02110-1301 USA |
---|
22 | |
---|
23 | */ |
---|
24 | |
---|
25 | package com.mysql.jdbc; |
---|
26 | |
---|
27 | import java.sql.SQLException; |
---|
28 | import java.util.Properties; |
---|
29 | |
---|
30 | public interface Extension { |
---|
31 | |
---|
32 | /** |
---|
33 | * Called once per connection that wants to use the extension |
---|
34 | * |
---|
35 | * The properties are the same ones passed in in the URL or arguments to |
---|
36 | * Driver.connect() or DriverManager.getConnection(). |
---|
37 | * |
---|
38 | * @param conn the connection for which this extension is being created |
---|
39 | * @param props configuration values as passed to the connection. Note that |
---|
40 | * in order to support javax.sql.DataSources, configuration properties specific |
---|
41 | * to an interceptor <strong>must</strong> be passed via setURL() on the |
---|
42 | * DataSource. Extension properties are not exposed via |
---|
43 | * accessor/mutator methods on DataSources. |
---|
44 | * |
---|
45 | * @throws SQLException should be thrown if the the Extension |
---|
46 | * can not initialize itself. |
---|
47 | */ |
---|
48 | |
---|
49 | public abstract void init(Connection conn, Properties props) throws SQLException; |
---|
50 | |
---|
51 | /** |
---|
52 | * Called by the driver when this extension should release any resources |
---|
53 | * it is holding and cleanup internally before the connection is |
---|
54 | * closed. |
---|
55 | */ |
---|
56 | public abstract void destroy(); |
---|
57 | } |
---|