diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2014-01-23 12:09:30 +0100 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2014-01-23 12:09:30 +0100 |
| commit | 8256917551c259df2b7e69e32cd74497e5394786 (patch) | |
| tree | 068ec6e5acf41aabeb1538c6731c8e8f70d1ddb1 /src/main/java/com/c2kernel/scripting/Script.java | |
| parent | 428d828ca640d1348979f9982d1c0bc0a489a3b4 (diff) | |
Refactored Resource into a new ResourceLoader interface, which allows
CRISTAL processes in other enviroments with complex class loading (e.g.
OSGi) to supply their own resource and class loader to the kernel and
its modules. Fixes #149
Diffstat (limited to 'src/main/java/com/c2kernel/scripting/Script.java')
| -rw-r--r-- | src/main/java/com/c2kernel/scripting/Script.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/com/c2kernel/scripting/Script.java b/src/main/java/com/c2kernel/scripting/Script.java index 9166e2e..e3b4478 100644 --- a/src/main/java/com/c2kernel/scripting/Script.java +++ b/src/main/java/com/c2kernel/scripting/Script.java @@ -29,7 +29,6 @@ import com.c2kernel.entity.proxy.ItemProxy; import com.c2kernel.process.Gateway;
import com.c2kernel.utils.LocalObjectLoader;
import com.c2kernel.utils.Logger;
-import com.c2kernel.utils.Resource;
/**************************************************************************
*
@@ -159,7 +158,7 @@ public class Script PrintWriter output = new PrintWriter(out);
context.setWriter(output);
context.setErrorWriter(output);
- HashMap<String, String> consoleScripts = Resource.getAllTextResources("textFiles/consoleScript."+lang+".txt");
+ HashMap<String, String> consoleScripts = Gateway.getResource().getAllTextResources("textFiles/consoleScript."+lang+".txt");
for (String ns : consoleScripts.keySet()) {
try {
engine.put(ScriptEngine.FILENAME, ns+" init script");
@@ -305,7 +304,7 @@ public class Script {
try
{
- addInputParam(name, Class.forName(type));
+ addInputParam(name, Gateway.getResource().getClassForName(type));
}
catch (ClassNotFoundException ex)
{
@@ -351,7 +350,7 @@ public class Script {
try
{
- addOutput(name, Class.forName(type));
+ addOutput(name, Gateway.getResource().getClassForName(type));
}
catch (ClassNotFoundException ex) {
throw new ParameterException("Output parameter " + name + " specifies class " + type + " which was not found.");
|
