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/java/org/apache/commons/simplestore/tools Enhancer.java
Date Fri, 17 May 2002 22:20:52 GMT
baliuka     02/05/17 15:20:52

  Modified:    simplestore/src/java/org/apache/commons/simplestore/persistence/impl
                        AbstractStorage.java
                        DBPersistenceManagerFactory.java
                        PersistentProxy.java TransactionImpl.java
               simplestore/src/java/org/apache/commons/simplestore/tools
                        Enhancer.java
  Log:
  
  
  Revision  Changes    Path
  1.14      +14 -4     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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- AbstractStorage.java	12 May 2002 11:40:02 -0000	1.13
  +++ AbstractStorage.java	17 May 2002 22:20:51 -0000	1.14
  @@ -71,7 +71,7 @@
   /**
    *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
    *      baliuka@mwm.lt</a>
  - *@version    $Id: AbstractStorage.java,v 1.13 2002/05/12 11:40:02 baliuka Exp $
  + *@version    $Id: AbstractStorage.java,v 1.14 2002/05/17 22:20:51 baliuka Exp $
    */
   
   public abstract class AbstractStorage
  @@ -119,6 +119,10 @@
         
       }
       
  +    public void add(Object key,java.util.Collection obj) {
  +           throw new java.lang.NoSuchMethodError(); 
  +    }  
  +    
       public void rollback(Set objects) {
           try {
         
  @@ -168,7 +172,9 @@
           
       }
   
  -    public abstract void storeObject(MetaObject properties) throws StorageException;  
  +    public   abstract void storeObject(MetaObject properties) throws StorageException;
 
  +    
  +    public    abstract void enumerateInternal(final Class clasz, Set objects, final EnumeratorCallback
callback) throws StorageException ;
       
       protected abstract void createObject(MetaObject properties) throws StorageException;
       
  @@ -179,6 +185,10 @@
       protected abstract void internalRollback() throws StorageException;
       
       protected abstract void internalBegin() throws StorageException;
  +    
  +    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{
       
  @@ -222,7 +232,7 @@
       
       }
       
  -    public abstract void retrieveInternal(Class clasz, int index, Object value,java.util.Set
objects)throws StorageException; 
  +    
       
       public java.util.Collection getTransactionalObjects() {
           throw new java.lang.NoSuchMethodError();
  @@ -245,7 +255,7 @@
           enumerateInternal(clasz,objects,callback);
        }
      
  -     abstract public void enumerateInternal(final Class clasz, Set objects, final EnumeratorCallback
callback) throws StorageException ;
  +    
       
       public void setContext(Context context) {
           this.context = context;
  
  
  
  1.2       +1 -7      jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/impl/DBPersistenceManagerFactory.java
  
  Index: DBPersistenceManagerFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/impl/DBPersistenceManagerFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DBPersistenceManagerFactory.java	24 Mar 2002 06:27:35 -0000	1.1
  +++ DBPersistenceManagerFactory.java	17 May 2002 22:20:51 -0000	1.2
  @@ -56,15 +56,9 @@
   
   import org.apache.commons.simplestore.persistence.PersistenceManagerFactory;
   import org.apache.commons.simplestore.persistence.PersistenceManager;
  -import org.apache.commons.simplestore.persistence.impl.PersistenceManagerImpl;
   import org.apache.commons.simplestore.persistence.SimplestoreException;
   import org.apache.commons.simplestore.jdbc.DriverDataSource;
   import org.apache.commons.simplestore.persistence.Transaction;
  -import org.apache.commons.simplestore.persistence.impl.DBStorage;
  -import org.apache.commons.simplestore.persistence.impl.ContextImpl;
  -import org.apache.commons.simplestore.persistence.impl.MetaClassImpl;
  -import org.apache.commons.simplestore.persistence.impl.ConnectionFactory;
  -import org.apache.commons.simplestore.persistence.impl.RandomOIDGenerator;
   import org.apache.commons.simplestore.persistence.ValidationException;
   import org.apache.commons.simplestore.cache.impl.SoftRefMemoryCache;
   
  @@ -75,7 +69,7 @@
    * 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/03/24 06:27:35 baliuka Exp
$
  + *@version    $Id: DBPersistenceManagerFactory.java,v 1.2 2002/05/17 22:20:51 baliuka Exp
$
    */
   public class DBPersistenceManagerFactory implements PersistenceManagerFactory{
       
  
  
  
  1.37      +5 -6      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.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- PersistentProxy.java	15 May 2002 18:15:40 -0000	1.36
  +++ PersistentProxy.java	17 May 2002 22:20:51 -0000	1.37
  @@ -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.36 2002/05/15 18:15:40 baliuka Exp $
  + *@version    $Id: PersistentProxy.java,v 1.37 2002/05/17 22:20:51 baliuka Exp $
    */
   public class PersistentProxy
   implements MetaObject,  org.apache.commons.simplestore.tools.Constants ,
  @@ -308,8 +308,8 @@
       private Object readProperty( Method method ) throws Throwable {
           
           int index = m_metaClass.getPropertyIndex( method );
  -        
  -        if( method.getReturnType().isAssignableFrom(java.util.Collection.class )){
  +        Class returnType = method.getReturnType();
  +        if( returnType.isAssignableFrom(java.util.Collection.class )){
               return  m_context.getStorage().
               retrieve( m_metaClass.getReference(index),
               m_metaClass.getReferenceField(index),m_oid );
  @@ -317,12 +317,11 @@
           }
           Object value =  getProperty(index);;
           if( value != null && m_metaClass.isReference( method ) ){
  -            System.out.println("Referenced:" + m_metaClass.getReferenceField(index));
  -            return m_context.getStorage().
  +           return m_context.getStorage().
               retrieveObject( method.getReturnType(),value );
           }
           
  -        return  m_context.getTypeConverter().toAppType(value,method.getReturnType());
  +        return  m_context.getTypeConverter().toAppType(value,returnType);
           
       }
       
  
  
  
  1.11      +4 -4      jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/impl/TransactionImpl.java
  
  Index: TransactionImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/persistence/impl/TransactionImpl.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TransactionImpl.java	15 May 2002 18:15:40 -0000	1.10
  +++ TransactionImpl.java	17 May 2002 22:20:51 -0000	1.11
  @@ -71,7 +71,7 @@
   /**
    *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
    *      baliuka@mwm.lt</a>
  - *@version    $Id: TransactionImpl.java,v 1.10 2002/05/15 18:15:40 baliuka Exp $
  + *@version    $Id: TransactionImpl.java,v 1.11 2002/05/17 22:20:51 baliuka Exp $
    */
   
   public class TransactionImpl
  @@ -138,11 +138,11 @@
       }
       
       public void commit() {
  -        try{
  +       
               checkState();
               checkState(!complete);
               transaction.commit(objects);
  -        }finally{
  +       
               complete = true;
               strongRefs.clear();
               storedCollections.clear();
  @@ -153,7 +153,7 @@
                   mo.afterCommit();
               }
               objects.clear();
  -        }
  +        
       }
       
       public void begin() {
  
  
  
  1.27      +5 -3      jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/tools/Enhancer.java
  
  Index: Enhancer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/simplestore/src/java/org/apache/commons/simplestore/tools/Enhancer.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- Enhancer.java	14 May 2002 17:02:51 -0000	1.26
  +++ Enhancer.java	17 May 2002 22:20:51 -0000	1.27
  @@ -135,7 +135,7 @@
    * </pre>
    *@author     Juozas Baliuka <a href="mailto:baliuka@mwm.lt">
    *      baliuka@mwm.lt</a>
  - *@version    $Id: Enhancer.java,v 1.26 2002/05/14 17:02:51 baliuka Exp $
  + *@version    $Id: Enhancer.java,v 1.27 2002/05/17 22:20:51 baliuka Exp $
    */
   public class Enhancer implements org.apache.bcel.Constants ,
   Constants{
  @@ -199,8 +199,10 @@
         try{      
           return (MethodInterceptor) enhanced.getClass().getField(FIELD_NAME).get(
               enhanced);
  -      }catch(Exception e){
  -        throw new java.lang.IllegalStateException(e.getMessage());
  +      }catch( NoSuchFieldException nsfe){
  +        throw new NoSuchFieldError( enhanced.getClass().getName() + ":" + nsfe.getMessage());
  +      }catch( java.lang.IllegalAccessException iae ){
  +        throw new IllegalAccessError(enhanced.getClass().getName() + ":" + iae.getMessage());

         }
       }
       public static void addConstructionHandler(ConstructionHandler ch) {
  
  
  

--
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