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 aScriptModel
and makes itInvocable
.- Author:
- Thomas Darimont
-
-
Constructor Summary
Constructors Constructor Description InvocableScriptAdapter(ScriptModel scriptModel, ScriptEngine scriptEngine)
Creates a newInvocableScriptAdapter
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
getInterface(Class<T> clazz)
<T> T
getInterface(Object thiz, Class<T> clazz)
Object
invokeFunction(String name, Object... args)
Object
invokeMethod(Object thiz, String name, Object... args)
boolean
isDefined(String name)
Returns true if theScriptEngine
has a definition with the givenname
.
-
-
-
Constructor Detail
-
InvocableScriptAdapter
public InvocableScriptAdapter(ScriptModel scriptModel, ScriptEngine scriptEngine)
Creates a newInvocableScriptAdapter
instance.- 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:
invokeMethod
in interfaceInvocable
- Throws:
ScriptExecutionException
-
invokeFunction
public Object invokeFunction(String name, Object... args) throws ScriptExecutionException
- Specified by:
invokeFunction
in interfaceInvocable
- Throws:
ScriptExecutionException
-
getInterface
public <T> T getInterface(Class<T> clazz)
- Specified by:
getInterface
in interfaceInvocable
-
getInterface
public <T> T getInterface(Object thiz, Class<T> clazz)
- Specified by:
getInterface
in interfaceInvocable
-
isDefined
public boolean isDefined(String name)
Returns true if theScriptEngine
has a definition with the givenname
.- Parameters:
name
-- Returns:
-
-