diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2012-07-06 11:00:24 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2012-07-06 11:00:24 +0200 |
| commit | 24314dc1699c7e73048fa24e33729f1aa1ec0e86 (patch) | |
| tree | c97af82997783b860c36f4410973b23caff0d42e /src/main/java/com/c2kernel/process/module/ModuleScript.java | |
| parent | cc79e98c4763affba4fa2e17dfe5a412f9de66c3 (diff) | |
Modules serialize with Castor. Just about to remove the parsing.
CastorXMLUtility is now a static member of gateway. Domain specific
instances can be used by domain applications, but the maps do not
interfere with the kernel.
Diffstat (limited to 'src/main/java/com/c2kernel/process/module/ModuleScript.java')
| -rw-r--r-- | src/main/java/com/c2kernel/process/module/ModuleScript.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/main/java/com/c2kernel/process/module/ModuleScript.java b/src/main/java/com/c2kernel/process/module/ModuleScript.java new file mode 100644 index 0000000..8612843 --- /dev/null +++ b/src/main/java/com/c2kernel/process/module/ModuleScript.java @@ -0,0 +1,33 @@ +package com.c2kernel.process.module;
+
+import com.c2kernel.scripting.ErrorInfo;
+import com.c2kernel.scripting.Script;
+import com.c2kernel.scripting.ScriptingEngineException;
+
+public class ModuleScript {
+
+
+ public String target;
+ public String event;
+ public String lang;
+ public String script;
+ public ModuleScript() {
+ }
+
+ public ModuleScript(String target, String event, String lang, String script) {
+ super();
+ this.target = target;
+ this.event = event;
+ this.lang = lang;
+ this.script = script;
+ }
+
+ public Script getScript() throws ScriptingEngineException {
+ return new Script(lang, script, ErrorInfo.class);
+ }
+
+ public boolean shouldRun(String event, boolean isServer) {
+ return ((this.target == null || this.target.length() == 0 || isServer == target.equals("server")) &&
+ (this.event == null || this.event.length() == 0 || event.equals(this.event)));
+ }
+}
|
