Class OPolyglotScriptExecutor
java.lang.Object
com.orientechnologies.orient.core.command.script.OAbstractScriptExecutor
com.orientechnologies.orient.core.command.script.polyglot.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.script.OAbstractScriptExecutor
EMPTY_PARAMS, language, LINES_AROUND_ERROR -
Constructor Summary
ConstructorsConstructorDescriptionOPolyglotScriptExecutor(OrientDBEmbedded context, OScriptManager scriptManager, String language, OScriptTransformer scriptTransformer) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcloseAll()org.graalvm.polyglot.ContextcreateNewResource(ODatabaseDocumentInternal database) 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, 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.script.OAbstractScriptExecutor
bind, bindContextVariables, preExecute, registerInterceptor, throwErrorMessage, unbind, unregisterInterceptor
-
Field Details
-
contextPools
protected ConcurrentHashMap<String,OResourcePool<ODatabaseDocumentInternal, contextPoolsorg.graalvm.polyglot.Context>>
-
-
Constructor Details
-
OPolyglotScriptExecutor
public OPolyglotScriptExecutor(OrientDBEmbedded context, OScriptManager scriptManager, String language, OScriptTransformer scriptTransformer)
-
-
Method Details
-
createNewResource
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
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
-