diff options
author | Claude Brisson <cbrisson@apache.org> | 2016-12-11 08:27:14 +0000 |
---|---|---|
committer | Claude Brisson <cbrisson@apache.org> | 2016-12-11 08:27:14 +0000 |
commit | 5d70000132ba2eddf8f27f1ec38160ff3630a1dc (patch) | |
tree | f6d9fce2eeb57029918e4f1b40616bfc5dcfd20b /velocity-engine-examples | |
parent | 29ccc7beebd7d551165b36bd285349f6389b5c6a (diff) | |
download | apache-velocity-engine-5d70000132ba2eddf8f27f1ec38160ff3630a1dc.tar.gz |
[engine] review event handling
1) Add a Context argument for all events.
2) Get rid of the Executor pattern ; event handlers are directly called by the cartridge.
git-svn-id: https://svn.apache.org/repos/asf/velocity/engine/trunk@1773548 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'velocity-engine-examples')
-rw-r--r-- | velocity-engine-examples/src/main/java/org/apache/velocity/example/EventExample.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/velocity-engine-examples/src/main/java/org/apache/velocity/example/EventExample.java b/velocity-engine-examples/src/main/java/org/apache/velocity/example/EventExample.java index c03c9e74..2873eb22 100644 --- a/velocity-engine-examples/src/main/java/org/apache/velocity/example/EventExample.java +++ b/velocity-engine-examples/src/main/java/org/apache/velocity/example/EventExample.java @@ -20,6 +20,7 @@ package org.apache.velocity.example; import java.io.StringWriter; +import org.apache.velocity.context.Context; import org.apache.velocity.util.introspection.Info; import org.slf4j.helpers.FormattingTuple; import org.slf4j.helpers.MarkerIgnoringBase; @@ -240,7 +241,7 @@ public class EventExample extends MarkerIgnoringBase /** * Event handler for when a reference is inserted into the output stream. */ - public Object referenceInsert( String reference, Object value ) + public Object referenceInsert( Context context, String reference, Object value ) { /* * if we have a value @@ -281,7 +282,7 @@ public class EventExample extends MarkerIgnoringBase return true; } - public Object methodException( Class claz, String method, Exception e, Info info ) { + public Object methodException( Context context, Class claz, String method, Exception e, Info info ) { /* * only do processing if the switch is on */ |