Package org.keycloak.scripting
Class InvocableScriptAdapter
- java.lang.Object
-
- org.keycloak.scripting.InvocableScriptAdapter
-
- All Implemented Interfaces:
Invocable
public class InvocableScriptAdapter extends Object implements Invocable
Wraps aScriptModeland makes itInvocable.- Author:
- Thomas Darimont
-
-
Constructor Summary
Constructors Constructor Description InvocableScriptAdapter(ScriptModel scriptModel, ScriptEngine scriptEngine)Creates a newInvocableScriptAdapterinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> TgetInterface(Class<T> clazz)<T> TgetInterface(Object thiz, Class<T> clazz)ObjectinvokeFunction(String name, Object... args)ObjectinvokeMethod(Object thiz, String name, Object... args)booleanisDefined(String name)Returns true if theScriptEnginehas a definition with the givenname.
-
-
-
Constructor Detail
-
InvocableScriptAdapter
public InvocableScriptAdapter(ScriptModel scriptModel, ScriptEngine scriptEngine)
Creates a newInvocableScriptAdapterinstance.- Parameters:
scriptModel- must not be nullscriptEngine- must not be null
-
-
Method Detail
-
invokeMethod
public Object invokeMethod(Object thiz, String name, Object... args) throws ScriptExecutionException
- Specified by:
invokeMethodin interfaceInvocable- Throws:
ScriptExecutionException
-
invokeFunction
public Object invokeFunction(String name, Object... args) throws ScriptExecutionException
- Specified by:
invokeFunctionin interfaceInvocable- Throws:
ScriptExecutionException
-
getInterface
public <T> T getInterface(Class<T> clazz)
- Specified by:
getInterfacein interfaceInvocable
-
getInterface
public <T> T getInterface(Object thiz, Class<T> clazz)
- Specified by:
getInterfacein interfaceInvocable
-
isDefined
public boolean isDefined(String name)
Returns true if theScriptEnginehas a definition with the givenname.- Parameters:
name-- Returns:
-
-