K
- the type of the Map entry keyV
- the type of the Map entry valueR
- the type of value returned by the InvocableMap.EntryProcessor
public class ScriptProcessor<K,V,R> extends AbstractScript implements InvocableMap.EntryProcessor<K,V,R>
InvocableMap.EntryProcessor
that wraps a script
written in one of the languages supported by Graal VM.m_aoArgs, m_sLanguage, m_sName
Constructor and Description |
---|
ScriptProcessor()
Default constructor for deserialization.
|
ScriptProcessor(String language,
String name,
Object... args)
Create a
ScriptProcessor that wraps a script written in the
specified language and identified by the specified name. |
Modifier and Type | Method and Description |
---|---|
R |
process(InvocableMap.Entry<K,V> entry)
Process a Map.Entry object.
|
readExternal, readExternal, writeExternal, writeExternal
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
processAll
public ScriptProcessor()
public ScriptProcessor(String language, String name, Object... args)
ScriptProcessor
that wraps a script written in the
specified language and identified by the specified name. The specified
args will be passed during execution of the script.language
- the language the script is written. Currently, only
"js" (for JavaScript) is supportedname
- the name of the InvocableMap.EntryProcessor
that needs to
be executedargs
- the arguments to be passed to the InvocableMap.EntryProcessor
public R process(InvocableMap.Entry<K,V> entry)
InvocableMap.EntryProcessor
Note: if this method throws an exception, all modifications to the supplied
entry or any other entries retrieved via the BackingMapContext.getBackingMapEntry(java.lang.Object)
API will be rolled back leaving all underlying values unchanged.
process
in interface InvocableMap.EntryProcessor<K,V,R>
entry
- the Entry to process