cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From coli...@apache.org
Subject cvs commit: cocoon-2.1/src/scratchpad/src/org/apache/cocoon/components/flow/javascript/fom FOM_Cocoon.java FOM_JavaScriptInterpreter.java
Date Sun, 06 Jul 2003 07:09:19 GMT
coliver     2003/07/06 00:09:19

  Modified:    src/scratchpad/src/org/apache/cocoon/components/flow/javascript/fom
                        FOM_Cocoon.java FOM_JavaScriptInterpreter.java
  Log:
  Setup logger
  
  Revision  Changes    Path
  1.9       +13 -7     cocoon-2.1/src/scratchpad/src/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java
  
  Index: FOM_Cocoon.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/scratchpad/src/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FOM_Cocoon.java	2 Jul 2003 17:05:37 -0000	1.8
  +++ FOM_Cocoon.java	6 Jul 2003 07:09:18 -0000	1.9
  @@ -75,6 +75,7 @@
   import org.mozilla.javascript.Undefined;
   import org.mozilla.javascript.Wrapper;
   import org.mozilla.javascript.continuations.Continuation;
  +import org.apache.avalon.framework.logger.Logger;
   
   /**
    * Implementation of FOM (Flow Object Model).
  @@ -91,6 +92,7 @@
   
       private Environment environment;
       private ComponentManager componentManager;
  +    private Logger logger;
   
       private FOM_Request request;
       private FOM_Response response;
  @@ -117,10 +119,12 @@
   
       public void setup(FOM_JavaScriptInterpreter interp,
                         Environment env, 
  -                      ComponentManager manager) {
  +                      ComponentManager manager,
  +                      Logger logger) {
           this.interpreter = interp;
           this.environment = env;
           this.componentManager = manager;
  +        this.logger = logger;
       }
   
       public void invalidate() {
  @@ -128,6 +132,8 @@
           this.response = null;
           this.session = null;
           this.context = null;
  +        this.log = null;
  +        this.logger = null;
           this.componentManager = null;
           this.environment = null;
           this.interpreter = null;
  @@ -622,14 +628,14 @@
           public FOM_Log() {
           }
   
  +        public FOM_Log(Object logger) {
  +            this.logger = (Logger)unwrap(logger);
  +        }
  +
           public String getClassName() {
               return "FOM_Log";
           }
           
  -        public void enableLogging(Logger logger) {
  -            this.logger = logger;
  -        }
  -        
           public void jsFunction_debug(String message) {
               logger.debug(message);
           }
  @@ -698,7 +704,7 @@
           if (log != null) {
               return log;
           }
  -        log = new FOM_Log();
  +        log = new FOM_Log(logger);
           log.setParentScope(getParentScope());
           log.setPrototype(getClassPrototype(this, "FOM_Log"));
           return log;
  
  
  
  1.6       +3 -3      cocoon-2.1/src/scratchpad/src/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java
  
  Index: FOM_JavaScriptInterpreter.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/scratchpad/src/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FOM_JavaScriptInterpreter.java	2 Jul 2003 17:05:37 -0000	1.5
  +++ FOM_JavaScriptInterpreter.java	6 Jul 2003 07:09:19 -0000	1.6
  @@ -364,7 +364,7 @@
                                              thrScope)).longValue();
           // We need to setup the FOM_Cocoon object according to the current
           // request. Everything else remains the same.
  -        cocoon.setup(this, environment, manager);
  +        cocoon.setup(this, environment, manager, getLogger());
   
           // Check if we need to compile and/or execute scripts
           synchronized (compiledScripts) {
  @@ -567,7 +567,7 @@
           Scriptable kScope = k.getParentScope();
           synchronized (kScope) {
               FOM_Cocoon cocoon = (FOM_Cocoon)kScope.get("cocoon", kScope);
  -            cocoon.setup(this, environment, manager);
  +            cocoon.setup(this, environment, manager, getLogger());
               if (enableDebugger) {
                   getDebugger().setVisible(true);
               }
  
  
  

Mime
View raw message