baliuka     02/05/11 09:48:16

  Modified:    simplestore build.xml
               simplestore/src/java/org/apache/commons/simplestore/persistence/impl
                        PersistentProxy.java
               simplestore/src/test/org/apache/commons/simplestore
                        TestSample.java
  Added:       simplestore/src/block/org/apache/commons/simplestore/block
                        AbstractConfigurable.java
                        DBPersistenceFactoryImpl.java
                        DBPersistenceFactoryImpl.xinfo
                        PersistenceFactoryImpl.java
               simplestore/src/block/org/apache/commons/simplestore/service
                        PersistenceFactory.java
  Log:
  Implemented block for Phoenix
  
  Revision  Changes    Path
  1.24      +103 -92   jakarta-commons-sandbox/simplestore/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/build.xml,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- build.xml 8 May 2002 18:04:48 -0000       1.23
  +++ build.xml 11 May 2002 16:48:15 -0000      1.24
  @@ -1,13 +1,11 @@
  -<project name="simplestore" default="compile" basedir=".">
  +<?xml version="1.0" encoding="UTF-8"?>
  +<project basedir="." default="compile" name="simplestore">
   
  -<!--
  -        "simplestore" component of the Jakarta Commons Subproject
  -        $Id: build.xml,v 1.23 2002/05/08 18:04:48 baliuka Exp $
  --->
  +<!--         "simplestore" component of the Jakarta Commons Subproject         $Id: 
build.xml,v 1.24 2002/05/11 16:48:15 baliuka Exp $ -->
   
   <!-- ========== Executable Targets ======================================== -->
   
  -  <target name="init" description="Initialize and evaluate conditionals">
  +  <target description="Initialize and evaluate conditionals" name="init">
   
       <!-- read properties from the build.properties, if any -->
       <property name="component-propfile" value="${basedir}/build.properties"/>
  @@ -26,18 +24,24 @@
       <property name="commons-collections.home" value="../collections/dist"/>
       <property name="commons-collections.jar" 
value="${commons-collections.home}/commons-collections.jar"/>
   
  -    <property name="component.name"          value="simplestore"/>
  -    <property name="component.package"       
value="org.apache.commons.simplestore"/>
  -    <property name="component.title"         value="simplestore components"/>
  -    <property name="component.version"       value="1.0-dev"/>
  -    <property name="build.home"              value="build"/>
  -    <property name="dist.home"               value="dist"/>
  -    <property name="source.home"             value="src/java"/>
  -    <property name="source.test"             value="src/test"/>
  -  
  -    <property name="compile.debug"           value="true"/>
  -    <property name="compile.deprecation"     value="true"/>
  -    <property name="compile.optimize"        value="true"/>
  +    <property name="component.name" value="simplestore"/>
  +    <property name="component.package" value="org.apache.commons.simplestore"/>
  +    <property name="component.title" value="simplestore components"/>
  +    <property name="component.version" value="1.0-dev"/>
  +
  +    <property name="build.home" value="build/core"/>
  +    <property name="block.build.home" value="build/block"/>
  +    <property name="test.build.home" value="build/test"/>
  +
  +    <property name="dist.home" value="dist"/>
  +    <property name="source.home" value="src/java"/>
  +    <property name="source.test" value="src/test"/>
  +    <property name="block.home" value="src/block"/>
  +
  +  
  +    <property name="compile.debug" value="true"/>
  +    <property name="compile.deprecation" value="true"/>
  +    <property name="compile.optimize" value="true"/>
   
       <path id="compile.classpath">
         <pathelement location="${build.home}/classes"/>
  @@ -56,86 +60,100 @@
       <property name="cp" value=""/>
       <property name="classpath" 
value="${cp}:${junit.jar}:${hsqldb.jar}:${jdbc2_0-stdext.jar}:${bcel.jar}"/>
       <property name="test.entry" value="org.apache.commons.simplestore.TestAll"/>
  -    <property name="test.failonerror"        value="true"/>
  -    <property name="test.runner"             value="junit.textui.TestRunner"/>
  +    <property name="test.failonerror" value="true"/>
  +    <property name="test.runner" value="junit.textui.TestRunner"/>
   
       <echo message="-------- ${component.name} ${component.version} --------"/>
     </target>
   
  -  <target name="prepare" depends="init"
  -    description="Prepare build directory">
  +  <target depends="init" description="Prepare build directory" name="prepare">
       <mkdir dir="${build.home}"/>
       <mkdir dir="${build.home}/classes"/>
       <mkdir dir="${build.home}/conf"/>
  +    <mkdir dir="${block.build.home}"/>
  +    <mkdir dir="${block.build.home}/classes"/>
  +    <mkdir dir="${block.build.home}/conf"/>
  +    <mkdir dir="${test.build.home}/classes"/>
  +    <mkdir dir="${test.build.home}/conf"/>
  + 
     </target>
   
  -  <target name="compile" depends="prepare" description="Compile shareable 
components">
  -    <javac  srcdir="${source.home}"
  -            destdir="${build.home}/classes"
  -            debug="${compile.debug}"
  -            deprecation="${compile.deprecation}"
  -            optimize="${compile.optimize}">
  +  <target depends="prepare" description="Compile shareable components" 
name="compile">
  +    <javac debug="${compile.debug}" deprecation="${compile.deprecation}" 
destdir="${build.home}/classes" optimize="${compile.optimize}" srcdir="${source.home}">
         <classpath refid="compile.classpath"/>
       </javac>
     </target>
   
  -  <target name="clean" depends="init"
  -   description="Clean build and distribution directories">
  -    <delete    dir="${build.home}"/>
  -    <delete    dir="${dist.home}"/>
  -  </target>
  -
  -  <target name="all" depends="clean,compile"
  -   description="Clean and compile all components"/>
  -
  -  <target name="javadoc" depends="compile"
  -   description="Create component Javadoc documentation">
  -    <mkdir      dir="${dist.home}"/>
  -    <mkdir      dir="${dist.home}/docs"/>
  -    <mkdir      dir="${dist.home}/docs/api"/>
  -    <javadoc sourcepath="${source.home}"
  -                destdir="${dist.home}/docs/api"
  -           packagenames="org.apache.commons.*"
  -                 author="true"
  -                private="true"
  -                version="true"
  -               doctitle="&lt;h1&gt;${component.title}&lt;/h1&gt;"
  -            windowtitle="${component.title} (Version ${component.version})"
  -                 bottom="Copyright (c) 2001 - Apache Software Foundation"/>
  -  </target>
  -
  -  <target name="dist" depends="compile"
  -   description="Create binary distribution">
  -    <mkdir      dir="${dist.home}"/>
  -    <copy      file="../LICENSE"
  -              todir="${dist.home}"/>
  -
  -    <jar    jarfile="${dist.home}/commons-${component.name}.jar"
  -            basedir="${build.home}/classes"
  -           manifest="src/conf/MANIFEST.MF">
  +  <target depends="init" description="Clean build and distribution directories" 
name="clean">
  +    <delete dir="${build.home}"/>
  +    <delete dir="${dist.home}"/>
  +  </target>
  +
  +  <target depends="clean,compile" description="Clean and compile all components" 
name="all"/>
  +
  +  <target depends="compile" description="Create component Javadoc documentation" 
name="javadoc">
  +    <mkdir dir="${dist.home}"/>
  +    <mkdir dir="${dist.home}/docs"/>
  +    <mkdir dir="${dist.home}/docs/api"/>
  +    <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">
  +    <mkdir dir="${dist.home}"/>
  +    <copy file="../LICENSE" todir="${dist.home}"/>
  +
  +    <jar basedir="${build.home}/classes" 
jarfile="${dist.home}/commons-${component.name}.jar" manifest="src/conf/MANIFEST.MF">
  +      <include name="org/apache/commons/simplestore/**"/>
  +    </jar>    
  +  </target>
  +
  + <target depends="compile"
  +         description="Compile shareable components" 
  +         name="compile-block">
  +    <javac debug="${compile.debug}" 
  +           deprecation="${compile.deprecation}" 
  +           destdir="${block.build.home}/classes" 
  +           optimize="${compile.optimize}" 
  +           srcdir="${block.home}">
  +      <classpath refid="compile.classpath"/>
  +    </javac>
  +  </target>
  +
  +
  + <target depends="compile-block" description="Create binary distribution" 
name="block">
  +   <mkdir dir="${dist.home}"/> 
  +  <copy todir="${block.build.home}/classes" >
  +    <fileset dir="${source.test}" >
  +      <include name="**/*.xinfo"/>
  +    </fileset>
  +  </copy>
  +  
  +    <jar basedir="${block.build.home}/classes" 
jarfile="${dist.home}/commons-${component.name}-block.jar" 
manifest="src/conf/MANIFEST.MF">
         <include name="org/apache/commons/simplestore/**"/>
       </jar>    
     </target>
     
  -  <target name="build-test" depends="compile">
  -    <javac srcdir="${source.test}"
  -           destdir="${build.home}/classes"
  -           debug="${compile.debug}"
  -           deprecation="${compile.deprecation}"
  -           optimize="${compile.optimize}">
  +  
  +  <target depends="compile" name="build-test">
  +    <javac debug="${compile.debug}" 
  +           deprecation="${compile.deprecation}" 
  +           destdir="${test.build.home}/classes" 
  +           optimize="${compile.optimize}" 
  +           srcdir="${source.test}" >
  +
      <classpath refid="compile.classpath"/>
      </javac>
  +  
  +  <copy todir="${test.build.home}/classes" >
  +    <fileset dir="${source.test}" >
  +      <include name="**/*.xml"/>
  +    </fileset>
  +  </copy>
  +
     </target>
   
   <target name="create-test-table">
  -<sql
  -    driver="org.hsqldb.jdbcDriver"
  -    url="jdbc:hsqldb:sample"
  -    userid="sa"
  -    password=""
  -    onerror="continue"
  -  
  -   >
  +<sql driver="org.hsqldb.jdbcDriver" onerror="continue" password="" 
url="jdbc:hsqldb:sample" userid="sa">
         <classpath>
             <fileset dir="./lib">
                <include name="*.*"/>
  @@ -148,14 +166,7 @@
   </target>
   
   <target name="drop-test-table">
  -<sql
  -    driver="org.hsqldb.jdbcDriver"
  -    url="jdbc:hsqldb:sample"
  -    userid="sa"
  -    password=""
  -    onerror="continue"
  -
  -   >
  +<sql driver="org.hsqldb.jdbcDriver" onerror="continue" password="" 
url="jdbc:hsqldb:sample" userid="sa">
         <classpath>
             <fileset dir="./lib">
                <include name="*.*"/>
  @@ -167,18 +178,18 @@
   </target>
   
     
  -  <target name="test" depends="build-test" description="runs (junit) unit tests">
  -    <java classname="${test.runner}" fork="yes" failonerror="${test.failonerror}" 
  -     maxmemory="${maxmemory}">
  +  <target depends="build-test" description="runs (junit) unit tests" name="test">
  +    <java classname="${test.runner}" failonerror="${test.failonerror}" fork="yes" 
maxmemory="${maxmemory}">
     <!-- jvmarg value="-Xrunhprof:cpu=times,file=debug.txt" / -->
  -  <!-- jvmarg value="-verbose:gc" / --> 
  +  <jvmarg value="-verbose:gc" /> 
     <!-- jvmarg value="-verbose:class" / --> 
  -     <sysproperty key="DEBUG" value="false"/> 
  +     <sysproperty key="DEBUG" value="true"/> 
         <arg value="${test.entry}"/>
           <classpath>
  -          <pathelement path=" ${build.home}/classes" />
  -          <pathelement path="${classpath}" />
  -          <pathelement path="${java.class.path}" />
  +          <pathelement path="${build.home}/classes"/>
  +          <pathelement path="${test.build.home}/classes"/>
  +          <pathelement path="${classpath}"/>
  +          <pathelement path="${java.class.path}"/>
             <pathelement path="${source.test}"/>
             <fileset dir="./lib">
                <include name="*.*"/>
  
  
  
  1.1                  
jakarta-commons-sandbox/simplestore/src/block/org/apache/commons/simplestore/block/AbstractConfigurable.java
  
  Index: AbstractConfigurable.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 [EMAIL PROTECTED]
   *
   * 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.block;
  
  import java.beans.*;
  
  
  import org.apache.avalon.framework.configuration.Configurable;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.phoenix.Block;
  
  
  
  /**
   * Phoenix Block implementation of the PersistenceFactory service.
   *
   * @author <a href="mailto:[EMAIL PROTECTED]";>Juozas Baliuka</a>
   */
  public abstract class AbstractConfigurable  extends AbstractLogEnabled
                           implements Block, Configurable {
      
     
     
                               
      public void dispose() {
          
      }
      
      public void configure( Configuration configuration )
       throws ConfigurationException {
         try{ 
          Configuration [] properties = configuration.getChildren();
          java.util.Map map = new java.util.HashMap();
          
          for(int i=0; i < properties.length; i++ ){
              map.put(properties[i].getName(), properties[i].getValue());
          }
          
          BeanInfo info = Introspector.getBeanInfo(this.getClass());
          PropertyDescriptor[] descriptors = info.getPropertyDescriptors();
          
          for( int i = 0; i < descriptors.length; i++ ){
              String value = (String)map.get( descriptors[i].getName() );
              if( value != null ){
                  descriptors[i].getWriteMethod().invoke(this,new Object[]{
                      
                      parse( descriptors[i].getPropertyType(),value )
                      
                  });
              }
              
          }
         }catch(Exception e){
          e.printStackTrace();
          throw new ConfigurationException(e.getMessage());
         }
          
      }
      
      
      public static Character valueOf(String str){
          return new Character(str.charAt(0));
      }
      public static Class classValue(String str)throws ClassNotFoundException{
          return Class.forName( str,  true, 
                    AbstractConfigurable.class.getClassLoader()
                 );
      }
      
      public static Object parse(Class type,String data){
          try{
              java.lang.reflect.Method valueOf = 
(java.lang.reflect.Method)parsers.get(type);
              if(valueOf == null)
                  throw new IllegalArgumentException("Unsuppoted attribute type " + 
type.getName());
              
              return valueOf.invoke(null,new Object[]{data});
              
          }catch(Exception e){
              e.printStackTrace();
              throw new IllegalArgumentException(e.getMessage());
          }
          
      }
      
      
      static Class[] strParam = new Class[]{String.class};
      static java.util.Map parsers = new java.util.HashMap();
      static{
          try{
              
              parsers.put( Float.TYPE, Float.class.getMethod("valueOf", strParam) );
              parsers.put( Double.TYPE, Double.class.getMethod("valueOf", strParam) );
              parsers.put( Byte.TYPE, Byte.class.getMethod("valueOf", strParam) );
              parsers.put( Boolean.TYPE, Boolean.class.getMethod("valueOf", strParam) 
);
              parsers.put( Integer.TYPE, Integer.class.getMethod("valueOf", strParam) 
);
              parsers.put( Long.TYPE, Long.class.getMethod("valueOf", strParam) );
              parsers.put( Character.TYPE , 
AbstractConfigurable.class.getMethod("valueOf",strParam) );
              parsers.put( Float.class, Float.class.getMethod("valueOf", strParam) );
              parsers.put( Double.class, Double.class.getMethod("valueOf", strParam) );
              parsers.put( Byte.class, Byte.class.getMethod("valueOf", strParam) );
              parsers.put( Boolean.class, Boolean.class.getMethod("valueOf", strParam) 
);
              parsers.put( Integer.class, Integer.class.getMethod("valueOf", strParam) 
);
              parsers.put( Long.class, Long.class.getMethod("valueOf", strParam) );
              parsers.put( Character.class, 
AbstractConfigurable.class.getMethod("valueOf", strParam) );
              parsers.put( String.class, String.class.getMethod("valueOf", new 
Class[]{Object.class}) );
              parsers.put( Class.class, 
AbstractConfigurable.class.getMethod("classValue", strParam) ); 
              
              
          }catch(Exception e){
              
              throw new Error(e.getClass().getName() +":"+ e.getMessage());
              
          }
          
      }
      
      
  }
  
  
  
  
  1.1                  
jakarta-commons-sandbox/simplestore/src/block/org/apache/commons/simplestore/block/DBPersistenceFactoryImpl.java
  
  Index: DBPersistenceFactoryImpl.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 [EMAIL PROTECTED]
   *
   * 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.block;
  
  import org.apache.commons.simplestore.persistence.PersistenceManager;
  import org.apache.commons.simplestore.persistence.impl.DBPersistenceManagerFactory;
  /**
   * Block implementation of the PersistenceFactory service. 
   *
   * @author <a href="mailto:[EMAIL PROTECTED]";>Juozas Baliuka</a>
   */
  public class DBPersistenceFactoryImpl extends PersistenceFactoryImpl{
      
   DBPersistenceManagerFactory factory = new DBPersistenceManagerFactory();    
      /** Creates a new instance of DBPersistenceFactoryImpl */
      public DBPersistenceFactoryImpl() {
      }
      
      public PersistenceManager getPersistenceManager() {
          return factory.getPersistenceManager();
      }
     
      /** Getter for property user.
       * @return Value of property user.
       */
      public String getUser() {
          return factory.getUser();
      }
      
      /** Setter for property user.
       * @param user New value of property user.
       */
      public void setUser(String user) {
          factory.setUser( user );
      }
      
      /** Getter for property password.
       * @return Value of property password.
       */
      public String getPassword() {
          return factory.getPassword();
      }
      
      /** Setter for property password.
       * @param password New value of property password.
       */
      public void setPassword(String password) {
          factory.setPassword( password );
      }
      
      /** Getter for property driver.
       * @return Value of property driver.
       */
      public String getDriver() {
          return factory.getDriver();
      }
      
      /** Setter for property driver.
       * @param driver New value of property driver.
       */
      public void setDriver(String driver) {
          factory.setDriver(driver);
      }
      
      /** Getter for property maxConnections.
       * @return Value of property maxConnections.
       */
      public int getMaxConnections() {
          return factory.getMaxConnections();
      }
      
      /** Setter for property maxConnections.
       * @param maxConnections New value of property maxConnections.
       */
      public void setMaxConnections(int maxConnections) {
          factory.setMaxConnections(maxConnections);
      }
      
      /** Getter for property url.
       * @return Value of property url.
       */
      public String getUrl() {
          return factory.getUrl();
      }
      
      /** Setter for property url.
       * @param url New value of property url.
       */
      public void setUrl(String url) {
          factory.setUrl( url );
      }
      
      /** Getter for property loader.
       * @return Value of property loader.
       */
      public ClassLoader getLoader() {
          return factory.getLoader();
      }
      
      /** Setter for property loader.
       * @param loader New value of property loader.
       */
      public void setLoader(ClassLoader loader) {
          factory.setLoader(loader);
      }
      
      /** Getter for property metaResource.
       * @return Value of property metaResource.
       */
      public String getMetaResource() {
          return factory.getMetaResource();
      }
      
      /** Setter for property metaResource.
       * @param metaResource New value of property metaResource.
       */
      public void setMetaResource(String metaResource) {
          factory.setMetaResource ( metaResource);
      }
      
      /** Getter for property maxStrongRef.
       * @return Value of property maxStrongRef.
       */
      public int getMaxStrongRef() {
          return factory.getMaxStrongRef();
      }
      
      /** Setter for property maxStrongRef.
       * @param maxStrongRef New value of property maxStrongRef.
       */
      public void setMaxStrongRef(int maxStrongRef) {
          factory.setMaxStrongRef( maxStrongRef );
      }
      
  }
  
  
  
  1.1                  
jakarta-commons-sandbox/simplestore/src/block/org/apache/commons/simplestore/block/DBPersistenceFactoryImpl.xinfo
  
  Index: DBPersistenceFactoryImpl.xinfo
  ===================================================================
  <?xml version="1.0"?> 
  <!DOCTYPE blockinfo PUBLIC "-//PHOENIX/Block Info DTD Version 1.0//EN" 
                    "http://jakarta.apache.org/phoenix/blockinfo_1_0.dtd";>
   
  <blockinfo> 
  
    <!-- section to describe block -->
    <block>
      <version>1.0</version>
    </block>
  
    <!-- services that are offered by this block --> 
    <services> 
      <service name="org.apache.commons.simplestore.block.DBPersistenceFactoryImpl"
           version="1.0" /> 
      </services> 
   
  </blockinfo> 
  
  
  
  1.1                  
jakarta-commons-sandbox/simplestore/src/block/org/apache/commons/simplestore/block/PersistenceFactoryImpl.java
  
  Index: PersistenceFactoryImpl.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 [EMAIL PROTECTED]
   *
   * 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.block;
  
  
  import org.apache.avalon.framework.configuration.Configurable;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.phoenix.Block;
  
  import org.apache.commons.simplestore.service.PersistenceFactory;
  import org.apache.commons.simplestore.persistence.PersistenceManager;
  
  /**
   * Block implementation of the PersistenceFactory service. 
   *
   * @author <a href="mailto:[EMAIL PROTECTED]";>Juozas Baliuka</a>
   */
  public abstract class PersistenceFactoryImpl extends AbstractConfigurable 
             implements Block,  PersistenceFactory
  {
   
    abstract public PersistenceManager getPersistenceManager();                        
    
     
  }
  
  
  
  
  1.1                  
jakarta-commons-sandbox/simplestore/src/block/org/apache/commons/simplestore/service/PersistenceFactory.java
  
  Index: PersistenceFactory.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 [EMAIL PROTECTED]
   *
   * 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.service;
  
  import org.apache.commons.simplestore.persistence.PersistenceManagerFactory;
  
  /**
   * PersistenceFactory service. 
   *
   * @author <a href="mailto:[EMAIL PROTECTED]";>Juozas Baliuka</a>
   */
  
  
  public interface PersistenceFactory extends  PersistenceManagerFactory {
      
    public static final String ROLE = PersistenceFactory.class.getName();
  
    public org.apache.commons.simplestore.persistence.PersistenceManager 
getPersistenceManager();
    
  }
  
  
  
  1.32      +2 -2      
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.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- PersistentProxy.java      9 May 2002 17:02:39 -0000       1.31
  +++ PersistentProxy.java      11 May 2002 16:48:15 -0000      1.32
  @@ -77,11 +77,11 @@
    *      [EMAIL PROTECTED]</a>
    *@author     Gerhard Froehlich <a href="mailto:[EMAIL PROTECTED]";>
    *      [EMAIL PROTECTED]</a>
  - *@version    $Id: PersistentProxy.java,v 1.31 2002/05/09 17:02:39 baliuka Exp $
  + *@version    $Id: PersistentProxy.java,v 1.32 2002/05/11 16:48:15 baliuka Exp $
    */
   public class PersistentProxy
   implements MetaObject,  org.apache.commons.simplestore.tools.Constants ,
  -MethodInterceptor,Cloneable, Serializable {
  +MethodInterceptor,Cloneable {
       
       private static Method HASH_CODE;
       private static Method EQUALS;
  
  
  
  1.24      +3 -7      
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.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- TestSample.java   9 May 2002 17:02:39 -0000       1.23
  +++ TestSample.java   11 May 2002 16:48:16 -0000      1.24
  @@ -72,7 +72,7 @@
   /**
    *@author     Juozas Baliuka <a href="mailto:[EMAIL PROTECTED]";>
    *      [EMAIL PROTECTED]</a>
  - *@version    $Id: TestSample.java,v 1.23 2002/05/09 17:02:39 baliuka Exp $
  + *@version    $Id: TestSample.java,v 1.24 2002/05/11 16:48:16 baliuka Exp $
    */
   public class TestSample extends TestCase implements 
org.apache.commons.simplestore.tools.Constants{
       
  @@ -117,8 +117,7 @@
                   fail("ValidationException expected");
                   
               }catch(ValidationException ve){
  -                if(DEBUG)
  -                    ve.printStackTrace();
  +                
               }
               object3.setDateVal(new java.util.Date());
               object3.setIntVal(i);
  @@ -157,8 +156,6 @@
           
           assertTrue("Cache findAll ", objects == 
pm.findAll(TestPersistentClassType.class) );
           
  -       if( DEBUG )
  -        System.out.println("retrieved " + objects.size());
           java.util.Iterator i = objects.iterator();
           
           while (i.hasNext()) {
  @@ -212,8 +209,7 @@
               object.getStrVal();
               fail("Exception expected " + object);
           }catch( Exception e ){
  -            if(DEBUG)
  -                e.printStackTrace();
  +            
           }
           transaction.commit();
           
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to