commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject svn commit: r389908 - in /jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml: env/SimpleContext.java env/jsp/ELEvaluator.java env/jsp/RootContext.java semantics/SCXMLSemanticsImpl.java
Date Wed, 29 Mar 2006 22:17:31 GMT
Author: rahul
Date: Wed Mar 29 14:17:29 2006
New Revision: 389908

URL: http://svn.apache.org/viewcvs?rev=389908&view=rev
Log:
All logs are now private, with getters and setters where subclassing may be anticipated.

Modified:
    jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/SimpleContext.java
    jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/jsp/ELEvaluator.java
    jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/jsp/RootContext.java
    jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/semantics/SCXMLSemanticsImpl.java

Modified: jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/SimpleContext.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/SimpleContext.java?rev=389908&r1=389907&r2=389908&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/SimpleContext.java
(original)
+++ jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/SimpleContext.java
Wed Mar 29 14:17:29 2006
@@ -31,7 +31,7 @@
 public class SimpleContext implements Context {
 
     /** Implementation independent log category. */
-    protected Log log = LogFactory.getLog(Context.class);
+    private Log log = LogFactory.getLog(Context.class);
     /** The parent Context to this Context. */
     private Context parent;
     /** The Map of variables and their values in this Context. */
@@ -180,6 +180,24 @@
      */
     public Map getVars() {
         return vars;
+    }
+
+    /**
+     * Set the log used by this <code>Context</code> instance.
+     *
+     * @param log The new log.
+     */
+    protected void setLog(final Log log) {
+        this.log = log;
+    }
+
+    /**
+     * Get the log used by this <code>Context</code> instance.
+     *
+     * @return Log The log being used.
+     */
+    protected Log getLog() {
+        return log;
     }
 
 }

Modified: jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/jsp/ELEvaluator.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/jsp/ELEvaluator.java?rev=389908&r1=389907&r2=389908&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/jsp/ELEvaluator.java
(original)
+++ jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/jsp/ELEvaluator.java
Wed Mar 29 14:17:29 2006
@@ -43,7 +43,7 @@
 public class ELEvaluator implements Evaluator {
 
     /** Implementation independent log category. */
-    protected Log log = LogFactory.getLog(Evaluator.class);
+    private Log log = LogFactory.getLog(Evaluator.class);
     /** Function Mapper for SCXML expressions. */
     private FunctionMapper functionMapper = new BuiltinFunctionMapper();
     /** Pattern for recognizing the SCXML In() special predicate. */
@@ -153,6 +153,24 @@
      */
     public Context newContext(final Context parent) {
         return new ELContext(parent);
+    }
+
+    /**
+     * Set the log used by this <code>Evaluator</code> instance.
+     *
+     * @param log The new log.
+     */
+    protected void setLog(final Log log) {
+        this.log = log;
+    }
+
+    /**
+     * Get the log used by this <code>Evaluator</code> instance.
+     *
+     * @return Log The log being used.
+     */
+    protected Log getLog() {
+        return log;
     }
 
     /**

Modified: jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/jsp/RootContext.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/jsp/RootContext.java?rev=389908&r1=389907&r2=389908&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/jsp/RootContext.java
(original)
+++ jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/env/jsp/RootContext.java
Wed Mar 29 14:17:29 2006
@@ -42,7 +42,7 @@
     public RootContext(final JspContext ctx) {
         super();
         if (ctx == null) {
-            log.error(ERR_HOST_JSP_CTX_NULL);
+            getLog().error(ERR_HOST_JSP_CTX_NULL);
             throw new IllegalArgumentException(ERR_HOST_JSP_CTX_NULL);
         } else {
           // only retain the VariableResolver
@@ -63,7 +63,7 @@
             try {
                 value = variableResolver.resolveVariable(name);
             } catch (ELException ele) {
-                log.error(ele.getMessage(), ele);
+                getLog().error(ele.getMessage(), ele);
             }
         }
         return value;
@@ -83,7 +83,7 @@
             try {
                 value = variableResolver.resolveVariable(name);
             } catch (ELException ele) {
-                log.error(ele.getMessage(), ele);
+                getLog().error(ele.getMessage(), ele);
             }
             if (value != null) {
                 exists = true;

Modified: jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/semantics/SCXMLSemanticsImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/semantics/SCXMLSemanticsImpl.java?rev=389908&r1=389907&r2=389908&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/semantics/SCXMLSemanticsImpl.java
(original)
+++ jakarta/commons/sandbox/scxml/trunk/src/main/java/org/apache/commons/scxml/semantics/SCXMLSemanticsImpl.java
Wed Mar 29 14:17:29 2006
@@ -27,6 +27,7 @@
 import java.util.List;
 import java.util.Set;
 
+import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.commons.scxml.ErrorReporter;
 import org.apache.commons.scxml.EventDispatcher;
@@ -63,8 +64,7 @@
     /**
      * SCXML Logger for the application.
      */
-    protected org.apache.commons.logging.Log appLog = LogFactory
-            .getLog("scxml.app.log");
+    private Log appLog = LogFactory.getLog("scxml.app.log");
 
     /**
      * The TransitionTarget comparator.
@@ -689,6 +689,24 @@
      */
     protected Comparator getTTComparator() {
         return targetComparator;
+    }
+
+    /**
+     * Set the log used by this <code>SCXMLSemantics</code> instance.
+     *
+     * @param log The new log.
+     */
+    protected void setLog(final Log log) {
+        this.appLog = log;
+    }
+
+    /**
+     * Get the log used by this <code>SCXMLSemantics</code> instance.
+     *
+     * @return Log The log being used.
+     */
+    protected Log getLog() {
+        return appLog;
     }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message