Class OPolyglotScriptExecutor
java.lang.Object
com.orientechnologies.orient.core.command.traverse.OAbstractScriptExecutor
com.orientechnologies.orient.core.command.script.OPolyglotScriptExecutor
- All Implemented Interfaces:
OResourcePoolListener<ODatabaseDocumentInternal,,org.graalvm.polyglot.Context> OScriptExecutor
public class OPolyglotScriptExecutor
extends OAbstractScriptExecutor
implements OResourcePoolListener<ODatabaseDocumentInternal,org.graalvm.polyglot.Context>
Created by Luca Garulli
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ConcurrentHashMap<String, OResourcePool<ODatabaseDocumentInternal, org.graalvm.polyglot.Context>> Fields inherited from class com.orientechnologies.orient.core.command.traverse.OAbstractScriptExecutor
language -
Constructor Summary
ConstructorsConstructorDescriptionOPolyglotScriptExecutor(String language, OScriptTransformer scriptTransformer) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcloseAll()org.graalvm.polyglot.ContextcreateNewResource(ODatabaseDocumentInternal database, Object... iAdditionalArgs) Creates a new resource to be used and to be pooled when the client finishes with it.execute(ODatabaseDocumentInternal database, String script, Object... params) execute(ODatabaseDocumentInternal database, String script, Map params) executeFunction(OCommandContext context, String functionName, Map<Object, Object> iArgs) booleanreuseResource(ODatabaseDocumentInternal iKey, Object[] iAdditionalArgs, org.graalvm.polyglot.Context iValue) Reuses the pooled resource.protected ObjecttoObject(org.graalvm.polyglot.Value result) Methods inherited from class com.orientechnologies.orient.core.command.traverse.OAbstractScriptExecutor
preExecute, registerInterceptor, unregisterInterceptor
-
Field Details
-
contextPools
protected ConcurrentHashMap<String,OResourcePool<ODatabaseDocumentInternal, contextPoolsorg.graalvm.polyglot.Context>>
-
-
Constructor Details
-
OPolyglotScriptExecutor
-
-
Method Details
-
createNewResource
public org.graalvm.polyglot.Context createNewResource(ODatabaseDocumentInternal database, Object... iAdditionalArgs) Description copied from interface:OResourcePoolListenerCreates a new resource to be used and to be pooled when the client finishes with it.- Specified by:
createNewResourcein interfaceOResourcePoolListener<ODatabaseDocumentInternal,org.graalvm.polyglot.Context> - Returns:
- The new resource
-
reuseResource
public boolean reuseResource(ODatabaseDocumentInternal iKey, Object[] iAdditionalArgs, org.graalvm.polyglot.Context iValue) Description copied from interface:OResourcePoolListenerReuses the pooled resource.- Specified by:
reuseResourcein interfaceOResourcePoolListener<ODatabaseDocumentInternal,org.graalvm.polyglot.Context> - Returns:
- true if can be reused, otherwise false. In this case the resource will be removed from the pool
-
execute
- Specified by:
executein interfaceOScriptExecutor
-
execute
- Specified by:
executein interfaceOScriptExecutor
-
executeFunction
public Object executeFunction(OCommandContext context, String functionName, Map<Object, Object> iArgs) - Specified by:
executeFunctionin interfaceOScriptExecutor
-
toObject
-
close
- Specified by:
closein interfaceOScriptExecutor
-
closeAll
public void closeAll()- Specified by:
closeAllin interfaceOScriptExecutor
-