Java Reference
In-Depth Information
case ScriptEngine.LANGUAGE_VERSION:
return getLanguageVersion();
case "THREADING":
return "MULTITHREADED";
default:
return null;
}
}
@Override
public String getMethodCallSyntax(String obj, String m, String[] p) {
return "Not implemented";
}
@Override
public String getOutputStatement(String toDisplay) {
return "Not implemented";
}
@Override
public String getProgram(String[] statements) {
return "Not implemented";
}
@Override
public ScriptEngine getScriptEngine() {
return new JKScriptEngine(this);
}
}
Preparing for Deployment
Before you package the classes for the
JKScript
script engine, you need to perform one
more step: Create a directory named
META-INF
. Under the
META-INF
directory, create a
subdirectory named
services
. In the
services
directory, create a text file named
javax.script.ScriptEngineFactory
. Notice that the filename must be the way it is
mentioned and should not have any extension such as
.txt
.
Edit the
javax.script.ScriptEngineFactory
file and enter the contents as shown
in Listing 8-4. The first line in the file is a comment that starts with a # sign. The second
line is the fully qualified name of the
JKScript
script engine factory class.
Search WWH ::
Custom Search