cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom FOM_Cocoon.java
Date Wed, 21 Jan 2004 14:31:25 GMT
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 <code>lastAccessTime + timeToLive</code>.
        */
       protected int timeToLive;
  -    
  +
       /**
        * Holds the <code>ContinuationsDisposer</code> to call when this continuation
        * gets invalidated.
        */
       protected ContinuationsDisposer disposer;
  -    
  +
   
       /**
        * Create a <code>WebContinuation</code> 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 <code>ContinuationsDisposer</code> to call when this continuation
        * is invalidated.
  -     * 
  +     *
        * @return a <code>ContinuationsDisposer</code> 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 <code>boolean</code> 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;
       }
  -
   }
  
  
  

Mime
View raw message