|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.bindings.engine.JsEngineInitializer
public class JsEngineInitializer
| Constructor Summary | |
|---|---|
JsEngineInitializer()
|
|
| Method Summary | |
|---|---|
String |
extractUserFriendlyErrorMessage(ScriptException e)
At least the Rhino script engine for java script generates exceptions whose error messages contain just "too much" information to be easily decipherable by the end users. |
Set<String> |
generateIndirectionMethods(String boundObjectName,
Set<Method> methods)
This function returns a definition string in the script engine's language that provides an indirection to calling the method on the bound object. |
boolean |
implementsLanguage(String language)
|
ScriptEngine |
instantiate(Set<String> packages)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JsEngineInitializer()
| Method Detail |
|---|
public boolean implementsLanguage(String language)
implementsLanguage in interface ScriptEngineInitializer
public ScriptEngine instantiate(Set<String> packages)
throws ScriptException
instantiate in interface ScriptEngineInitializerScriptException
public Set<String> generateIndirectionMethods(String boundObjectName,
Set<Method> methods)
ScriptEngineInitializerboundObjectName = foo
method = <int bar(int)>
function bar(arg) { return foo.bar(arg); }
This method gets passed all the overloaded versions of a method on the object (i.e. all the methods with the same name) and is free to return any number of functions that will map all the possible overloaded versions.
This is because different scripting languages have different support for function overloading and different ways of handling varying number of arguments of a function.
generateIndirectionMethods in interface ScriptEngineInitializerpublic String extractUserFriendlyErrorMessage(ScriptException e)
ScriptEngineInitializerThis method extracts messages from the exception such that they are presentable to the end user.
The returned string should only contain the error message. The filename, line and column information should be stripped from it if at all possible.
extractUserFriendlyErrorMessage in interface ScriptEngineInitializer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||