Class AbstractScheduledAction
java.lang.Object
org.alfresco.repo.action.scheduled.AbstractScheduledAction
- All Implemented Interfaces:
ScheduledActionDefinition,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
CronScheduledQueryBasedTemplateActionDefinition
Abstract action support.
Each action applies to a set of nodes.
These actions may be executed in one overall transaction or one individual transaction. If actions are in individual transactions an error may halt subsequent execution or
processing can try and invoke the action for each node.
- Author:
- Andy Hind
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum to define if compensating actions are run.static classJob definition to run scheduled actionstatic classSimple class to hold to related objectsstatic enumEnum to define the transaction mode. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ActionGenerate the actual action for the given node from the action template.Get the actions service.Get the behaviour for compensating actions.getNodes()Get the list of nodes against which this action should run.Get the user in whose name to run the action.Get the template definition.Get the transaction mode.Get the transaction service.abstract org.quartz.TriggerGet the trigger definition for this job.voidregister(org.quartz.Scheduler scheduler) Register with teh scheduler.voidsetActionService(ActionService actionService) Set the action service - IOC.voidsetCompensatingActionMode(String compensatingActionModeString) Set the behaviour for compensating actiions.voidsetRunAsUser(String runAsUser) Set the user in whose name to run the action.voidsetTemplateActionDefinition(TemplateActionDefinition templateActionDefinition) Set the template action that is used to generate the real action for each node.voidsetTransactionMode(String transactionModeString) Set transactional behaviour.voidsetTransactionService(TransactionService transactionService) Set the transactions service - IOC.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.InitializingBean
afterPropertiesSetMethods inherited from interface org.alfresco.repo.action.scheduled.ScheduledActionDefinition
getJobGroup, getJobName, getTriggerGroup, getTriggerName, setJobGroup, setJobName, setTriggerGroup, setTriggerName
-
Constructor Details
-
AbstractScheduledAction
public AbstractScheduledAction()Simple constructor
-
-
Method Details
-
getRunAsUser
Get the user in whose name to run the action.- Returns:
- - the user as whom to run the action
-
setRunAsUser
Set the user in whose name to run the action.- Parameters:
runAsUser- String
-
getTemplateActionDefinition
Get the template definition.- Specified by:
getTemplateActionDefinitionin interfaceScheduledActionDefinition- Returns:
- - the template action definition
-
setActionService
Set the action service - IOC.- Parameters:
actionService- ActionService
-
getActionService
Get the actions service.- Returns:
- - the action service
-
setCompensatingActionMode
Set the behaviour for compensating actiions.- Parameters:
compensatingActionModeString- String
-
setTransactionMode
Set transactional behaviour.- Parameters:
transactionModeString- String
-
getTransactionService
Get the transaction service.- Returns:
- - the transaction service.
-
setTransactionService
Set the transactions service - IOC.- Parameters:
transactionService- TransactionService
-
setTemplateActionDefinition
Set the template action that is used to generate the real action for each node.- Specified by:
setTemplateActionDefinitionin interfaceScheduledActionDefinition- Parameters:
templateActionDefinition- TemplateActionDefinition
-
getCompensatingActionModeEnum
Get the behaviour for compensating actions.- Returns:
- - the compensating action mode.
-
getTransactionModeEnum
Get the transaction mode.- Returns:
- - the transaction mode.
-
register
public void register(org.quartz.Scheduler scheduler) throws org.quartz.SchedulerException Register with teh scheduler.- Specified by:
registerin interfaceScheduledActionDefinition- Parameters:
scheduler- Scheduler- Throws:
org.quartz.SchedulerException
-
getTrigger
public abstract org.quartz.Trigger getTrigger()Get the trigger definition for this job. Used to register with the injected scheduler.- Returns:
- - the trigger definition for this scheduled action.
-
getNodes
Get the list of nodes against which this action should run.- Returns:
- - the list of node refs for which to run this action.
-
getAction
Generate the actual action for the given node from the action template.- Parameters:
nodeRef- NodeRef- Returns:
- - the action to execute.
-