cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/flow ContinuationsManagerImpl.java
Date Thu, 04 Sep 2003 13:20:27 GMT
mpo         2003/09/04 06:20:27

  Modified:    src/java/org/apache/cocoon/components/flow
                        ContinuationsManagerImpl.java
  Log:
  Ensure the dispose interface is also called in the event of cleaning up expired WebContinuations.
  (and a minor typo-fix)
  
  Revision  Changes    Path
  1.8       +15 -5     cocoon-2.1/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java
  
  Index: ContinuationsManagerImpl.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ContinuationsManagerImpl.java	26 Aug 2003 09:05:15 -0000	1.7
  +++ ContinuationsManagerImpl.java	4 Sep 2003 13:20:27 -0000	1.8
  @@ -190,7 +190,7 @@
           if (getLogger().isDebugEnabled()) {
               getLogger().debug("WK: Manual Expire of Continuation " + wk.getId());
           }
  -        idToWebCont.remove(wk.getId());
  +        disposeContinuation(wk);
           expirations.remove(wk);
   
           // Invalidate all the children continuations as well
  @@ -199,7 +199,17 @@
           for (int i = 0; i < size; i++) {
               _invalidate((WebContinuation) children.get(i));
           }
  -        
  +    }
  +    
  +    /**
  +     * Makes the continuation inaccessible for lookup, and triggers possible needed
  +     * cleanup code through the ContinuationsDisposer interface.
  +     * 
  +     * @param wk the continuation to dispose.
  +     */
  +    private void disposeContinuation(WebContinuation wk) {
  +        idToWebCont.remove(wk.getId());
  +           
           // Call specific possible implementation-specific clean-up on this continuation.
           ContinuationsDisposer disposer = wk.getDisposer();
           if (disposer != null) {
  @@ -271,7 +281,7 @@
           }
   
           // remove access to this contination
  -        idToWebCont.remove(wk.getId());
  +        disposeContinuation(wk);
   
           WebContinuation parent = wk.getParentContinuation();
           if (parent == null) {
  @@ -341,7 +351,7 @@
   
           // clean up
           if (getLogger().isDebugEnabled()) {
  -            getLogger().debug("WK CurrentSytemTime[" + System.currentTimeMillis() +
  +            getLogger().debug("WK CurrentSystemTime[" + System.currentTimeMillis() +
                                 "]: Cleaning up expired Continuations....");
           }
           WebContinuation wk;
  
  
  

Mime
View raw message