portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/components/persistence/src/java/org/apache/jetspeed/components/persistence/store/ojb/pb PBStore.java
Date Fri, 09 Jul 2004 18:15:23 GMT
weaver      2004/07/09 11:15:23

  Modified:    components/persistence/src/java/org/apache/jetspeed/components/persistence/store/ojb/pb
                        PBStore.java
  Log:
  Implementation of JS2-92.
  
  Revision  Changes    Path
  1.11      +30 -5     jakarta-jetspeed-2/components/persistence/src/java/org/apache/jetspeed/components/persistence/store/ojb/pb/PBStore.java
  
  Index: PBStore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/persistence/src/java/org/apache/jetspeed/components/persistence/store/ojb/pb/PBStore.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- PBStore.java	2 Jul 2004 13:28:14 -0000	1.10
  +++ PBStore.java	9 Jul 2004 18:15:23 -0000	1.11
  @@ -16,21 +16,21 @@
   package org.apache.jetspeed.components.persistence.store.ojb.pb;
   
   import java.net.URL;
  -import java.util.ArrayList;
   import java.util.Collection;
   import java.util.Enumeration;
   import java.util.HashSet;
   import java.util.Iterator;
  -import java.util.List;
   import java.util.Set;
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.apache.jetspeed.components.persistence.store.Filter;
  +import org.apache.jetspeed.components.persistence.store.LockFailedException;
   import org.apache.jetspeed.components.persistence.store.PersistenceStore;
   import org.apache.jetspeed.components.persistence.store.PersistenceStoreEventListener;
  +import org.apache.jetspeed.components.persistence.store.RemovalAware;
   import org.apache.jetspeed.components.persistence.store.Transaction;
  -import org.apache.jetspeed.components.persistence.store.LockFailedException;
  +import org.apache.jetspeed.components.persistence.store.UpdateAware;
   import org.apache.jetspeed.components.persistence.store.impl.StoreEventInvoker;
   import org.apache.jetspeed.components.persistence.store.ojb.CriteriaFilter;
   import org.apache.ojb.broker.Identity;
  @@ -134,8 +134,21 @@
       public void deletePersistent(Object obj) throws LockFailedException
       {
           checkBroker();
  -        invoker.beforeDeletePersistent(obj);        
  +        invoker.beforeDeletePersistent(obj);
  +        RemovalAware ra = null;
  +        if(obj instanceof RemovalAware)
  +        {
  +           ra = (RemovalAware) obj;
  +           ra.preRemoval(this);
  +        }
  +            
           pb.delete(obj);
  +        
  +        if(ra != null)
  +        {
  +            ra.postRemoval(this);
  +        }
  +        
           invoker.afterDeletePersistent(obj);
   
       }
  @@ -382,9 +395,21 @@
       {
           try
           {
  -            invoker.beforeMakePersistent(obj);
               checkBroker();
  +            invoker.beforeMakePersistent(obj);
  +            UpdateAware ua = null;
  +            if(obj instanceof UpdateAware)
  +            {
  +                ua = (UpdateAware) obj;
  +                ua.preUpdate(this);
  +            }          
  +            
               pb.store(obj);
  +            if(ua != null)
  +            {
  +                ua.postUpdate(this);
  +            }
  +            
               invoker.afterMakePersistent(obj);
           }
           finally
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message