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/impl DefaultPersistenceStoreContainer.java
Date Tue, 02 Mar 2004 01:57:31 GMT
weaver      2004/03/01 17:57:31

  Modified:    components/persistence/src/java/org/apache/jetspeed/components/persistence/store/impl
                        DefaultPersistenceStoreContainer.java
  Log:
  make sure the PersistenceStore is removed from the storeLastUsed map
  to prevent unneeded checking of closed stores.
  
  Revision  Changes    Path
  1.3       +7 -5      jakarta-jetspeed-2/components/persistence/src/java/org/apache/jetspeed/components/persistence/store/impl/DefaultPersistenceStoreContainer.java
  
  Index: DefaultPersistenceStoreContainer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/components/persistence/src/java/org/apache/jetspeed/components/persistence/store/impl/DefaultPersistenceStoreContainer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultPersistenceStoreContainer.java	25 Feb 2004 22:22:04 -0000	1.2
  +++ DefaultPersistenceStoreContainer.java	2 Mar 2004 01:57:31 -0000	1.3
  @@ -180,6 +180,8 @@
           if (event.getPersistenceStore().equals(TL_store.get()))
           {
               TL_store.set(null);
  +            // Remove the closed store from the check list of active Stores
  +            storeLastUsed.remove(event.getPersistenceStore());
           }
   
       }
  @@ -388,21 +390,21 @@
                   Iterator keys = storeLastUsed.keySet().iterator();
                   while (keys.hasNext())
                   {
  -                    PersistenceStore pb = (PersistenceStore) keys.next();
  -                    Date last = (Date) storeLastUsed.get(pb);
  +                    PersistenceStore store = (PersistenceStore) keys.next();
  +                    Date last = (Date) storeLastUsed.get(store);
                       Date now = new Date();
                       if ((now.getTime() - last.getTime()) > ttl)
                       {
  -                        log.debug("PersistenceStore " + pb + " has exceeded its TTL, attemting
to close.");
  +                        log.debug("PersistenceStore " + store + " has exceeded its TTL,
attemting to close.");
                           // broker should now be considered available
                           try
                           {
  -                            pb.close();
  +                            store.close();
                               log.debug("PersistenceStore successfully closed.");
                           }
                           catch (Throwable e1)
                           {
  -                            log.error("Unable to close PersistenceStore " + pb, e1);
  +                            log.error("Unable to close PersistenceStore " + store, e1);
                           }
                       }
                   }
  
  
  

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