Package com.avoka.core.groovy.runtime
Class GroovyScriptContext
java.lang.Object
com.avoka.core.groovy.runtime.GroovyScriptContext
Provides thread local Groovy script execution context class.
- Since:
- 4.0.0
-
Constructor Summary
ConstructorDescriptionGroovyScriptContext
(Map<String, Object> parameters) Create a Groovy script execution object with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionReturn the Groovy script invocation parameters.Return the Groovy script execution result object.static GroovyScriptContext
Return the thread local Groovy Script execution context object.protected static int
Return the thread local context stack size.static boolean
Return true if the thread stack is executing in the context of a Groovy Console scriptstatic boolean
Return true if the thread stack is executing in the context of a Groovy Scriptstatic boolean
Return true if the thread is executing a Unit Test scriptprotected static GroovyScriptContext
Set the thread local Groovy Script execution context object.protected static GroovyScriptContext
Set the thread local Groovy Script execution context object.static void
setGroovyConsoleExecution
(Boolean value) Set whether Groovy Console Script is executing.protected static void
setGroovyExecution
(Boolean value) Set whether Groovy Script is executing.void
Set the Groovy script execution result object.static void
setUnitTestExecution
(Boolean value) Set whether a Unit Test script is executing.
-
Constructor Details
-
GroovyScriptContext
Create a Groovy script execution object with the given parameters.- Parameters:
parameters
- the Groovy script invocation parameters
-
-
Method Details
-
getParameters
Return the Groovy script invocation parameters.- Returns:
- the Groovy script invocation parameters
-
getResult
Return the Groovy script execution result object.- Returns:
- the Groovy script execution result object
-
setResult
Set the Groovy script execution result object.- Parameters:
result
- the Groovy script execution result object
-
getThreadLocalContext
Return the thread local Groovy Script execution context object.- Returns:
- the thread local Groovy Script execution context object.
-
inGroovyScriptExecuting
public static boolean inGroovyScriptExecuting()Return true if the thread stack is executing in the context of a Groovy Script- Returns:
- true if the thread stack is executing in the context of a Groovy Script
- Since:
- 4.2.0
-
inGroovyConsoleScriptExecuting
public static boolean inGroovyConsoleScriptExecuting()Return true if the thread stack is executing in the context of a Groovy Console script- Returns:
- true if the thread stack is executing in the context of a Groovy Console script
- Since:
- 4.2.0
-
setGroovyConsoleExecution
Set whether Groovy Console Script is executing.- Parameters:
value
- set whether Groovy Console Script is executing.- Since:
- 4.2.0
-
isUnitTestExecuting
public static boolean isUnitTestExecuting()Return true if the thread is executing a Unit Test script- Returns:
- true if the thread is executing a Unit Test script
- Since:
- 4.3.0
-
setUnitTestExecution
Set whether a Unit Test script is executing.- Parameters:
value
- set whether a Unit Test script is executing- Since:
- 4.3.0
-
pushThreadLocalContext
Set the thread local Groovy Script execution context object.- Parameters:
context
- the Groovy Script execution context object to set in the local thread- Returns:
- the thread local context pushed on the stack
-
popThreadLocalContext
Set the thread local Groovy Script execution context object.- Parameters:
context
- the Groovy Script execution context object to set in the local thread- Returns:
- the thread local context popped off the stack
-
getThreadLocalStackSize
protected static int getThreadLocalStackSize()Return the thread local context stack size.- Returns:
- the thread local context stack size.
-
setGroovyExecution
Set whether Groovy Script is executing.- Parameters:
value
- set whether Groovy Script is executing.- Since:
- 4.2.0
-