mpoeschl 2002/11/27 03:43:16
Modified: src/java/org/apache/torque/dsfactory
Jdbc2PoolDataSourceFactory.java
JndiDataSourceFactory.java
TorqueDataSourceFactory.java
Log:
o javadocs
Revision Changes Path
1.4 +19 -12
jakarta-turbine-torque/src/java/org/apache/torque/dsfactory/Jdbc2PoolDataSourceFactory.java
Index: Jdbc2PoolDataSourceFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/dsfactory/Jdbc2PoolDataSourceFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Jdbc2PoolDataSourceFactory.java 13 Sep 2002 05:06:38 -0000 1.3
+++ Jdbc2PoolDataSourceFactory.java 27 Nov 2002 11:43:15 -0000 1.4
@@ -67,21 +67,21 @@
/**
* A factory that looks up the DataSource from JNDI. It is also able
- * to deploy the DataSource based on properties found in the
+ * to deploy the DataSource based on properties found in the
* configuration.
*
* @author <a href="mailto:[EMAIL PROTECTED]">John McNally</a>
* @version $Id$
*/
-public class Jdbc2PoolDataSourceFactory
+public class Jdbc2PoolDataSourceFactory
extends AbstractDataSourceFactory
implements DataSourceFactory
{
-
+
/** The log. */
private static Category category =
Category.getInstance(Jdbc2PoolDataSourceFactory.class);
-
+
/** The wrapped <code>DataSource</code>. */
private DataSource ds;
@@ -104,7 +104,7 @@
"Torque cannot be initialized without a valid configuration. "
+ "Please check the log files for further details.");
}
-
+
ConnectionPoolDataSource cpds = initCPDS(configuration);
Jdbc2PoolDataSource ds = initJdbc2Pool(configuration);
ds.setConnectionPoolDataSource(cpds);
@@ -113,7 +113,7 @@
/**
* Initializes the ConnectionPoolDataSource.
- *
+ *
* @param configuration where to read the settings from
* @throws TorqueException if a property set fails
* @return a configured <code>ConnectionPoolDataSource</code>
@@ -121,7 +121,7 @@
private ConnectionPoolDataSource initCPDS(Configuration configuration)
throws TorqueException
{
- category.debug("Starting initCPDS");
+ category.debug("Starting initCPDS");
ConnectionPoolDataSource cpds = new DriverAdapterCPDS();
Configuration c = configuration.subset("connection");
try
@@ -133,7 +133,7 @@
category.debug("Setting datasource property: " + key);
setProperty(key, c, cpds);
}
- }
+ }
catch (Exception e)
{
category.error("", e);
@@ -142,10 +142,17 @@
return cpds;
}
+ /**
+ * Initializes the Jdbc2PoolDataSource.
+ *
+ * @param configuration where to read the settings from
+ * @throws TorqueException if a property set fails
+ * @return a configured <code>Jdbc2PoolDataSource</code>
+ */
private Jdbc2PoolDataSource initJdbc2Pool(Configuration configuration)
throws TorqueException
{
- category.debug("Starting initTorqueClassic");
+ category.debug("Starting initTorqueClassic");
Jdbc2PoolDataSource ds = new Jdbc2PoolDataSource();
Configuration c = configuration.subset("pool");
try
@@ -154,11 +161,11 @@
while (i.hasNext())
{
String key = (String) i.next();
- category.debug("Setting datasource property: "
+ category.debug("Setting datasource property: "
+ key);
setProperty(key, c, ds);
}
- }
+ }
catch (Exception e)
{
category.error("", e);
1.4 +25 -1
jakarta-turbine-torque/src/java/org/apache/torque/dsfactory/JndiDataSourceFactory.java
Index: JndiDataSourceFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/dsfactory/JndiDataSourceFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JndiDataSourceFactory.java 13 Sep 2002 05:06:38 -0000 1.3
+++ JndiDataSourceFactory.java 27 Nov 2002 11:43:15 -0000 1.4
@@ -124,6 +124,12 @@
initDataSource(configuration);
}
+ /**
+ * Initializes JNDI.
+ *
+ * @param configuration where to read the settings from
+ * @throws TorqueException if a property set fails
+ */
private void initJNDI(Configuration configuration) throws TorqueException
{
category.debug("Starting initJNDI");
@@ -175,6 +181,12 @@
}
}
+ /**
+ * Initializes the DataSource.
+ *
+ * @param configuration where to read the settings from
+ * @throws TorqueException if a property set fails
+ */
private void initDataSource(Configuration configuration)
throws TorqueException
{
@@ -214,6 +226,11 @@
}
}
+ /**
+ *
+ * @param ctx the context
+ * @throws NamingException
+ */
private void debugCtx(Context ctx) throws NamingException
{
category.debug("InitialContext -------------------------------");
@@ -228,6 +245,13 @@
category.debug("----------------------------------------------");
}
+ /**
+ *
+ * @param ctx
+ * @param path
+ * @param ds
+ * @throws Exception
+ */
private void bindDStoJndi(Context ctx, String path, Object ds)
throws Exception
{
1.5 +16 -2
jakarta-turbine-torque/src/java/org/apache/torque/dsfactory/TorqueDataSourceFactory.java
Index: TorqueDataSourceFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/dsfactory/TorqueDataSourceFactory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TorqueDataSourceFactory.java 13 Sep 2002 05:06:38 -0000 1.4
+++ TorqueDataSourceFactory.java 27 Nov 2002 11:43:15 -0000 1.5
@@ -67,7 +67,7 @@
/**
* A factory that looks up the DataSource from JNDI. It is also able
- * to deploy the DataSource based on properties found in the
+ * to deploy the DataSource based on properties found in the
* configuration.
*
* @author <a href="mailto:[EMAIL PROTECTED]">John McNally</a>
@@ -111,6 +111,13 @@
ds = tcds;
}
+ /**
+ * Initializes the ConnectionPoolDataSource.
+ *
+ * @param configuration where to read the settings from
+ * @throws TorqueException if a property set fails
+ * @return a configured <code>ConnectionPoolDataSource</code>
+ */
protected ConnectionPoolDataSource initCPDS(Configuration configuration)
throws TorqueException
{
@@ -135,6 +142,13 @@
return cpds;
}
+ /**
+ * Initializes the TorqueClassicDataSource.
+ *
+ * @param configuration where to read the settings from
+ * @throws TorqueException if a property set fails
+ * @return a configured <code>TorqueClassicDataSource</code>
+ */
protected TorqueClassicDataSource initTorqueClassic(
Configuration configuration)
throws TorqueException
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>