Skip to content

Commit

Permalink
minor changes, clean up
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/cocoon/trunk@28446 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Vadim Gritsenko committed May 17, 2004
1 parent 0af5902 commit ea09ba4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
Expand Up @@ -45,7 +45,7 @@
* @author <a href="mailto:Michael.Melhem@managesoft.com">Michael Melhem</a>
* @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
Expand Down Expand Up @@ -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");
Expand All @@ -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);
}
}

Expand Down Expand Up @@ -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())) {
Expand All @@ -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;
Expand Down
Expand Up @@ -34,7 +34,7 @@
*
* @author <a href="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
* @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 {
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit ea09ba4

Please sign in to comment.