Class GroovyActionsServiceImpl
- All Implemented Interfaces:
GroovyActionsService
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interface -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends groovy.lang.Script>Retrieves a pre-compiled script class from cache.getScriptMetadata(String actionName) Retrieves script metadata for monitoring and change detection.voidvoidRemoves a Groovy action and all associated metadata.voidSaves a Groovy action script with compilation and validation.voidsetDefinitionsService(DefinitionsService definitionsService) voidsetPersistenceService(PersistenceService persistenceService) voidsetSchedulerService(SchedulerService schedulerService) voidstart(GroovyActionsServiceImpl.GroovyActionsServiceConfig config, org.osgi.framework.BundleContext bundleContext)
-
Constructor Details
-
GroovyActionsServiceImpl
public GroovyActionsServiceImpl()
-
-
Method Details
-
setDefinitionsService
-
setPersistenceService
-
setSchedulerService
-
start
public void start(GroovyActionsServiceImpl.GroovyActionsServiceConfig config, org.osgi.framework.BundleContext bundleContext) -
onDestroy
public void onDestroy() -
save
Saves a Groovy action script with compilation and validation.This method compiles the script, validates it has the required annotations, persists it, and updates the internal cache. If the script content hasn't changed, recompilation is skipped. Implementation performs hash-based change detection to skip unnecessary recompilation.
- Specified by:
savein interfaceGroovyActionsService- Parameters:
actionName- the unique identifier for the actiongroovyScript- the Groovy script source code
-
remove
Removes a Groovy action and all associated metadata.This method removes the action from both the cache and persistent storage, and cleans up any registered action types in the definitions service.
- Specified by:
removein interfaceGroovyActionsService- Parameters:
actionName- the unique identifier of the action to remove
-
getCompiledScript
Retrieves a pre-compiled script class from cache.This is the preferred method for script execution as it returns pre-compiled classes without any compilation overhead. Returns
nullif the script is not found in the cache.- Specified by:
getCompiledScriptin interfaceGroovyActionsService- Parameters:
id- the unique identifier of the action- Returns:
- the compiled script class, or
nullif not found in cache
-
getScriptMetadata
Retrieves script metadata for monitoring and change detection.The returned metadata includes content hash, compilation timestamp, and the compiled class reference. This is useful for monitoring tools and debugging.
- Specified by:
getScriptMetadatain interfaceGroovyActionsService- Parameters:
actionName- the unique identifier of the action- Returns:
- the script metadata, or
nullif not found
-