Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 33187 invoked from network); 21 Jan 2004 14:31:29 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 21 Jan 2004 14:31:29 -0000 Received: (qmail 67605 invoked by uid 500); 21 Jan 2004 14:31:24 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 67425 invoked by uid 500); 21 Jan 2004 14:31:22 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 67414 invoked by uid 500); 21 Jan 2004 14:31:22 -0000 Delivered-To: apmail-cocoon-2.1-cvs@apache.org Received: (qmail 67411 invoked from network); 21 Jan 2004 14:31:22 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 21 Jan 2004 14:31:22 -0000 Received: (qmail 33138 invoked by uid 1342); 21 Jan 2004 14:31:25 -0000 Date: 21 Jan 2004 14:31:25 -0000 Message-ID: <20040121143125.33137.qmail@minotaur.apache.org> From: vgritsenko@apache.org To: cocoon-2.1-cvs@apache.org Subject: cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom FOM_Cocoon.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N vgritsenko 2004/01/21 06:31:25 Modified: src/java/org/apache/cocoon/components/flow WebContinuation.java src/java/org/apache/cocoon/components/flow/javascript JSWebContinuation.java src/java/org/apache/cocoon/components/flow/javascript/fom FOM_Cocoon.java Log: braces/spaces Revision Changes Path 1.6 +12 -10 cocoon-2.1/src/java/org/apache/cocoon/components/flow/WebContinuation.java Index: WebContinuation.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/flow/WebContinuation.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- WebContinuation.java 26 Aug 2003 09:05:15 -0000 1.5 +++ WebContinuation.java 21 Jan 2004 14:31:25 -0000 1.6 @@ -67,7 +67,7 @@ * @version CVS $Id$ */ public class WebContinuation extends AbstractLogEnabled - implements Comparable { + implements Comparable { /** * The continuation this object represents. @@ -119,13 +119,13 @@ * is bigger than lastAccessTime + timeToLive. */ protected int timeToLive; - + /** * Holds the ContinuationsDisposer to call when this continuation * gets invalidated. */ protected ContinuationsDisposer disposer; - + /** * Create a WebContinuation object. Saves the object in @@ -142,7 +142,7 @@ WebContinuation(String id, Object continuation, WebContinuation parentContinuation, - int timeToLive, + int timeToLive, ContinuationsDisposer disposer) { this.id = id; this.continuation = continuation; @@ -181,10 +181,11 @@ if (level <= 0) { updateLastAccessTime(); return this; - } else if (parentContinuation == null) + } else if (parentContinuation == null) { return this; - else + } else { return parentContinuation.getContinuation(level - 1); + } } /** @@ -259,9 +260,9 @@ /** * Obtains the ContinuationsDisposer to call when this continuation * is invalidated. - * + * * @return a ContinuationsDisposer instance or null if there are - * no specific clean-up actions required. + * no specific clean-up actions required. */ ContinuationsDisposer getDisposer() { return this.disposer; @@ -283,8 +284,9 @@ * @return a boolean value */ public boolean equals(Object another) { - if (another instanceof WebContinuation) + if (another instanceof WebContinuation) { return id.equals(((WebContinuation) another).id); + } return false; } 1.4 +74 -79 cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/JSWebContinuation.java Index: JSWebContinuation.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/JSWebContinuation.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- JSWebContinuation.java 26 Aug 2003 09:05:52 -0000 1.3 +++ JSWebContinuation.java 21 Jan 2004 14:31:25 -0000 1.4 @@ -58,82 +58,77 @@ * * @version CVS $Id$ */ -public class JSWebContinuation extends ScriptableObject -{ - protected JSCocoon cocoon; - protected WebContinuation wk; - protected ContinuationsManager continuationsMgr; - - public JSWebContinuation() {} - - public String getClassName() - { - return "WebContinuation"; - } - - public JSCocoon getJSCocoon() - { - return cocoon; - } - - public WebContinuation getWebContinuation() - { - return wk; - } - - public static Scriptable jsConstructor(Context cx, Object[] args, - Function ctorObj, - boolean inNewExpr) - throws Exception - { - JSCocoon cocoon = (JSCocoon)args[0]; - ComponentManager manager = cocoon.getComponentManager(); - - ContinuationsManager contMgr - = (ContinuationsManager)manager.lookup(ContinuationsManager.ROLE); - - Object kont = args[1]; - JSWebContinuation pjswk = (JSWebContinuation)args[2]; - WebContinuation pwk = (pjswk == null ? null : pjswk.wk); - - int ttl; - - if (args[3] == Undefined.instance) - ttl = 0; - else { - Number timeToLive = (Number)args[3]; - ttl = (timeToLive == null ? 0 : timeToLive.intValue()); - } - - JSWebContinuation jswk = new JSWebContinuation(); - WebContinuation wk - = contMgr.createWebContinuation(kont, pwk, ttl, null); - wk.setUserObject(jswk); - - jswk.cocoon = cocoon; - jswk.wk = wk; - jswk.continuationsMgr = contMgr; - - return jswk; - } - - public String jsGet_id() - { - return wk.getId(); - } - - public Object jsGet_continuation() - { - return wk.getContinuation(); - } - - public void jsFunction_invalidate() - { - continuationsMgr.invalidateWebContinuation(wk); - } - - public void jsFunction_display() - { - wk.display(); - } +public class JSWebContinuation extends ScriptableObject { + protected JSCocoon cocoon; + protected WebContinuation wk; + protected ContinuationsManager continuationsMgr; + + public JSWebContinuation() { + } + + public String getClassName() { + return "WebContinuation"; + } + + public JSCocoon getJSCocoon() { + return cocoon; + } + + public WebContinuation getWebContinuation() { + return wk; + } + + /** + * @param args Arguments: JSCocoon cocoon, Object continuation, JSWebContinuation parent, Number timeToLive + */ + public static Scriptable jsConstructor(Context cx, Object[] args, + Function ctorObj, + boolean inNewExpr) + throws Exception { + JSCocoon cocoon = (JSCocoon) args[0]; + ComponentManager manager = cocoon.getComponentManager(); + + ContinuationsManager contMgr + = (ContinuationsManager) manager.lookup(ContinuationsManager.ROLE); + + Object kont = args[1]; + JSWebContinuation pjswk = (JSWebContinuation) args[2]; + WebContinuation pwk = (pjswk == null ? null : pjswk.wk); + + int ttl; + + if (args[3] == Undefined.instance) { + ttl = 0; + } else { + Number timeToLive = (Number) args[3]; + ttl = (timeToLive == null ? 0 : timeToLive.intValue()); + } + + JSWebContinuation jswk = new JSWebContinuation(); + WebContinuation wk + = contMgr.createWebContinuation(kont, pwk, ttl, null); + wk.setUserObject(jswk); + + jswk.cocoon = cocoon; + jswk.wk = wk; + jswk.continuationsMgr = contMgr; + + return jswk; + } + + public String jsGet_id() { + return wk.getId(); + } + + public Object jsGet_continuation() { + return wk.getContinuation(); + } + + public void jsFunction_invalidate() { + continuationsMgr.invalidateWebContinuation(wk); + } + + public void jsFunction_display() { + wk.display(); + } } 1.26 +8 -9 cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java Index: FOM_Cocoon.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- FOM_Cocoon.java 19 Jan 2004 17:53:38 -0000 1.25 +++ FOM_Cocoon.java 21 Jan 2004 14:31:25 -0000 1.26 @@ -154,7 +154,7 @@ Map objectModel = environment.getObjectModel(); request = new FOM_Request(ObjectModelHelper.getRequest(objectModel)); request.setParentScope(getParentScope()); - request.setPrototype(getClassPrototype(getParentScope(), + request.setPrototype(getClassPrototype(getParentScope(), "FOM_Request")); return request; } @@ -167,7 +167,7 @@ context = new FOM_Context(ObjectModelHelper.getContext(objectModel)); context.setParentScope(getParentScope()); - context.setPrototype(getClassPrototype(getParentScope(), + context.setPrototype(getClassPrototype(getParentScope(), "FOM_Context")); return context; } @@ -180,11 +180,11 @@ response = new FOM_Response(ObjectModelHelper.getResponse(objectModel)); response.setParentScope(getParentScope()); - response.setPrototype(getClassPrototype(getParentScope(), + response.setPrototype(getClassPrototype(getParentScope(), "FOM_Response")); return response; } - + public FOM_Log getLog() { if (log != null) { return log; @@ -1528,13 +1528,13 @@ * @param parent The parent of this continuation (may be null) * @param timeToLive Lifetime for this continuation (zero means no limit) */ - - public FOM_WebContinuation makeWebContinuation(Continuation k, FOM_WebContinuation parent, int timeToLive) throws Exception { - if (k == null) return null; + if (k == null) { + return null; + } WebContinuation wk; ContinuationsManager contMgr; contMgr = (ContinuationsManager) @@ -1549,5 +1549,4 @@ result.getClassName())); return result; } - }