diff --git a/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java b/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java index e19e4f545a8..a5419287eb0 100644 --- a/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java +++ b/src/java/org/apache/cocoon/components/flow/ContinuationsManagerImpl.java @@ -45,7 +45,7 @@ * @author Michael Melhem * @since March 19, 2002 * @see ContinuationsManager - * @version CVS $Id: ContinuationsManagerImpl.java,v 1.10 2004/04/09 19:52:54 vgritsenko Exp $ + * @version CVS $Id: ContinuationsManagerImpl.java,v 1.11 2004/05/17 18:50:53 vgritsenko Exp $ */ public class ContinuationsManagerImpl extends AbstractLogEnabled @@ -97,6 +97,13 @@ public ContinuationsManagerImpl() throws Exception { bytes = new byte[CONTINUATION_ID_LENGTH]; } + /** + * Get the command sink so that we can be notified of changes + */ + public void contextualize(Context context) throws ContextException { + m_commandSink = (Sink) context.get(Queue.ROLE); + } + public void configure(Configuration config) { defaultTimeToLive = config.getAttributeAsInteger("time-to-live", (3600 * 1000)); Configuration expireConf = config.getChild("expirations-check"); @@ -122,13 +129,11 @@ public WebContinuation createWebContinuation(Object kont, if (parent == null) { forrest.add(wk); - } - - // REVISIT: This Places only the "leaf" nodes in the expirations Sorted Set. - // do we really want to do this? - if (parent != null) { - if (wk.getParentContinuation().getChildren().size() < 2) { - expirations.remove(wk.getParentContinuation()); + } else { + // REVISIT: This places only the "leaf" nodes in the expirations Sorted Set. + // do we really want to do this? + if (parent.getChildren().size() < 2) { + expirations.remove(parent); } } @@ -312,13 +317,12 @@ private void expireContinuations() { getLogger().debug("WK: Forrest size: " + forrest.size()); displayAllContinuations(); displayExpireSet(); - } - // clean up - if (getLogger().isDebugEnabled()) { getLogger().debug("WK CurrentSystemTime[" + System.currentTimeMillis() + "]: Cleaning up expired Continuations...."); } + + // clean up WebContinuation wk; Iterator iter = expirations.iterator(); while (iter.hasNext() && ((wk = (WebContinuation) iter.next()).hasExpired())) { @@ -334,13 +338,6 @@ private void expireContinuations() { } } - /** - * Get the command sink so that we can be notified of changes - */ - public void contextualize(Context context) throws ContextException { - m_commandSink = (Sink) context.get(Queue.ROLE); - } - final class ContinuationInterrupt implements RepeatedCommand { private final long m_interval; diff --git a/src/java/org/apache/cocoon/components/flow/WebContinuation.java b/src/java/org/apache/cocoon/components/flow/WebContinuation.java index da8031614ef..7c76514d18f 100644 --- a/src/java/org/apache/cocoon/components/flow/WebContinuation.java +++ b/src/java/org/apache/cocoon/components/flow/WebContinuation.java @@ -34,7 +34,7 @@ * * @author Ovidiu Predescu * @since March 19, 2002 - * @version CVS $Id: WebContinuation.java,v 1.8 2004/04/09 19:52:54 vgritsenko Exp $ + * @version CVS $Id: WebContinuation.java,v 1.9 2004/05/17 18:50:53 vgritsenko Exp $ */ public class WebContinuation extends AbstractLogEnabled implements Comparable { @@ -350,7 +350,7 @@ public boolean hasExpired() { * Dispose this continuation. Should be called on invalidation. */ public void dispose() { - // Call specific possible implementation-specific clean-up on this continuation. + // Call possible implementation-specific clean-up on this continuation. if (this.disposer != null) { this.disposer.disposeContinuation(this); }