1 package org.apache.torque.dsfactory;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import javax.sql.DataSource;
20 import org.apache.commons.configuration.Configuration;
21 import org.apache.torque.TorqueException;
22
23 /***
24 * A factory that returns a DataSource.
25 *
26 * @author <a href="mailto:jmcnally@apache.org">John McNally</a>
27 * @version $Id: DataSourceFactory.java,v 1.2.4.2 2004/05/20 04:35:14 seade Exp $
28 */
29 public interface DataSourceFactory
30 {
31
32 /***
33 * @return the <code>DataSource</code> configured by the factory.
34 * @throws TorqueException if the source can't be returned
35 */
36 DataSource getDataSource() throws TorqueException;
37
38 /***
39 * Initialize the factory.
40 *
41 * @param configuration where to load the factory settings from
42 * @throws TorqueException Any exceptions caught during processing will be
43 * rethrown wrapped into a TorqueException.
44 */
45 void initialize(Configuration configuration)
46 throws TorqueException;
47 }