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))); } }