vgritsenko 2003/12/05 12:05:37
Modified: src/blocks/xmldb/java/org/apache/cocoon/components/source/impl
XMLDBSourceFactory.java
Log:
add missing ThreadSafe
Revision Changes Path
1.5 +7 -10
cocoon-2.1/src/blocks/xmldb/java/org/apache/cocoon/components/source/impl/XMLDBSourceFactory.java
Index: XMLDBSourceFactory.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/xmldb/java/org/apache/cocoon/components/source/impl/XMLDBSourceFactory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XMLDBSourceFactory.java 25 Oct 2003 18:06:20 -0000 1.4
+++ XMLDBSourceFactory.java 5 Dec 2003 20:05:37 -0000 1.5
@@ -61,6 +61,8 @@
import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.avalon.framework.service.ServiceManager;
import org.apache.avalon.framework.service.Serviceable;
+import org.apache.avalon.framework.thread.ThreadSafe;
+
import org.apache.cocoon.components.source.helpers.SourceCredential;
import org.apache.excalibur.source.Source;
import org.apache.excalibur.source.SourceFactory;
@@ -75,9 +77,8 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Gianugo Rabellino</a>
* @version CVS $Id$
*/
-public final class XMLDBSourceFactory
- extends AbstractLogEnabled
- implements SourceFactory, Configurable, Serviceable {
+public final class XMLDBSourceFactory extends AbstractLogEnabled
+ implements SourceFactory,
Configurable, Serviceable, ThreadSafe {
/** The ServiceManager instance */
protected ServiceManager m_manager;
@@ -89,12 +90,11 @@
* Configure the instance and initialize XML:DB connections (load and
register the drivers).
*/
public void configure(final Configuration conf)
- throws ConfigurationException {
+ throws ConfigurationException {
credentialMap = new HashMap();
Configuration[] xmldbConfigs = conf.getChildren("driver");
-
for (int i = 0; i < xmldbConfigs.length; i++) {
String type = xmldbConfigs[i].getAttribute("type");
String driver = xmldbConfigs[i].getAttribute("class");
@@ -109,19 +109,16 @@
}
try {
-
Class c = Class.forName(driver);
DatabaseManager.registerDatabase((Database)c.newInstance());
} catch (XMLDBException xde) {
-
String error = "Unable to connect to the XMLDB database.
Error "
+ xde.errorCode + ": " + xde.getMessage();
getLogger().debug(error, xde);
throw new ConfigurationException(error, xde);
} catch (Exception e) {
-
getLogger().warn("There was a problem setting up the
connection. "
+ "Make sure that your driver is
available");
throw new ConfigurationException("Problem setting up the
connection to XML:DB: "
@@ -142,7 +139,7 @@
* Resolve the source
*/
public Source getSource(String location, Map parameters)
- throws MalformedURLException, IOException {
+ throws MalformedURLException, IOException {
int start = location.indexOf(':') + 1;
int end = location.indexOf(':', start);