commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bali...@apache.org
Subject cvs commit: jakarta-commons-sandbox/simplestore/src/xmldb/org/apache/commons/simplestore/xmldb XmlDbStorage.java
Date Sat, 25 May 2002 13:48:59 GMT
baliuka     02/05/25 06:48:59

  Modified:    simplestore build.xml
               simplestore/src/block/org/apache/commons/simplestore/block
                        DBPersistenceFactoryImpl.java
               simplestore/src/java/org/apache/commons/simplestore/persistence/impl
                        AbstractStorage.java PersistenceManagerImpl.java
                        PersistentProxy.java
               simplestore/src/test/org/apache/commons/simplestore
                        TestSample.java TestXmlDbStorage.java
               simplestore/src/xmldb/org/apache/commons/simplestore/xmldb
                        XmlDbStorage.java
  Added:       simplestore/lib avalon-framework-20022103.jar
                        phoenix-client.jar xindice.jar xml-apis-1.0.jar
                        xmldb.jar
               simplestore/src/btree/org/apache/commons/simplestore/btree
                        JDBMPersistenceManagerFactory.java JDBMStorage.java
               simplestore/src/jdbc/org/apache/commons/simplestore/jdbc
                        ConnectionFactory.java
                        DBPersistenceManagerFactory.java DBStorage.java
                        DriverDataSource.java TypeNameMap.java
                        TypeNameMapImpl.java TypeNameMapImpl.properties
  Removed:     simplestore/src/java/org/apache/commons/simplestore/jdbc
                        ConnectionWrapper.java DriverDataSource.java
               simplestore/src/java/org/apache/commons/simplestore/persistence/impl
                        ConnectionFactory.java
                        DBPersistenceManagerFactory.java DBStorage.java
                        JDBMPersistenceManagerFactory.java JDBMStorage.java
  Log:
  Changed directory structure
  
  Revision  Changes    Path
  1.30      +117 -18   jakarta-commons-sandbox/simplestore/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/build.xml,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- build.xml	18 May 2002 20:43:47 -0000	1.29
  +++ build.xml	25 May 2002 13:48:58 -0000	1.30
  @@ -1,7 +1,7 @@
   <?xml version="1.0" encoding="UTF-8"?>
  -<project basedir="." default="compile" name="simplestore">
  +<project basedir="." default="all" name="simplestore">
   
  -<!--         "simplestore" component of the Jakarta Commons Subproject         $Id: build.xml,v 1.29 2002/05/18 20:43:47 baliuka Exp $ -->
  +<!--         "simplestore" component of the Jakarta Commons Subproject         $Id: build.xml,v 1.30 2002/05/25 13:48:58 baliuka Exp $ -->
   
   <!-- ========== Executable Targets ======================================== -->
   
  @@ -36,6 +36,14 @@
       <property name="xmldb.build.home" value="build/xmldb"/>
       <property name="xmldb.home" value="src/xmldb"/>
   
  +    <property name="jdbc.build.home" value="build/jdbc"/>
  +    <property name="jdbc.home" value="src/jdbc"/>
  +
  +    <property name="btree.build.home" value="build/btree"/>
  +    <property name="btree.home" value="src/btree"/>
  +
  +
  +
       <property name="dist.home" value="dist"/>
       <property name="source.home" value="src/java"/>
       <property name="source.test" value="src/test"/>
  @@ -52,6 +60,7 @@
         <pathelement location="${hsqldb.jar}"/>
         <pathelement location="${jdbc2_0-stdext.jar}"/>
         <pathelement location="${bcel.jar}"/>
  +      <pathelement location="${jdbc.build.home}/classes"/>
         <fileset dir="./lib">
   		<include name="*.*"/>
          </fileset>
  @@ -80,6 +89,10 @@
       <mkdir dir="${test.build.home}/conf"/>
       <mkdir dir="${xmldb.build.home}/classes"/>
       <mkdir dir="${xmldb.build.home}/conf"/>
  +    <mkdir dir="${jdbc.build.home}/classes"/>
  +    <mkdir dir="${jdbc.build.home}/conf"/>
  +    <mkdir dir="${btree.build.home}/classes"/>
  +    <mkdir dir="${btree.build.home}/conf"/>
    
    
     </target>
  @@ -92,10 +105,18 @@
   
     <target depends="init" description="Clean build and distribution directories" name="clean">
       <delete dir="${build.home}"/>
  +    <delete dir="${jdbc.build.home}"/>
  +    <delete dir="${block.build.home}"/>
  +    <delete dir="${xmldb.build.home}"/>
  +    <delete dir="${btree.build.home}"/>
  +    <delete dir="${test.build.home}"/>
       <delete dir="${dist.home}"/>
  +     
     </target>
   
  -  <target depends="clean,compile" description="Clean and compile all components" name="all"/>
  +  <target depends="clean,compile,compile-jdbc,compile-block,compile-btree,compile-xmldb" 
  +          description="Clean and compile all components" 
  +   name="all"/>
   
     <target depends="compile" description="Create component Javadoc documentation" name="javadoc">
       <mkdir dir="${dist.home}"/>
  @@ -104,7 +125,8 @@
       <javadoc author="true" bottom="Copyright (c) 2001 - Apache Software Foundation" destdir="${dist.home}/docs/api" doctitle="&lt;h1&gt;${component.title}&lt;/h1&gt;" packagenames="org.apache.commons.*" private="true" sourcepath="${source.home}" version="true" windowtitle="${component.title} (Version ${component.version})"/>
     </target>
   
  -  <target depends="compile" description="Create binary distribution" name="dist">
  +  <target depends="compile" description="Create binary distribution"
  +    name="core">
       <mkdir dir="${dist.home}"/>
       <copy file="../LICENSE" todir="${dist.home}"/>
   
  @@ -113,7 +135,61 @@
       </jar>    
     </target>
   
  - <target depends="compile"
  + 
  +  <target depends="compile-block,core" description="Create binary distribution" 
  +         name="block">
  +  <mkdir dir="${dist.home}"/> 
  +  <copy todir="${block.build.home}/classes" >
  +    <fileset dir="${block.home}" >
  +      <include name="**/*.xinfo"/>
  +    </fileset>
  +   </copy>
  +   <jar basedir="${block.build.home}/classes" 
  +       jarfile="${dist.home}/commons-${component.name}-block.jar"
  +         manifest="src/conf/BLOCK-MANIFEST.MF">
  +      <include name="org/apache/commons/simplestore/**"/>
  +    </jar>    
  +  </target>
  +
  +  <target depends="compile-jdbc,core" description="Create binary distribution" 
  +         name="jdbc">
  +  <mkdir dir="${dist.home}"/> 
  +   <jar basedir="${jdbc.build.home}/classes" 
  +       jarfile="${dist.home}/commons-${component.name}-jdbc.jar" >
  +      <include name="org/apache/commons/simplestore/**"/>
  +    </jar>    
  +  </target>
  +
  + <target depends="compile-xmldb,core" description="Create binary distribution" 
  +         name="xmldb">
  +  <mkdir dir="${dist.home}"/> 
  +   <jar basedir="${xmldb.build.home}/classes" 
  +       jarfile="${dist.home}/commons-${component.name}-xmldb.jar" >
  +      <include name="org/apache/commons/simplestore/**"/>
  +    </jar>    
  +  </target>
  +
  + 
  +
  + <target depends="compile-btree,core" description="Create binary distribution" 
  +         name="btree">
  +  <mkdir dir="${dist.home}"/> 
  +   <jar basedir="${btree.build.home}/classes" 
  +       jarfile="${dist.home}/commons-${component.name}-btree.jar" >
  +      <include name="org/apache/commons/simplestore/**"/>
  +    </jar>    
  +  </target>
  +
  + <target depends="core,xmldb,jdbc,btree,block" description="Create binary distribution" 
  +         name="dist">
  +  </target>
  + 
  +  
  +
  +
  +  
  +
  + <target depends="compile,compile-jdbc"
            description="Compile Phoenix Block implementation" 
            name="compile-block">
       <javac debug="${compile.debug}" 
  @@ -137,23 +213,41 @@
       </javac>
     </target>
   
  - <target depends="compile-block" description="Create binary distribution" name="block">
  -   <mkdir dir="${dist.home}"/> 
  -  <copy todir="${block.build.home}/classes" >
  -    <fileset dir="${block.home}" >
  -      <include name="**/*.xinfo"/>
  + <target depends="compile"
  +         description="Compile jdbc Storage" 
  +         name="compile-jdbc">
  +    <javac debug="${compile.debug}" 
  +           deprecation="${compile.deprecation}" 
  +           destdir="${jdbc.build.home}/classes" 
  +           optimize="${compile.optimize}" 
  +           srcdir="${jdbc.home}">
  +      <classpath refid="compile.classpath"/>
  +    </javac>
  +  <copy todir="${jdbc.build.home}/classes" >
  +    <fileset dir="${jdbc.home}" >
  +      <include name="**/*.properties"/>
       </fileset>
     </copy>
  -  
  -    <jar basedir="${block.build.home}/classes" 
  -       jarfile="${dist.home}/commons-${component.name}-block.jar"
  -         manifest="src/conf/BLOCK-MANIFEST.MF">
  -      <include name="org/apache/commons/simplestore/**"/>
  -    </jar>    
  +
     </target>
  +<target depends="compile"
  +         description="Compile btree Storage" 
  +         name="compile-btree">
  +    <javac debug="${compile.debug}" 
  +           deprecation="${compile.deprecation}" 
  +           destdir="${btree.build.home}/classes" 
  +           optimize="${compile.optimize}" 
  +           srcdir="${btree.home}">
  +      <classpath refid="compile.classpath"/>
  +    </javac>
  +  </target>
  +
  +
  +
  + 
     
  -  
  -  <target depends="compile,compile-xmldb" name="build-test">
  +  <target depends="compile,compile-xmldb,compile-jdbc,compile-btree"
  +    name="build-test">
       <javac debug="${compile.debug}" 
              deprecation="${compile.deprecation}" 
              destdir="${test.build.home}/classes" 
  @@ -164,6 +258,9 @@
      <classpath refid="compile.classpath"/>
      <classpath>
      <pathelement path="${xmldb.build.home}/classes"/>
  +   <pathelement path="${jdbc.build.home}/classes"/>
  +   <pathelement path="${btree.build.home}/classes"/>
  +   <pathelement path="${build.home}/classes"/>
      </classpath> 
      </javac>
     
  @@ -215,6 +312,8 @@
             <pathelement path="${java.class.path}"/>
             <pathelement path="${source.test}"/>
             <pathelement path="${xmldb.build.home}/classes" />  
  +          <pathelement path="${jdbc.build.home}/classes" />  
  +          <pathelement path="${btree.build.home}/classes" />  
             <fileset dir="./lib">
   		<include name="*.*"/>
             </fileset>
  
  
  
  1.1                  jakarta-commons-sandbox/simplestore/lib/avalon-framework-20022103.jar
  
  	<<Binary file>>
  
  
  1.1                  jakarta-commons-sandbox/simplestore/lib/phoenix-client.jar
  
  	<<Binary file>>
  
  
  1.1                  jakarta-commons-sandbox/simplestore/lib/xindice.jar
  
  	<<Binary file>>
  
  
  1.1                  jakarta-commons-sandbox/simplestore/lib/xml-apis-1.0.jar
  
  	<<Binary file>>
  
  
  1.1                  jakarta-commons-sandbox/simplestore/lib/xmldb.jar
  
  	<<Binary file>>
  
  
  1.2       +1 -1      jakarta-commons-sandbox/simplestore/src/block/org/apache/commons/simplestore/block/DBPersistenceFactoryImpl.java
  
  Index: DBPersistenceFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/block/org/apache/commons/simplestore/block/DBPersistenceFactoryImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DBPersistenceFactoryImpl.java	11 May 2002 16:48:15 -0000	1.1
  +++ DBPersistenceFactoryImpl.java	25 May 2002 13:48:58 -0000	1.2
  @@ -56,7 +56,7 @@
   package org.apache.commons.simplestore.block;
   
   import org.apache.commons.simplestore.persistence.PersistenceManager;
  -import org.apache.commons.simplestore.persistence.impl.DBPersistenceManagerFactory;
  +import org.apache.commons.simplestore.jdbc.DBPersistenceManagerFactory;
   /**
    * Block implementation of the PersistenceFactory service. 
    *
  
  
  
  1.1                  jakarta-commons-sandbox/simplestore/src/btree/org/apache/commons/simplestore/btree/JDBMPersistenceManagerFactory.java
  
  Index: JDBMPersistenceManagerFactory.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache Cocoon" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.commons.simplestore.btree;
  
  import org.apache.commons.simplestore.persistence.*;
  import org.apache.commons.simplestore.persistence.impl.*;
  import org.apache.commons.simplestore.cache.*;
  import org.apache.commons.simplestore.cache.impl.*;
  
  
  import jdbm.helper.MRU;
  import jdbm.helper.ObjectCache;
  import jdbm.helper.LongComparator;
  import jdbm.recman.RecordManager;
  
  
  
  /**
   * This PersistenceManagerFactory implementation used
   *to setup Persitence manager for DB storage, random idgenerator,
   * soft reference cache and XML metadata
   *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
   *      baliuka@mwm.lt</a>
   *@version    $Id: JDBMPersistenceManagerFactory.java,v 1.1 2002/05/25 13:48:58 baliuka Exp $
   */
  public class JDBMPersistenceManagerFactory implements PersistenceManagerFactory{
      
      static private PersistenceManager pm;
      
      
      /** Holds value of property loader. */
      private ClassLoader loader;
      
      /** Holds value of property metaResource. */
      private String metaResource;
      
      /** Holds value of property maxStrongRef. */
      private int maxStrongRef = 0xFF;
      
      /** Holds value of property file. */
      private String file;
      
      /** Creates a new instance of DBPersistenceManagerFactory */
      public JDBMPersistenceManagerFactory() {
      }
      
      public PersistenceManager getPersistenceManager() {
          try{
              if( pm == null ){
                  
                  if( loader == null ){
                      loader = PersistenceManager.class.getClassLoader();
                  }
                  
                  MetaClassImpl.parse(loader.getResourceAsStream( metaResource),loader);
                  
                  MetaClassImpl mclass = new MetaClassImpl( MetaClassImpl.class.getClassLoader());
                  RecordManager recman = new RecordManager( file );
                  ObjectCache cache = new ObjectCache( recman, new MRU( 100 ) );
                  JDBMStorage storage = new JDBMStorage(recman ,cache,new LongComparator());
                  ContextImpl context = new ContextImpl(
                  mclass, new DefaultTypeConverter(),
                  new RandomOIDGenerator(),
                  storage,
                  SoftRefMemoryCache.getInstance(new java.util.HashMap(),maxStrongRef),
                  storage );
                  pm = PersistenceManagerImpl.getPersistenceManager(context);
                  
              }
              return pm;
          }catch( Exception e) {
              e.fillInStackTrace();
              throw new SimplestoreException(e.getClass()+":"+e.getMessage());
          }
      }
      
      
      /** Setter for property user.
       * @param user New value of property user.
       */
      
      /** Getter for property loader.
       * @return Value of property loader.
       */
      public ClassLoader getLoader() {
          return this.loader;
      }
      
      /** Setter for property loader.
       * @param loader New value of property loader.
       */
      public void setLoader(ClassLoader loader) {
          this.loader = loader;
      }
      
      /** Getter for property metaResource.
       * @return Value of property metaResource.
       */
      public String getMetaResource() {
          return this.metaResource;
      }
      
      /** Setter for property metaResource.
       * @param metaResource New value of property metaResource.
       */
      public void setMetaResource(String metaResource) {
          this.metaResource = metaResource;
      }
      
      /** Getter for property maxStrongRef.
       * @return Value of property maxStrongRef.
       */
      public int getMaxStrongRef() {
          return this.maxStrongRef;
      }
      
      /** Setter for property maxStrongRef.
       * @param maxStrongRef New value of property maxStrongRef.
       */
      public void setMaxStrongRef(int maxStrongRef) {
          this.maxStrongRef = maxStrongRef;
      }
      
      /** Getter for property file.
       * @return Value of property file.
       */
      public String getFile() {
          return this.file;
      }
      
      /** Setter for property file.
       * @param file New value of property file.
       */
      public void setFile(String file) {
          this.file = file;
      }
      
  }
  
  
  
  1.1                  jakarta-commons-sandbox/simplestore/src/btree/org/apache/commons/simplestore/btree/JDBMStorage.java
  
  Index: JDBMStorage.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache Cocoon" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.commons.simplestore.btree;
  
  import org.apache.commons.simplestore.cache.Cache;
  import org.apache.commons.simplestore.persistence.*;
  import org.apache.commons.simplestore.persistence.impl.*;
  
  import jdbm.JDBMEnumeration;
  import jdbm.JDBMHashtable;
  import jdbm.recman.RecordManager;
  import java.io.IOException;
  import jdbm.helper.Tuple;
  import jdbm.helper.TupleBrowser;
  import jdbm.helper.MRU;
  import jdbm.helper.ObjectCache;
  import jdbm.helper.StringComparator;
  import jdbm.recman.RecordManager;
  import jdbm.btree.BTree;
  import jdbm.helper.LongComparator;
  
  
  import java.lang.reflect.Method;
  import java.util.ArrayList;
  import java.util.Enumeration;
  import java.util.HashSet;
  import java.util.List;
  import java.util.Map;
  import java.util.Properties;
  import java.util.ResourceBundle;
  import java.util.Set;
  
  
  
  /**
   *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
   *      baliuka@mwm.lt</a>
   *@version    $Id: JDBMStorage.java,v 1.1 2002/05/25 13:48:58 baliuka Exp $
   */
  
  public class JDBMStorage extends AbstractStorage implements org.apache.commons.simplestore.tools.Constants {
      
      
      RecordManager recman;
      java.util.Map openTables = new java.util.Hashtable();
      ObjectCache cache;
      jdbm.helper.Comparator comparator;
      /** Creates a new instance of JDBMStorageManager */
      public JDBMStorage(RecordManager recman, ObjectCache cache, jdbm.helper.Comparator comparator) {
          this.recman = recman;
          this.cache  = cache;
          this.comparator = comparator;
      }
      private void clear(){
         Thread thred = Thread.currentThread();
         openTables.remove(thred);
              
      }
      public void close() throws StorageException {
          try{
              recman.close();
          }catch(java.io.IOException ioe){
              throw new StorageException(ioe.getMessage(),ioe);
          }
      }
      BTree getTree(String name)throws StorageException{
          try{
              Thread thred = Thread.currentThread();
              Map table   =  (Map)openTables.get(thred);
              if( table == null ){
                  table = new java.util.HashMap();
                  openTables.put(thred,table);
              }
              BTree tree = (BTree)table.get(name);
              if(tree != null)
                  return tree;
              long  recid = recman.getNamedObject( name );
              if ( recid != 0 ) {
                  tree = BTree.load( recman, cache, recid );
              } else {
                  tree = new BTree( recman, cache, comparator );
                  recman.setNamedObject( name, tree.getRecid() );
                  
              }
              table.put(name,tree);
              return tree;
          }catch(java.io.IOException ioe){
              throw new StorageException(ioe.getMessage(),ioe);
          }
          
      }
      protected void createObject(MetaObject properties) throws StorageException {
          try{
              BTree hashtable = getTree(
              properties.getPersistentClass().getName()
              );
              hashtable.insert(properties.getOID(),properties.getProperties(),false);
          }catch(java.io.IOException ioe){
              throw new StorageException(ioe.getMessage(),ioe);
          }
      }
      
      protected void internalBegin() throws StorageException {
           clear();
      }
      
      protected void internalCommit() throws StorageException {
          try{
              recman.commit();
              clear();
          }catch(java.io.IOException ioe){
              throw new StorageException(ioe.getMessage(),ioe);
          }
      }
      
      protected void internalRollback() throws StorageException {
          try{
              recman.rollback();
              clear();
          }catch(java.io.IOException ioe){
              throw new StorageException(ioe.getMessage(),ioe);
          }
      }
      
      protected void removeObject(MetaObject properties) throws StorageException {
          try{
              BTree hashtable = getTree(
              properties.getPersistentClass().getName()
              );
              hashtable.remove(properties.getOID());
          }catch(java.io.IOException ioe){
              throw new StorageException(ioe.getMessage(),ioe);
          }
      }
      
      public void retrieveInternal(Class clasz, int index, Object value,Set objects) throws StorageException {
          try{
              BTree tree = getTree(
              clasz.getName()
              );
              Tuple  tuple = new Tuple();
              TupleBrowser browser = tree.browse();
              while ( browser.getNext( tuple ) ) {
                  Object id = tuple.getKey();
                  Persistent pc = (Persistent)retrieveObject(clasz,id);
                  MetaObject mo = pc.getMetaObject();
                 if( (value == null) && (mo.getProperty(index) == null) ){  
                      objects.add( mo.getObject() );
                      continue;
                    }
                   if( value != null && value.equals(mo.getProperty(index))  ){
                      objects.add( mo.getObject() );
                   } 
                  
              }
              
            
          }catch(java.io.IOException ioe){
              throw new StorageException(ioe.getMessage(),ioe);
          }
          
      }
      
       public void enumerateInternal(final Class clasz,Set objects, final EnumeratorCallback callback) throws StorageException {
          try{
              BTree tree = getTree(
              clasz.getName()
              );
              Tuple  tuple = new Tuple();
              TupleBrowser browser = tree.browse();
              while ( browser.getNext( tuple ) ) {
                  Object id = tuple.getKey();
                  Persistent pc = (Persistent)retrieveObject(clasz,id);
                  if( objects.add( pc ) ){
                       if(!callback.nextObject( pc ) ){
                          return;
                       }
               }
              }
          }catch(java.io.IOException ioe){
              throw new StorageException(ioe.getMessage(),ioe);
          }
      }
      
      public Object retrieveObjectInternal(Class clasz, Object id) throws StorageException {
          try{
              BTree tree = getTree(clasz.getName());
              
              Object obj = tree.find(id);
              if( obj == null ){
                  throw new ObjectNotFound();
              }
              MetaClass mClass =  context.getMetaClass(clasz);
              Persistent result = (Persistent) mClass.newInstance( id );
              MetaObject pc = result.getMetaObject();
              Object props[] = pc.getProperties();
              System.arraycopy(obj,0,props,0,props.length);
             return result;
          }catch(java.io.IOException ioe){
              throw new StorageException(ioe.getMessage(),ioe);
          }
      }
      
      
      public void storeObject(MetaObject properties) throws StorageException {
          createObject(properties);
      }
      
      
  }
  
  
  
  1.15      +31 -18    jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/impl/AbstractStorage.java
  
  Index: AbstractStorage.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/impl/AbstractStorage.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- AbstractStorage.java	17 May 2002 22:20:51 -0000	1.14
  +++ AbstractStorage.java	25 May 2002 13:48:58 -0000	1.15
  @@ -71,7 +71,7 @@
   /**
    *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
    *      baliuka@mwm.lt</a>
  - *@version    $Id: AbstractStorage.java,v 1.14 2002/05/17 22:20:51 baliuka Exp $
  + *@version    $Id: AbstractStorage.java,v 1.15 2002/05/25 13:48:58 baliuka Exp $
    */
   
   public abstract class AbstractStorage
  @@ -79,25 +79,25 @@
       
       protected Context context;    
       
  -    public InternalTransaction getTransaction() {
  +    public final InternalTransaction getTransaction() {
           
           return TransactionImpl.getInstance(this,context);
       }
       
  -    public Object getAttribute(String name) {
  +    public final Object getAttribute(String name) {
              throw new java.lang.NoSuchMethodError();
       }
       
  -    public void removeAttribute(String name) {
  +    public final void removeAttribute(String name) {
              throw new java.lang.NoSuchMethodError();
       }
       
  -    public void setAttribute(String name, Object value) {
  +    public final void setAttribute(String name, Object value) {
              throw new java.lang.NoSuchMethodError();
       }
       
       
  -    public void begin(Set objects) {
  +    public final void begin(Set objects) {
           try {
               internalBegin();
           } catch (Throwable t) {
  @@ -106,24 +106,24 @@
           }
       }
       
  -    public void add(MetaObject props) {
  +    public final void add(MetaObject props) {
              throw new java.lang.NoSuchMethodError();
       }
       
  -    public void commit() {
  +    public final void commit() {
              throw new java.lang.NoSuchMethodError(); 
          }
       
  -    public void begin() {
  +    public final void begin() {
              throw new java.lang.NoSuchMethodError(); 
         
       }
       
  -    public void add(Object key,java.util.Collection obj) {
  +    public final void add(Object key,java.util.Collection obj) {
              throw new java.lang.NoSuchMethodError(); 
       }  
       
  -    public void rollback(Set objects) {
  +    public final void rollback(Set objects) {
           try {
         
               internalRollback();
  @@ -133,13 +133,13 @@
           }
       }
       
  -    public void rollback() {
  +    public final void rollback() {
           
               throw new java.lang.NoSuchMethodError();
           
       }
       
  -    public void commit(Set objects) {
  +    public final void commit(Set objects) {
            MetaObject pp = null;        
           try {
   
  @@ -163,7 +163,7 @@
                   }
                   throw new java.lang.IllegalStateException(pp.toString());
               }
  -      
  +        
               internalCommit();
           } catch (Throwable t) {
             t.printStackTrace();
  @@ -186,11 +186,15 @@
       
       protected abstract void internalBegin() throws StorageException;
       
  +    protected abstract Object retrieveObjectInternal(Class clasz,Object id);
  +    
       public abstract void retrieveInternal(Class clasz, int index, Object value,java.util.Set objects)throws StorageException; 
       
  +    
  +    
     
      
  -    public  java.util.Collection retrieve(Class clasz, int index, Object value)throws StorageException{
  +    public final java.util.Collection retrieve(Class clasz, int index, Object value)throws StorageException{
       
          
           Object key = KeyPair.newKey(clasz, new Integer(index), value );
  @@ -234,11 +238,20 @@
       
       
       
  -    public java.util.Collection getTransactionalObjects() {
  +    public final java.util.Collection getTransactionalObjects() {
           throw new java.lang.NoSuchMethodError();
       }
       
  -     public void enumerate(Class clasz, EnumeratorCallback callback) throws StorageException {
  +    public final Object retrieveObject(Class clasz,Object id){
  +       Object result =  context.getCache().get(id);
  +       if(result == null){
  +        result =  retrieveObjectInternal(clasz,id);
  +        context.getCache().put(id,result);
  +       }
  +       return result;
  +    }
  +    
  +     public final void enumerate(Class clasz, EnumeratorCallback callback) throws StorageException {
        
         final java.util.Set objects = new java.util.HashSet();
           
  @@ -257,7 +270,7 @@
      
       
       
  -    public void setContext(Context context) {
  +    public final void setContext(Context context) {
           this.context = context;
       }
       
  
  
  
  1.6       +2 -10     jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/impl/PersistenceManagerImpl.java
  
  Index: PersistenceManagerImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/impl/PersistenceManagerImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PersistenceManagerImpl.java	12 May 2002 11:40:02 -0000	1.5
  +++ PersistenceManagerImpl.java	25 May 2002 13:48:58 -0000	1.6
  @@ -73,7 +73,7 @@
   /**
    *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
    *      baliuka@mwm.lt</a>
  - *@version    $Id: PersistenceManagerImpl.java,v 1.5 2002/05/12 11:40:02 baliuka Exp $
  + *@version    $Id: PersistenceManagerImpl.java,v 1.6 2002/05/25 13:48:58 baliuka Exp $
    */
   
   public class PersistenceManagerImpl implements PersistenceManager{
  @@ -123,16 +123,8 @@
       }
   
       public Object findInstance( Class clasz, Object oid ) throws StorageException {
  -            //try cahce first
  -        Object result =  context.getCache().get(oid);
           
  -        if (result != null) {
  -            return result;
  -        }
  -    
  -       result = context.getStorage().retrieveObject( clasz, oid );
  -       context.getCache().put(oid,result);
  -       return result;
  +       return context.getStorage().retrieveObject( clasz, oid );
       }
   
       public Set findAll(Class clasz) throws StorageException {
  
  
  
  1.38      +2 -1      jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/impl/PersistentProxy.java
  
  Index: PersistentProxy.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/impl/PersistentProxy.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- PersistentProxy.java	17 May 2002 22:20:51 -0000	1.37
  +++ PersistentProxy.java	25 May 2002 13:48:58 -0000	1.38
  @@ -77,7 +77,7 @@
    *      baliuka@mwm.lt</a>
    *@author     Gerhard Froehlich <a href="mailto:g-froehlich@gmx.de">
    *      g-froehlich@gmx.de</a>
  - *@version    $Id: PersistentProxy.java,v 1.37 2002/05/17 22:20:51 baliuka Exp $
  + *@version    $Id: PersistentProxy.java,v 1.38 2002/05/25 13:48:58 baliuka Exp $
    */
   public class PersistentProxy
   implements MetaObject,  org.apache.commons.simplestore.tools.Constants ,
  @@ -386,6 +386,7 @@
           if( lock != null && lock != Thread.currentThread() ){
               try{
                   if( TRANSACTION_TIMEOUT < 0){
  +                    System.out.println("WAIT");
                       wait();
                   }else wait(TRANSACTION_TIMEOUT);
               }catch(Exception e){ }
  
  
  
  1.1                  jakarta-commons-sandbox/simplestore/src/jdbc/org/apache/commons/simplestore/jdbc/ConnectionFactory.java
  
  Index: ConnectionFactory.java
  ===================================================================
  /*
   * ConnectionFactory.java
   *
   * Created on Šeštadienis, 2002, Kovo 16, 00.43
   */
  
  package org.apache.commons.simplestore.jdbc;
  
  /**
   *
   * @author  user
   */
  public interface ConnectionFactory {
      
   public java.sql.Connection getConnection()throws java.sql.SQLException;
   
  }
  
  
  
  1.1                  jakarta-commons-sandbox/simplestore/src/jdbc/org/apache/commons/simplestore/jdbc/DBPersistenceManagerFactory.java
  
  Index: DBPersistenceManagerFactory.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache Cocoon" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.commons.simplestore.jdbc;
  
  import org.apache.commons.simplestore.persistence.*;
  import org.apache.commons.simplestore.cache.*;
  import org.apache.commons.simplestore.cache.impl.*;
  import org.apache.commons.simplestore.persistence.impl.*;
  
  
  /**
   * This PersistenceManagerFactory implementation used
   *to setup Persitence manager for DB storage, random idgenerator,
   * soft reference cache and XML metadata
   *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
   *      baliuka@mwm.lt</a>
   *@version    $Id: DBPersistenceManagerFactory.java,v 1.1 2002/05/25 13:48:59 baliuka Exp $
   */
  public class DBPersistenceManagerFactory implements PersistenceManagerFactory{
      
     static private PersistenceManager pm;
      
      /** Holds value of property user. */
      private String user = "";
      
      /** Holds value of property password. */
      private String password = "";
      
      /** Holds value of property driver. */
      private String driver;
      
      /** Holds value of property maxConnections. */
      private int maxConnections = 1;
      
      /** Holds value of property url. */
      private String url;
      
      /** Holds value of property loader. */
      private ClassLoader loader;
      
      /** Holds value of property metaResource. */
      private String metaResource;
      
      /** Holds value of property maxStrongRef. */
      private int maxStrongRef = 0xFF;
      
      /** Holds value of property typeMapResource. */
      private String typeMapResource = TypeNameMapImpl.class.
                                        getName().replace('.','/') + ".properties";
      
      /** Creates a new instance of DBPersistenceManagerFactory */
      public DBPersistenceManagerFactory() {
      }
      
      public PersistenceManager getPersistenceManager() {
          try{
          if( pm == null ){
            
           if( loader == null ){
               loader = PersistenceManager.class.getClassLoader();
           }
           
         MetaClassImpl.parse(loader.getResourceAsStream( metaResource),loader);
         
         
       
          
         final DriverDataSource ds = new DriverDataSource();
          ds.setDriver(driver);
          ds.setMaxConnections(maxConnections);
          ds.setUrl(url);
          ds.setUser(user);
          ds.setPassword(password);
         
          MetaClassImpl mclass = new MetaClassImpl( MetaClassImpl.class.getClassLoader());
          java.io.InputStream is = loader.getResourceAsStream(typeMapResource);
          
           if( is == null ){
              throw new java.util.MissingResourceException(
                    typeMapResource,
                    MetaClassImpl.class.getName(),
                    "Type Mapping");
           }
          
           java.util.Properties props = new java.util.Properties();
           props.load(is);
           is.close();
           
           MetaClass mcs[] =  mclass.classes();
           TypeNameMap tnm = new TypeNameMapImpl( props );
           
           java.sql.Connection connection = ds.getConnection();
           java.sql.Statement statement   =  connection.createStatement();
           try{
               
           for( int i=0; i< mcs.length; i++){
          
           String ddl =  generateCreateTableStatement(mcs[i],tnm);
           try{
             statement.execute(ddl);
             connection.commit();
             System.out.println(ddl);
           }catch(java.sql.SQLException sqle){
               System.out.println( sqle ); 
              
           }
          }
          
           }finally{
               connection.close();
           }
          
          DBStorage storage = new DBStorage( ds );
          ContextImpl context = new ContextImpl(
                mclass, new DefaultTypeConverter(),
                new RandomOIDGenerator(),
                storage,
                SoftRefMemoryCache.getInstance(new java.util.HashMap(),maxStrongRef),
                          storage );
          pm = PersistenceManagerImpl.getPersistenceManager(context);
          
          }
          return pm;
          }catch( Exception e) {
              e.printStackTrace();
            throw new SimplestoreException(e.getClass()+":"+e.getMessage());
          }
      }
      
      /** Getter for property user.
       * @return Value of property user.
       */
      public String getUser() {
          return this.user;
      }
      
      /** Setter for property user.
       * @param user New value of property user.
       */
      public void setUser(String user) {
          this.user = user;
      }
      
      /** Getter for property password.
       * @return Value of property password.
       */
      public String getPassword() {
          return this.password;
      }
      
      /** Setter for property password.
       * @param password New value of property password.
       */
      public void setPassword(String password) {
          this.password = password;
      }
      
      /** Getter for property driver.
       * @return Value of property driver.
       */
      public String getDriver() {
          return this.driver;
      }
      
      /** Setter for property driver.
       * @param driver New value of property driver.
       */
      public void setDriver(String driver) {
          this.driver = driver;
      }
      
      /** Getter for property maxConnections.
       * @return Value of property maxConnections.
       */
      public int getMaxConnections() {
          return this.maxConnections;
      }
      
      /** Setter for property maxConnections.
       * @param maxConnections New value of property maxConnections.
       */
      public void setMaxConnections(int maxConnections) {
          this.maxConnections = maxConnections;
      }
      
      /** Getter for property url.
       * @return Value of property url.
       */
      public String getUrl() {
          return this.url;
      }
      
      /** Setter for property url.
       * @param url New value of property url.
       */
      public void setUrl(String url) {
          this.url = url;
      }
      
      /** Getter for property loader.
       * @return Value of property loader.
       */
      public ClassLoader getLoader() {
          return this.loader;
      }
      
      /** Setter for property loader.
       * @param loader New value of property loader.
       */
      public void setLoader(ClassLoader loader) {
          this.loader = loader;
      }
      
      /** Getter for property metaResource.
       * @return Value of property metaResource.
       */
      public String getMetaResource() {
          return this.metaResource;
      }
      
      /** Setter for property metaResource.
       * @param metaResource New value of property metaResource.
       */
      public void setMetaResource(String metaResource) {
          this.metaResource = metaResource;
      }
      
      /** Getter for property maxStrongRef.
       * @return Value of property maxStrongRef.
       */
      public int getMaxStrongRef() {
          return this.maxStrongRef;
      }
      
      /** Setter for property maxStrongRef.
       * @param maxStrongRef New value of property maxStrongRef.
       */
      public void setMaxStrongRef(int maxStrongRef) {
          this.maxStrongRef = maxStrongRef;
      }
      
     static String generateCreateTableStatement( MetaClass mclass, TypeNameMap tmap ){
         
         java.beans.PropertyDescriptor pds[] = mclass.getProperties();
         StringBuffer result = new StringBuffer();
         result.append("CREATE TABLE ").
                append( mclass.getName() + "( ").
                append( mclass.getOIDName() + " ").
                append( tmap.getTypeName( mclass.getOIDType() ) ).
                append( " NOT NULL PRIMARY KEY " );
         
         for( int i=0; i< pds.length; i++ ){
           String name = mclass.getPropertyName(i);
            if( name == null || name.equalsIgnoreCase(mclass.getOIDName()) ){
              continue;
            }
           String type;
           if (mclass.isReference(i)){
             type = tmap.getTypeName( mclass.getOIDType() );   
           }else{
             type = tmap.getTypeName( mclass.getPropertyType(i) );  
           }
           if( type != null ){
             result.append("," + name + " " + type);
           }
         
         }
       return result.append(")").toString(); 
     
       
     } 
      
     /** Getter for property typeMapResource.
      * @return Value of property typeMapResource.
      */
     public String getTypeMapResource() {
         return this.typeMapResource;
     }
     
     /** Setter for property typeMapResource.
      * @param typeMapResource New value of property typeMapResource.
      */
     public void setTypeMapResource(String typeMapResource) {
         this.typeMapResource = typeMapResource;
     }
     
  }
  
  
  
  1.1                  jakarta-commons-sandbox/simplestore/src/jdbc/org/apache/commons/simplestore/jdbc/DBStorage.java
  
  Index: DBStorage.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache Cocoon" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.commons.simplestore.jdbc;
  
  import org.apache.commons.simplestore.persistence.impl.*;
  import org.apache.commons.simplestore.persistence.*;
  
  import java.lang.reflect.Method;
  import java.sql.Connection;
  import java.sql.PreparedStatement;
  import java.sql.ResultSet;
  import java.sql.ResultSetMetaData;
  import java.sql.SQLException;
  import java.sql.Types;
  import java.util.ArrayList;
  import java.util.Enumeration;
  import java.util.HashSet;
  import java.util.List;
  import java.util.Map;
  import java.util.Properties;
  import java.util.Set;
  
  
  
  /**
   *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
   *      baliuka@mwm.lt</a>
   *@version    $Id: DBStorage.java,v 1.1 2002/05/25 13:48:59 baliuka Exp $
   */
  public class DBStorage extends AbstractStorage implements org.apache.commons.simplestore.tools.Constants {
     
      private final static String CONNECTION = "org.apache.commons.simplestore.jdbc.DBStorage.connection";
      private final static String INTERNAL_OID = "INTERNAL_OID";
      private ConnectionFactory ds;
      
      
      /**
       * Creates new DBStorageManager
       *
       *@param  ds
       */
      public DBStorage(ConnectionFactory ds) {
          this.ds = ds;
      }
      
      
      public  Object toSQLType(Object object) {
          return context.getTypeConverter().toStorageType(object,null);
      }
      
      private  int excecute( String sql, Object[] args, ResultSetHandler eh) throws StorageException {
          
          Connection connection =  getConnection();
       
          int result = 0;
          try {
              
              final PreparedStatement statement = connection.prepareStatement(sql);
              ResultSet rs = null;
              try {
                  if (args != null) {
                      
                      for (int i = 1; i <= args.length; i++) {
                          
                          if (args[i - 1] == null) {
                              statement.setNull(i, Types.OTHER);
                          } else {
                              statement.setObject(i, args[i - 1]);
                          }
                      }
                  }
                  if (statement.execute()) { // SELECT
                      rs = statement.getResultSet();
                  } else { // UPDATE
                      return statement.getUpdateCount();
                  }
                  
                  
                  if (rs != null && eh != null) {
                      
                      ResultSetMetaData rsmd = rs.getMetaData();
                      int cnt = rsmd.getColumnCount();
                      
                      while (rs.next()) {
                          result++;
                          for (int i = 1; i <= cnt; i++) {
                              String name = rsmd.getColumnName(i);
                              Object val = rs.getObject(i);
                              if(! eh.nextResult(i, name, val, rsmd.getColumnType(i))){
                                  break;
                              }
                          }
                      }
                      
                  }
                  
              } finally {
             
                  if ( rs != null ) {
                      rs.close();
                  }
                  if ( statement != null ) {
                      statement.close();
                  }
              }
          } catch (SQLException se) {
              throw new StorageException(sql, se.fillInStackTrace());
          }
          return result;
      }
      
      
      
      public Object retrieveObjectInternal( final Class clasz, Object id ) throws StorageException {
           
          final MetaClass mClass =  context.getMetaClass( clasz );
          final java.beans.PropertyDescriptor[] descriptors = mClass.getProperties();
          final String sql = "SELECT * FROM " + mClass.getName() + " WHERE "+mClass.getOIDName()+"=?";
          Persistent result = (Persistent) mClass.newInstance( id );
          final MetaObject pc = result.getMetaObject();
          final Object props[] = pc.getProperties();
          ResultSetHandler rsh =
          new ResultSetHandler() {
              
              public boolean nextResult(int index, String name, Object value, int type) throws StorageException {
                  
                  try {
                      if ( name.equalsIgnoreCase(mClass.getOIDName())) {
                          //OID is known
                          return true;
                      }
                      
                      int propIndex =  mClass.getPropertyIndex( name );
                      props[ propIndex ] = value;
                      return true;
                  } catch (Throwable t) {
                      t.printStackTrace();
                      throw new StorageException(t.getMessage(), t.fillInStackTrace());
                  }
              }
              
          };
          
          if ( excecute( sql, new Object[]{id}, rsh) == 0 ) {
              throw new ObjectNotFound(pc.getOID().toString(), null);
          }
          
           return result;
      }
      
      public void enumerateInternal(final Class clasz, Set objects, final EnumeratorCallback callback) throws StorageException {
          
          final MetaClass mClass =  context.getMetaClass(clasz);
          final String sql = "SELECT "+ mClass.getOIDName() + " AS " + INTERNAL_OID + ", * FROM " + mClass.getName();
          
          excecute( sql, null, new QueryHandler(objects,clasz,callback));
          
      }
      
      
      
      
      public void storeObject(MetaObject properties) throws StorageException {
          
          final Class clasz = properties.getPersistentClass();
          final MetaClass mClass =  context.getMetaClass(clasz);
          final String name = mClass.getName();
          final java.beans.PropertyDescriptor[] beanProps = mClass.getProperties();
          final List values = new ArrayList( beanProps.length + 1 );
          final StringBuffer names = new StringBuffer( beanProps.length * 10 );
          
          
          for (int i = 0; i < beanProps.length; i++) {
              
              java.beans.PropertyDescriptor descriptor = beanProps[i];
              if (descriptor.getWriteMethod() != null) {
                  names.append( mClass.getPropertyName(i) );
                  names.append("=?,");
                  values.add(toSQLType(properties.getProperty(i)));
                  
              }
          }
          names.setCharAt(names.length() - 1, ' ');
          names.append("WHERE "+ mClass.getOIDName() + "=?");
          values.add(properties.getOID());
          
          final String sql = "UPDATE " + name + " SET " + names;
          excecute( sql, values.toArray(), null);
          
      }
      
      public void close() {
          
          try {
              
              Connection connection = (Connection) context.getTransactionManager().getTransaction().getAttribute( CONNECTION );
              if (connection != null) {
                  connection.close();
              }
          } catch (Exception e) {
              throw new StorageException(e.getMessage(), e.fillInStackTrace());
          }
      }
      
      protected void createObject(MetaObject properties) throws StorageException {
          
          final Class clasz = properties.getPersistentClass();
          final MetaClass mClass =  context.getMetaClass(clasz);
          final String name = mClass.getName();
          final Object id = properties.getOID();
          final java.beans.PropertyDescriptor[] beanProps = mClass.getProperties();
          final List values = new ArrayList( beanProps.length + 1 );
          
          String names = "";
          String params = "";
          values.add(id);
          
          for (int i = 0; i < beanProps.length; i++) {
              
              java.beans.PropertyDescriptor descriptor = beanProps[i];
              if (descriptor.getWriteMethod() != null) {
                  
                  Object value = toSQLType( properties.getProperty(i) );
                  if (value == null) {
                      continue;
                  }
                  names += "," + mClass.getPropertyName(i);
                  values.add(value);
                  params += ",?";
              }
          }
          
          final String sql = "INSERT INTO " + name +
          "(" + mClass.getOIDName() + names +
          ")VALUES(?" + params + ")";
          
          excecute( sql, values.toArray(), null);
          
      }
      
      /**
       * this method doe's not removes object from cache
       */
      
      protected void removeObject(MetaObject obj) throws StorageException {
          
          final MetaClass mClass =  context.getMetaClass(obj.getPersistentClass());
          final String name = mClass.getName();
          final Object id = obj.getOID();
          final String sql = "DELETE FROM " + name +
          " WHERE "+ mClass.getOIDName() + "=?";
          
          if ( excecute( sql, new Object[]{id}, null) == 0 ) {
              throw new ObjectNotFound(obj.getOID().toString(), null);
          }
      }
      
      protected void internalCommit() throws StorageException {
          try {
              Connection connection = getConnection();
              try {
                  connection.commit();
              } finally {
                  connection.close();
              }
          } catch (SQLException se) {
              throw new StorageException(se.getMessage(), se.fillInStackTrace());
          }
      }
      
      protected void internalRollback() throws StorageException {
          try {
              Connection connection = getConnection();
              try {
                  connection.rollback();
              } finally {
                  connection.close();
              }
          } catch (SQLException se) {
              
              throw new StorageException(se.getMessage(), se.fillInStackTrace());
          }
      }
      
      protected void internalBegin() throws StorageException {
          // do nothing
      }
      
      private Connection getConnection() {
          try{
              Connection connection = (Connection) context.getTransactionManager().getTransaction().getAttribute(CONNECTION);
              
              if (connection == null) {
                  // open new connection
                  connection = ds.getConnection();
                  context.getTransactionManager().getTransaction().setAttribute(CONNECTION, connection);
              }
              return connection;
              
          } catch (SQLException se) {
              throw new StorageException(se.getMessage(), se.fillInStackTrace());
          }
      }
      
      public void retrieveInternal(Class clasz, int index, Object value,java.util.Set objects)
      throws StorageException{
          
          
          final MetaClass mClass =  context.getMetaClass(clasz);
          final String sql = "SELECT "+ mClass.getOIDName() + " AS " + INTERNAL_OID +
          ", * FROM " + mClass.getName() +
          " WHERE " + mClass.getPropertyName(index) + "=?";
          
          excecute( sql, new Object[]{value}, new QueryHandler(objects, clasz,
          new EnumeratorCallback(){
              
              public boolean nextObject(Object object){
                  return true;
              }
              
          }
          )
          );
          
      }
      
      
      class QueryHandler implements ResultSetHandler {
          Object props[];
          Set objects;
          MetaClass mClass ;
          java.beans.PropertyDescriptor[] descriptors;
          EnumeratorCallback callback;
          
          QueryHandler(Set objects, Class clasz,EnumeratorCallback callback) {
              this.objects = objects;
              this.mClass =  context.getMetaClass(clasz);
              this.descriptors = mClass.getProperties();
              this.callback = callback;
          }
          
          public boolean nextResult(int index, String name, Object value, int type) throws StorageException {
              try {
                  name = name.toUpperCase();
                  if (index == 1) {
                      //try to find in cache first
                      Persistent p = (Persistent) context.getCache().get(value);
                      if ( p != null ) {
                          props = null;
                          if( objects.add(p)){
                              return callback.nextObject(p);
                          }
                      }
                      p = mClass.newInstance( value );
                      MetaObject pc = p.getMetaObject();
                      props = pc.getProperties();
                      if( objects.add(p)){
                          context.getCache().put(value,p);
                          return callback.nextObject(p);
                      }
                      
                      
                  }
                  
                  if ( name.equals( mClass.getOIDName() ) || props == null) {
                      return true;
                  }
                  
                  props[  mClass.getPropertyIndex( name ) ] = value ;
                  
                  return true;
                  
              } catch (Throwable t) {
                  t.printStackTrace();
                  throw new StorageException(t.getMessage(), t);
              }
          }
      }
      
      
      interface ResultSetHandler {
          public boolean nextResult(int index, String name, Object value, int type) throws StorageException;
      }
      
  }
  
  
  
  
  1.1                  jakarta-commons-sandbox/simplestore/src/jdbc/org/apache/commons/simplestore/jdbc/DriverDataSource.java
  
  Index: DriverDataSource.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache Cocoon" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.commons.simplestore.jdbc;
  
  
  
  import java.io.PrintWriter;
  import java.lang.reflect.InvocationHandler;
  import java.lang.reflect.Proxy;
  import java.sql.CallableStatement;
  import java.sql.Connection;
  import java.sql.DatabaseMetaData;
  import java.sql.Driver;
  import java.sql.PreparedStatement;
  import java.sql.ResultSet;
  import java.sql.SQLException;
  import java.sql.SQLWarning;
  import java.sql.Statement;
  import java.util.Map;
  import java.util.Properties;
  
  
  
  import org.apache.commons.simplestore.persistence.SimplestoreException;
  import org.apache.commons.simplestore.cache.*;
  /**
   *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
   *      baliuka@mwm.lt</a>
   *@version    $Id: DriverDataSource.java,v 1.1 2002/05/25 13:48:59 baliuka Exp $
   *
   */
  public class DriverDataSource implements ConnectionFactory {
      
      private final Properties properties = new Properties();
      
      private Connection connection[] = null;
      
      
      private Driver driver;
      
      /** Holds value of property user. */
      private String user;
      
      /** Holds value of property password. */
      private String password;
      
      /** Holds value of property url. */
      private String url;
      
      /** Holds value of property maxConnections. */
      private int maxConnections = 5;
      
      /** Creates new DriverDataSourceFactoryImpl */
      public DriverDataSource() { }
      
      /**
       * Setter for property user.
       *
       *@param  user  New value of property user.
       */
      public void setUser(String user) {
          if (this.user != null) {
              throw new IllegalStateException();
          }
          this.user = user;
          properties.setProperty("user", user);
      }
      
      /**
       * Setter for property password.
       *
       *@param  password  New value of property password.
       */
      public void setPassword(String password) {
          if (this.password != null) {
              throw new IllegalStateException();
          }
          properties.setProperty("password", password);
          this.password = password;
      }
      
      /**
       * Setter for property url.
       *
       *@param  url  New value of property url.
       */
      public void setUrl(String url) {
          if (this.url != null) {
              throw new IllegalStateException();
          }
          this.url = url;
      }
      
      /**
       * Setter for property maxConnections.
       *
       *@param  maxConnections  New value of property maxConnections.
       */
      public void setMaxConnections(int maxConnections) {
          if (connection != null) {
              throw new IllegalStateException();
          }
          this.maxConnections = maxConnections;
          
      }
      
      
      /**
       * Setter for property driver.
       *
       *@param  driver  New value of property driver.
       */
      public void setDriver(String driver) {
          if (this.driver != null) {
              throw new IllegalStateException();
          }
          
          try {
              this.driver = (Driver) Class.forName(driver,true,
              this.getClass().getClassLoader() ).newInstance();
          } catch (Exception e) {
              e.printStackTrace();
              throw new SimplestoreException(e.getMessage());
          }
      }
      
      public void setDriver(Driver driver) {
          if (this.driver != null) {
              throw new IllegalStateException();
          }
          this.driver = driver;
      }
      
      
      
      /**
       * Getter for property user.
       *
       *@return    Value of property user.
       */
      public String getUser() {
          return user;
      }
      
      /**
       * Getter for property password.
       *
       *@return    Value of property password.
       */
      public String getPassword() {
          return password;
      }
      
      /**
       * Getter for property url.
       *
       *@return    Value of property url.
       */
      public String getUrl() {
          return url;
      }
      
      public Connection getConnection() throws SQLException {
          
          synchronized (this) {
              
              if (connection == null) {
                  connection =
                  new Connection[
                  maxConnections < 1 ? 1 : maxConnections
                  ];
              }
              
              int i = 0;
              while ( true ) { //  must loop and wait not used connection
                  if (connection[i] != null) {
                      if ( !ConnectionProxy.isLocked( connection[i] ) ) {
                          
                          
                          if ( ConnectionProxy.isClosed( connection[ i ] )) { // expired ?
                              
                              ConnectionProxy.release( connection[ i ] );
                              connection[ i ] = newConnection();
                          }
                          
                          break;
                      }
                  }else {
                      connection[i] = newConnection();
                      break;
                  }
                  i = ( i + 1 ) % connection.length;
                  try{
                      
                      if( i == 0  ) {
                          wait( 1000 );
                      }
                      
                  }catch( java.lang.InterruptedException ie ){
                      
                  }
              }
              
              
              ConnectionProxy.lock( connection[i] ) ;
              
              return connection[i];
          }
          
      }
      
      
      /**
       * Getter for property maxConnections.
       *
       *@return    Value of property maxConnections.
       */
      public int getMaxConnections() {
          return maxConnections;
      }
      
      private Connection newConnection() throws SQLException {
          Connection con = driver.connect(url, properties);
          con.setAutoCommit(false);
          return ConnectionProxy.create(con,this);
      }
      
  }
  
  class ConnectionProxy  implements InvocationHandler {
      
      
      private Thread used;
      private Connection connection;
      private ConnectionFactory ds;
      private final java.util.List jdbcResources = new java.util.ArrayList();
      
      
      static boolean isClosed(Object conn){
         try{ 
             
          ConnectionProxy proxy = (ConnectionProxy)
          java.lang.reflect.Proxy.getInvocationHandler(conn);
          
          return   proxy.connection.isClosed();
         }catch( Exception e ){
           return true;
         }
      }
      
     
      
      static boolean isLocked(Object conn){
          ConnectionProxy proxy = (ConnectionProxy)
          java.lang.reflect.Proxy.getInvocationHandler(conn);
          
          return  !( proxy.used == null || !proxy.used.isAlive() ||
          proxy.used == Thread.currentThread());
          
      }
      static void lock(Object conn){
          ConnectionProxy proxy = (ConnectionProxy)
          java.lang.reflect.Proxy.getInvocationHandler(conn);
          
          proxy.used = Thread.currentThread();
      }
      static void release(Object conn){
          ConnectionProxy proxy = (ConnectionProxy)
          java.lang.reflect.Proxy.getInvocationHandler(conn);
          try{
              
              proxy.connection.close();
              
          }catch(Exception e){
              
          }
      }
      
      
      
      ConnectionProxy( Connection connection, ConnectionFactory ds ) {
          this.connection = connection;
          this.ds = ds;
          
      }
      
      private void close() throws Exception{
          
          for( int i = jdbcResources.size() - 1; i >= 0; i-- ){
              
              Object res = jdbcResources.get(i);
              
              if ( res instanceof java.sql.Statement ){
                  try{
                      ((java.sql.Statement)res).close();
                  }catch( Exception e ){}
                  
              }else if ( res instanceof java.sql.ResultSet ){
                  try{
                      ((java.sql.ResultSet)res).close();
                  }catch( Exception e ){}
              }
              
          }
          jdbcResources.clear();
          used = null;
          synchronized( ds ){
              ds.notifyAll();
          }
         
      }
      
      private Object getStatementProxy(final Object stmt){
          
        return  java.lang.reflect.Proxy.newProxyInstance(
          stmt.getClass().getClassLoader(),
          stmt.getClass().getInterfaces(),
          new java.lang.reflect.InvocationHandler(){
              
              public Object invoke(Object stmtObject,java.lang.reflect.Method stmtMethod,Object[] stmtArgs)
              throws Throwable{
                  try{
                      
                      Object stmtResult = stmtMethod.invoke(stmt, stmtArgs);
                      
                      if( stmtResult != null && (stmtResult instanceof java.sql.ResultSet) ){
                          
                          jdbcResources.add(stmtResult);
                          
                      }
                      return   stmtResult;
                      
                  }catch( java.lang.reflect.InvocationTargetException itex ){
                      
                      throw itex.getTargetException().fillInStackTrace();
                  }
              }
          }
          );
          
          
      }
      public Object invoke(Object object,java.lang.reflect.Method method,Object[] args)
      throws Throwable{
          try{
              if( method.equals(CLOSE)  ) {
                    close();
                  return null;
                  
              }else {
                  
                  Object result = method.invoke(connection, args );
                  
                  if ( result != null && (result instanceof java.sql.Statement) ){
                      
                      jdbcResources.add(result);
                      result = getStatementProxy( result );
                      
                      
                  }
                  
                  
                  return result;
                  
                  
              }
          }catch( java.lang.reflect.InvocationTargetException ite ){
              
              throw ite.getTargetException().fillInStackTrace();
          }
      }
      public static  java.sql.Connection create(Connection connection, ConnectionFactory ds){
          
          return (Connection)
          java.lang.reflect.Proxy.newProxyInstance(
          Connection.class.getClassLoader(),
          new Class[]{java.sql.Connection.class},
          new ConnectionProxy(connection,ds)
          );
          
      }
      
      private static final java.lang.reflect.Method CLOSE;
      static{
         try{
         
             CLOSE = java.sql.Connection.class.getMethod("close",new Class[]{});
             
         }catch( Exception e){
          throw new  Error(e.getMessage());
         }
     
     }
      
      
  }
  
  
  
  
  1.1                  jakarta-commons-sandbox/simplestore/src/jdbc/org/apache/commons/simplestore/jdbc/TypeNameMap.java
  
  Index: TypeNameMap.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache Cocoon" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  package org.apache.commons.simplestore.jdbc;
  
  /**
   *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
   *      baliuka@mwm.lt</a>
   *@version    $Id: TypeNameMap.java,v 1.1 2002/05/25 13:48:59 baliuka Exp $
   *
   */
  public interface TypeNameMap {
      
   public  String getTypeName(Class clasz);
      
  }
  
  
  
  1.1                  jakarta-commons-sandbox/simplestore/src/jdbc/org/apache/commons/simplestore/jdbc/TypeNameMapImpl.java
  
  Index: TypeNameMapImpl.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache Cocoon" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  package org.apache.commons.simplestore.jdbc;
  /**
   *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
   *      baliuka@mwm.lt</a>
   *@version    $Id: TypeNameMapImpl.java,v 1.1 2002/05/25 13:48:59 baliuka Exp $
   *
   */
  public class TypeNameMapImpl implements TypeNameMap {
      
      java.util.Properties map;
      
      /** Creates a new instance of TypeNameMapImpl */
      public TypeNameMapImpl(java.util.Properties map) {
          this.map = map;
      }
      
      public String getTypeName(Class clasz) {
          if(clasz.isPrimitive()){
            if(clasz.equals(int.class)){
                clasz = Integer.class;
            }else if(clasz.equals(byte.class)){
                clasz = Byte.class;
            }else if(clasz.equals(short.class)){
                clasz = Short.class;
            }else if(clasz.equals(boolean.class)){
                clasz = Boolean.class;
            }else if(clasz.equals(char.class)){
                clasz = Character.class;
            }else if(clasz.equals(float.class)){
                clasz = Float.class;
            }else if(clasz.equals(long.class)){
                clasz = Long.class;
            }
          
          }
          return map.getProperty(clasz.getName());
      }
      
  }
  
  
  
  1.1                  jakarta-commons-sandbox/simplestore/src/jdbc/org/apache/commons/simplestore/jdbc/TypeNameMapImpl.properties
  
  Index: TypeNameMapImpl.properties
  ===================================================================
  # Sample ResourceBundle properties file
  java.lang.Integer=INT
  java.lang.Byte=INT
  java.lang.Short=INT
  java.lang.Character=CHAR(1)
  java.lang.Double=DOUBLE
  java.lang.Float=FLOAT
  java.lang.Boolean=INT
  java.lang.Long=BIGINT
  java.lang.String=LONGVARCHAR
  java.sql.Date=DATE
  java.util.Date=DATE
  
  
  
  
  
  
  1.30      +145 -156  jakarta-commons-sandbox/simplestore/src/test/org/apache/commons/simplestore/TestSample.java
  
  Index: TestSample.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/test/org/apache/commons/simplestore/TestSample.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- TestSample.java	20 May 2002 20:49:09 -0000	1.29
  +++ TestSample.java	25 May 2002 13:48:59 -0000	1.30
  @@ -57,8 +57,8 @@
   
   import org.apache.commons.simplestore.persistence.Transaction;
   import org.apache.commons.simplestore.persistence.PersistenceManager;
  -import org.apache.commons.simplestore.persistence.impl.DBPersistenceManagerFactory;
  -import org.apache.commons.simplestore.persistence.impl.JDBMPersistenceManagerFactory;
  +import org.apache.commons.simplestore.jdbc.DBPersistenceManagerFactory;
  +import org.apache.commons.simplestore.btree.JDBMPersistenceManagerFactory;
   import org.apache.commons.simplestore.persistence.ValidationException;
   
   
  @@ -72,13 +72,13 @@
   /**
    *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
    *      baliuka@mwm.lt</a>
  - *@version    $Id: TestSample.java,v 1.29 2002/05/20 20:49:09 baliuka Exp $
  + *@version    $Id: TestSample.java,v 1.30 2002/05/25 13:48:59 baliuka Exp $
    */
   public class TestSample extends TestCase implements org.apache.commons.simplestore.tools.Constants{
       
       
       
  -   protected PersistenceManager pm;
  +    protected PersistenceManager pm;
       
       public TestSample(String testName) {
           super(testName);
  @@ -92,38 +92,21 @@
           String[] testCaseName = {TestSample.class.getName()};
           junit.textui.TestRunner.main(testCaseName);
       }
  -    //TODO :
  -   
  -    public void _testMultithreaded() throws java.lang.Exception {
  -        
  -        for(int i=0; i< 16; i++ ){
  -            new Thread(
  -            new Runnable(){
  -                public void run(){
  -                   try{ 
  -                    testCreate();
  -                    testRetrieve();
  -                    testRollback();
  -                   }catch(Exception e){
  -                       e.printStackTrace();
  -                     throw new Error(e.getMessage());
  -                   }
  -                }
  -            }
  -            ).start();
  -        }
  -        
  -    }
  + 
  +    
       
       public void testCreate() throws java.lang.Exception {
  +        
           Transaction transaction = pm.getTransaction();
           try{
  -          
               transaction.begin();
  +            
               TestPersistentClassType object1 = (TestPersistentClassType) pm.createInstance(TestPersistentClassType.class);
               Object oid = pm.getOID(object1);
               object1.doSomething(object1.toString());
  +        
               transaction.commit();
  +        
               
               transaction.begin();
               TestPersistentClassType object2 = (TestPersistentClassType) pm.findInstance(TestPersistentClassType.class, oid);
  @@ -131,6 +114,7 @@
               
               transaction.begin();
               TestPersistentClassType object3 = (TestPersistentClassType) pm.createInstance(TestPersistentClassType.class);
  +            
               try{
                   
                   object3.setNuls();
  @@ -140,7 +124,8 @@
                   
               }
               object3.setDateVal(new java.util.Date());
  -            object3.setIntVal(8);
  +            object3.setIntVal(0);
  +            
               object3.setFloatVal(2f);
               object3.setStrVal1("Q");
               object3.setBoolVal(true);
  @@ -164,153 +149,157 @@
               
               assertTrue("Added object to Collection", object2.getChildren().size() == 2);
               
  -            transaction.commit();
  -            
  -          
  -        }catch( Exception e){
  -            e.printStackTrace();
  -            transaction.commit();
  -            throw (Exception)e.fillInStackTrace();
  -        }
  +        
  +        transaction.commit();
  +        
  +     
  +    }catch( Exception e){
  +        System.out.println("ERROR " + e.getClass() + "  " + e + " ITEST");
  +        e.printStackTrace();
  +        transaction.commit();
  +        throw (Exception)e.fillInStackTrace();
       }
  +}
  +
  +public void testRetrieve() throws java.lang.Exception {
  +    Transaction transaction = pm.getTransaction();
  +    transaction.begin();
       
  -    public void testRetrieve() throws java.lang.Exception {
  -        Transaction transaction = pm.getTransaction();
  -        transaction.begin();
  +    
  +    java.util.Set objects = pm.findAll(TestPersistentClassType.class);
  +    
  +    assertTrue("Cache findAll ", objects == pm.findAll(TestPersistentClassType.class) );
  +    
  +    java.util.Iterator it = objects.iterator();
  +    
  +    
  +    while (it.hasNext()) {
           
  +        TestPersistentClassType object = (TestPersistentClassType) it.next();
  +        object.toString();
  +        object.getBoolVal();
  +        object.getDateVal();
  +        object.getIntVal();
  +        object.getFloatVal();
  +        object.getStrVal1();
           
  -        java.util.Set objects = pm.findAll(TestPersistentClassType.class);
  -       
  -        assertTrue("Cache findAll ", objects == pm.findAll(TestPersistentClassType.class) );
  -        
  -        java.util.Iterator it = objects.iterator();
  -        
  -        
  -        while (it.hasNext()) {
  -            
  -            TestPersistentClassType object = (TestPersistentClassType) it.next();
  -            object.toString();
  -            object.getBoolVal();
  -            object.getDateVal();
  -            object.getIntVal();
  -            object.getFloatVal();
  -            object.getStrVal1();
  -            
  -            TestPersistentClassType parent = object.getParent();
  -            if(parent != null){ 
  -                java.util.Iterator iterator = parent.getChildren().iterator();
  -                boolean found = false;
  -                while(iterator.hasNext()){
  -                  Object next = iterator.next();  
  -                 if( next.equals(object) ){
  +        TestPersistentClassType parent = object.getParent();
  +        if(parent != null){
  +            java.util.Iterator iterator = parent.getChildren().iterator();
  +            boolean found = false;
  +            while(iterator.hasNext()){
  +                Object next = iterator.next();
  +                if( next.equals(object) ){
                       found = true;
  -                  }
  -               }
  -              assertTrue("Loop Collection",found );  
  +                }
               }
  -            
  +            assertTrue("Loop Collection",found );
           }
           
  -        
  -        
  -        transaction.commit();
  -        
       }
  -    public void testRollback() throws java.lang.Exception {
  -        
  -        
  -        Transaction transaction = pm.getTransaction();
  -        
  -        transaction.begin();
  -        java.util.Set objects = pm.findAll(TestPersistentClassType.class);
  -        transaction.commit();
  -        
  -        java.util.Iterator it = objects.iterator();
  -        
  -        while (it.hasNext()) {
  -            transaction.begin();
  -            TestPersistentClassType object = (TestPersistentClassType) it.next();
  -            String val = object.getStrVal();
  -            object.setStrVal("" + Math.random());
  -            transaction.rollback();
  -            transaction.begin();
  -            assertEquals("After rollback ", val, object.getStrVal());
  -            transaction.commit();
  -        }
  -        
  -        
  -        
  -        
  -        transaction.begin();
  -        TestPersistentClassType child = (TestPersistentClassType) pm.createInstance(TestPersistentClassType.class);
  -        TestPersistentClassType parent = (TestPersistentClassType) pm.createInstance(TestPersistentClassType.class);
  -        transaction.commit();
  -        
  -        java.util.Collection children = parent.getChildren();
  -        
  -        transaction.begin();
  -        
  -        child.setParent(parent);
  -        
  -        transaction.rollback();
  -        
  -        assertEquals( "Roolback collection ", 0, children.size() );
  -        
  -        
  -        
  -        transaction.begin();
  -        TestPersistentClassType object = (TestPersistentClassType) pm.createInstance(TestPersistentClassType.class);
  -        object.setStrVal("Test roolback on new created " + object);
  -        transaction.rollback();
  -        
  -        transaction.begin();
  -        try{
  -            object.getStrVal();
  -            fail("Exception expected " + object);
  -        }catch( Exception e ){
  -            
  -        }
  -        transaction.commit();
  -        
  -        transaction.begin();
  -        object = (TestPersistentClassType) pm.createInstance(TestPersistentClassType.class);
  -        object.setIntVal(777);
  -        transaction.commit();
  -        
  +    
  +    
  +    
  +    transaction.commit();
  +    
  +}
  +public void testRollback() throws java.lang.Exception {
  +    
  +    
  +    Transaction transaction = pm.getTransaction();
  +    
  +    transaction.begin();
  +    java.util.Set objects = pm.findAll(TestPersistentClassType.class);
  +    transaction.commit();
  +    
  +    java.util.Iterator it = objects.iterator();
  +    
  +    while (it.hasNext()) {
           transaction.begin();
  -        pm.removeInstance(object);
  +        TestPersistentClassType object = (TestPersistentClassType) it.next();
  +        String val = object.getStrVal();
  +        object.setStrVal("" + Math.random());
           transaction.rollback();
  -        
           transaction.begin();
  -        assertEquals( object + " Not modified ", 777, object.getIntVal() );
  +        assertEquals("After rollback ", val, object.getStrVal());
           transaction.commit();
  -        
  -        
  -        
       }
       
       
       
  -    protected void setUp() throws java.lang.Exception {
  -        super.setUp();
  -        
  -        if(true){
  -            DBPersistenceManagerFactory factory = new DBPersistenceManagerFactory();
  -            factory.setDriver("org.hsqldb.jdbcDriver");
  -            factory.setUrl("jdbc:hsqldb:sample");
  -            factory.setUser("sa");
  -            factory.setPassword("");
  -            factory.setMaxConnections(1);
  -            factory.setMetaResource("org/apache/commons/simplestore/storage.xml");
  -            pm = factory.getPersistenceManager();
  -        }else{
  -            JDBMPersistenceManagerFactory factory = new JDBMPersistenceManagerFactory();
  -            factory.setFile("sample");
  -            factory.setMetaResource("org/apache/commons/simplestore/storage.xml");
  -            pm = factory.getPersistenceManager();
  -        }
  +    
  +    transaction.begin();
  +    TestPersistentClassType child = (TestPersistentClassType) pm.createInstance(TestPersistentClassType.class);
  +    TestPersistentClassType parent = (TestPersistentClassType) pm.createInstance(TestPersistentClassType.class);
  +    transaction.commit();
  +    
  +    java.util.Collection children = parent.getChildren();
  +    
  +    transaction.begin();
  +    
  +    child.setParent(parent);
  +    
  +    transaction.rollback();
  +    
  +    assertEquals( "Roolback collection ", 0, children.size() );
  +    
  +    
  +    
  +    transaction.begin();
  +    TestPersistentClassType object = (TestPersistentClassType) pm.createInstance(TestPersistentClassType.class);
  +    object.setStrVal("Test roolback on new created " + object);
  +    transaction.rollback();
  +    
  +    transaction.begin();
  +    try{
  +        object.getStrVal();
  +        fail("Exception expected " + object);
  +    }catch( Exception e ){
           
       }
  +    transaction.commit();
  +    
  +    transaction.begin();
  +    object = (TestPersistentClassType) pm.createInstance(TestPersistentClassType.class);
  +    object.setIntVal(777);
  +    transaction.commit();
  +    
  +    transaction.begin();
  +    pm.removeInstance(object);
  +    transaction.rollback();
  +    
  +    transaction.begin();
  +    assertEquals( object + " Not modified ", 777, object.getIntVal() );
  +    transaction.commit();
       
  +    
  +    
  +}
  +
  +
  +
  +protected void setUp() throws java.lang.Exception {
  +    super.setUp();
  +    
  +    if(true){
  +        DBPersistenceManagerFactory factory = new DBPersistenceManagerFactory();
  +        factory.setDriver("org.hsqldb.jdbcDriver");
  +        factory.setUrl("jdbc:hsqldb:sample");
  +        factory.setUser("sa");
  +        factory.setPassword("");
  +        factory.setMaxConnections(1);
  +        factory.setMetaResource("org/apache/commons/simplestore/storage.xml");
  +        factory.setMaxStrongRef(1000);
  +        pm = factory.getPersistenceManager();
  +        
  +    }else{
  +        JDBMPersistenceManagerFactory factory = new JDBMPersistenceManagerFactory();
  +        factory.setFile("sample");
  +        factory.setMetaResource("org/apache/commons/simplestore/storage.xml");
  +        pm = factory.getPersistenceManager();
  +    }
  +    
  +}
  +
   }
   
  
  
  
  1.3       +27 -1     jakarta-commons-sandbox/simplestore/src/test/org/apache/commons/simplestore/TestXmlDbStorage.java
  
  Index: TestXmlDbStorage.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/test/org/apache/commons/simplestore/TestXmlDbStorage.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestXmlDbStorage.java	20 May 2002 20:49:09 -0000	1.2
  +++ TestXmlDbStorage.java	25 May 2002 13:48:59 -0000	1.3
  @@ -64,11 +64,36 @@
   /**
    *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
    *      baliuka@mwm.lt</a>
  - *@version    $Id: TestXmlDbStorage.java,v 1.2 2002/05/20 20:49:09 baliuka Exp $
  + *@version    $Id: TestXmlDbStorage.java,v 1.3 2002/05/25 13:48:59 baliuka Exp $
    */
   public class TestXmlDbStorage extends TestSample {
       
       
  +    public void _testMultithreaded() throws java.lang.Exception {
  +        Thread tr = null;
  +        for(int i=0; i< 4; i++ ){
  +            
  +          (tr =  new Thread(
  +            new Runnable(){
  +                public void run(){
  +                   try{ 
  +                 int id =  Thread.currentThread().hashCode();     
  +             
  +                    testCreate();
  +                    testRetrieve();
  +                    testRollback();
  +                
  +                   }catch(Exception e){
  +                       e.printStackTrace();
  +                     throw new Error(e.getMessage());
  +                   }
  +                }
  +            }
  +            )).start();
  +        }
  +       tr.join();  
  +     
  +    }
       
     
       
  @@ -92,6 +117,7 @@
               factory.setUrl("xmldb:xindice:///db/addressbook");
               factory.setRootNode("document");
               factory.setMetaResource("org/apache/commons/simplestore/storage.xml");
  +            factory.setMaxStrongRef(1000);
               pm = factory.getPersistenceManager();
        
       }
  
  
  
  1.5       +7 -8      jakarta-commons-sandbox/simplestore/src/xmldb/org/apache/commons/simplestore/xmldb/XmlDbStorage.java
  
  Index: XmlDbStorage.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/xmldb/org/apache/commons/simplestore/xmldb/XmlDbStorage.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XmlDbStorage.java	20 May 2002 20:49:09 -0000	1.4
  +++ XmlDbStorage.java	25 May 2002 13:48:59 -0000	1.5
  @@ -85,7 +85,7 @@
   /**
    *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
    *      baliuka@mwm.lt</a>
  - *@version    $Id: XmlDbStorage.java,v 1.4 2002/05/20 20:49:09 baliuka Exp $
  + *@version    $Id: XmlDbStorage.java,v 1.5 2002/05/25 13:48:59 baliuka Exp $
    */
   
   
  @@ -188,7 +188,7 @@
               
               MetaClass mClass = context.getMetaClass(clasz);
               
  -            String xpath = "/"+ getRootNode()+ "/descendant-or-self::" + context.getMetaClass(clasz).getName() ;
  +            String xpath = "/" + getRootNode()+ "/descendant-or-self::" + context.getMetaClass(clasz).getName() ;
               Collection cl =  getCollection();
               
               XPathQueryService service =
  @@ -290,6 +290,7 @@
                   
                   XUpdateQueryService   service =(XUpdateQueryService) cl.
                   getService("XUpdateQueryService", "1.0");
  +                
                   service.update(BEGIN_XUPDATE + updateBuff.toString() + END_XUPDATE);
                   TransactionService transaction =
                   (TransactionService) context.getTransactionManager().
  @@ -380,17 +381,15 @@
           
       }
       
  -    public Object retrieveObject( final Class clasz, Object id ) throws StorageException {
  +    public Object retrieveObjectInternal( final Class clasz, Object id ) throws StorageException {
  +        
           java.util.Set objects = new java.util.HashSet();
            MetaClass mClass = context.getMetaClass(clasz);
  -         String xpath = "/"+ getRootNode() + "/descendant-or-self::"+ context.getMetaClass(clasz).getName() + "[@" +
  +         String xpath = "/" + getRootNode() + "/descendant-or-self::"+ context.getMetaClass(clasz).getName() + "[@" +
               mClass.getOIDName() + "='" + id + "']";
              
           try{
               
  -           
  -            
  -            
               
               Collection cl =  getCollection();
               
  @@ -422,7 +421,7 @@
           if(objects.size() != 1 ){
               throw new StorageException("dublicate object",null);
           }
  -        
  +  
           return objects.iterator().next();
       }
       
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message