vgritsenko 2003/08/08 19:56:48
Modified: java/src/org/apache/xindice/core Database.java Log: Cosmetics Revision Changes Path 1.26 +12 -12 xml-xindice/java/src/org/apache/xindice/core/Database.java Index: Database.java =================================================================== RCS file: /home/cvs/xml-xindice/java/src/org/apache/xindice/core/Database.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- Database.java 7 Aug 2003 20:13:21 -0000 1.25 +++ Database.java 9 Aug 2003 02:56:48 -0000 1.26 @@ -100,11 +100,12 @@ /** * This will return an instance of a Database for the given - * name if one has already been loaded, otherwise it will - * create a new instance. + * name if one has already been loaded, otherwise it will + * create a new instance. * * @param config * @return Database + * @throws ConfigurationException if database name is missing in the configuration */ public static Database getDatabase(Configuration config) { @@ -117,9 +118,9 @@ Database database = (Database) databases.get(name); if (null == database) { - // in case it's currently being added (only pay the sync hit on a miss) + // In case it's currently being added (only pay the sync hit on a miss) synchronized (databases) { - // was it created while we waited? + // Was it created while we waited? database = (Database) databases.get(name); if (null == database) { database = new Database(); @@ -292,20 +293,19 @@ */ public void setConfig(Configuration config) throws XindiceException { super.setConfig(config); - - // FIXME: super sets this already: - // setName(config.getAttribute(NAME)); setCanonicalName('/' + getName()); String dbroot = config.getAttribute(DBROOT); File dbrootDir = new File(dbroot); if (!dbrootDir.isAbsolute()) { - // TODO: Here, DB root already should be absolute. XMLRPC and Embed drivers take care of it. + // Here, DB root already should be absolute. XMLRPC, Embed, and Managed drivers take care of it. dbrootDir = new File(System.getProperty(Xindice.PROP_XINDICE_DB_HOME), dbroot); } + setCollectionRoot(dbrootDir); - log.info("Database points to " + dbrootDir.getAbsolutePath()); - log.debug("Database dir exists: " + (dbrootDir == null ? false : dbrootDir.exists())); + if (log.isInfoEnabled()) { + log.info("Database points to " + dbrootDir.getAbsolutePath()); + } try { Configuration queryCfg = config.getChild(QUERYENGINE);