Skip to content

Commit

Permalink
renamed attribute from 'script' to 'src'
Browse files Browse the repository at this point in the history
  • Loading branch information
ar committed May 27, 2016
1 parent 16117b1 commit 76e29a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions doc/src/asciidoc/module_groovy.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ In jPOS 2.0.7 (and later), `QFactory.properties` maps the `groovy` keyword to

[source,xml]
----------------------------------------------------------------------------------------
<groovy logger='Q2' script='deploy/test.groovy' />
<groovy logger='Q2' scr='deploy/test.groovy' />
----------------------------------------------------------------------------------------

or
Expand All @@ -49,4 +49,3 @@ The following variables are automatically exposed:
Although not strictly required by this particular QBean Groovy adaptor, the `jposee-groovy`
module also includes the handy `groovy-sql` dependency.
======

6 changes: 3 additions & 3 deletions modules/groovy/src/main/java/org/jpos/q2/qbean/Groovy.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public void run() {
binding.setVariable("log", getLog());
binding.setVariable("cfg", getConfiguration());
GroovyShell shell = new GroovyShell(binding);
String script = e.getAttributeValue("script");
if (script != null)
shell.evaluate(new File(script));
String scr = e.getAttributeValue("src");
if (scr != null)
shell.evaluate(new File(scr));
else
shell.evaluate(e.getText());
} catch (Exception e) {
Expand Down

0 comments on commit 76e29a6

Please # to comment.