[logback-dev] svn commit: r634 - logback/trunk/logback-core/examples/src/joran/calculator

noreply.ceki at qos.ch noreply.ceki at qos.ch
Sun Oct 8 19:41:57 CEST 2006


Author: ceki
Date: Sun Oct  8 19:41:57 2006
New Revision: 634

Modified:
   logback/trunk/logback-core/examples/src/joran/calculator/Calculator1.java
   logback/trunk/logback-core/examples/src/joran/calculator/Calculator2.java
   logback/trunk/logback-core/examples/src/joran/calculator/ComputationAction2.java

Log:
minor updates

Modified: logback/trunk/logback-core/examples/src/joran/calculator/Calculator1.java
==============================================================================
--- logback/trunk/logback-core/examples/src/joran/calculator/Calculator1.java	(original)
+++ logback/trunk/logback-core/examples/src/joran/calculator/Calculator1.java	Sun Oct  8 19:41:57 2006
@@ -15,6 +15,7 @@
 
 import ch.qos.logback.core.Context;
 import ch.qos.logback.core.ContextBase;
+import ch.qos.logback.core.joran.spi.ExecutionContext;
 import ch.qos.logback.core.joran.spi.Interpreter;
 import ch.qos.logback.core.joran.spi.Pattern;
 import ch.qos.logback.core.joran.spi.RuleStore;
@@ -60,7 +61,11 @@
     
     // Create a new Joran Interpreter and hand it our simple rule store.
     Interpreter ji = new Interpreter(ruleStore);
+    // set the context for the interpreter's execution context
+    ExecutionContext ec = ji.getExecutionContext();
+    ec.setContext(context);
 
+    
     // Create a SAX parser
     SAXParserFactory spf = SAXParserFactory.newInstance();
     SAXParser saxParser = spf.newSAXParser();

Modified: logback/trunk/logback-core/examples/src/joran/calculator/Calculator2.java
==============================================================================
--- logback/trunk/logback-core/examples/src/joran/calculator/Calculator2.java	(original)
+++ logback/trunk/logback-core/examples/src/joran/calculator/Calculator2.java	Sun Oct  8 19:41:57 2006
@@ -14,6 +14,7 @@
 
 import ch.qos.logback.core.Context;
 import ch.qos.logback.core.ContextBase;
+import ch.qos.logback.core.joran.spi.ExecutionContext;
 import ch.qos.logback.core.joran.spi.Interpreter;
 import ch.qos.logback.core.joran.spi.Pattern;
 import ch.qos.logback.core.joran.spi.RuleStore;
@@ -25,7 +26,7 @@
  * This examples illustrates collaboration between multiple actions through the
  * common execution context stack.
  * 
- * It differs from Calculator1 in that it supoorts arbitrary nesting of 
+ * It differs from Calculator1 in that it supports arbitrary nesting of 
  * computation elements.
  * 
  * You can test this application with the sample XML file <em>calculator3.xml</em>.
@@ -48,7 +49,11 @@
     
     // Create a new Joran Interpreter and hand it our simple rule store.
     Interpreter ji = new Interpreter(ruleStore);
+    // set the context for the interpreter's execution context
+    ExecutionContext ec = ji.getExecutionContext();
+    ec.setContext(context);
 
+    
     // Create a SAX parser
     SAXParserFactory spf = SAXParserFactory.newInstance();
     SAXParser saxParser = spf.newSAXParser();

Modified: logback/trunk/logback-core/examples/src/joran/calculator/ComputationAction2.java
==============================================================================
--- logback/trunk/logback-core/examples/src/joran/calculator/ComputationAction2.java	(original)
+++ logback/trunk/logback-core/examples/src/joran/calculator/ComputationAction2.java	Sun Oct  8 19:41:57 2006
@@ -58,7 +58,7 @@
 public class ComputationAction2 extends Action {
   public static String NAME_ATR = "name";
 
-  Stack nameStrStack = new Stack();
+  Stack<String> nameStrStack = new Stack<String>();
   
   
   public void begin(ExecutionContext ec, String name, Attributes attributes) {



More information about the logback-dev mailing list