Class ScheduledPersistedActionServiceImpl
java.lang.Object
org.alfresco.repo.action.scheduled.ScheduledPersistedActionServiceImpl
- All Implemented Interfaces:
ScheduledPersistedActionService
public class ScheduledPersistedActionServiceImpl
extends Object
implements ScheduledPersistedActionService
A service which handles the scheduling of the execution of persisted actions. It handles registering them with the Quartz scheduler on repository start, and handles the edit, creation and deletion of them.
- Since:
- 3.4
- Author:
- Nick Burch
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe thing that Quartz runs when the schedule fires.static classThis is used to trigger the loading of previously persisted schedules on an application startup. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddToScheduler(ScheduledPersistedActionImpl schedule) Builds up the Quartz details, and adds it to the Quartz scheduler when the transaction completes.protected org.quartz.JobDetailbuildJobDetail(ScheduledPersistedActionImpl schedule) createSchedule(Action persistedAction) Creates a new schedule, for the specified Action.voiddeleteSchedule(ScheduledPersistedAction schedule) Removes the schedule for the action, and cancels future executions of it.getSchedule(Action persistedAction) Returns the schedule for the specified action, or null if it isn't currently scheduled.getSchedule(NodeRef persistedActionNodeRef) Returns the schedule for the specified action nodeRef, or null if it isn't currently scheduled.Returns all currently scheduled actions.protected ScheduledPersistedActionImplloadPersistentSchedule(NodeRef schedule) protected voidprotected voidTakes an entry out of the scheduler, if it's currently there.voidsaveSchedule(ScheduledPersistedAction schedule) Saves the changes to the schedule to the repository, and updates the Scheduler with any changed details.voidFind all our previously persisted scheduled actions, and tell the scheduler to start handling them.voidsetBehaviourFilter(BehaviourFilter behaviourFilter) voidsetNodeService(NodeService nodeService) voidsetRepositoryHelper(Repository repositoryHelper) voidsetRuntimeActionService(RuntimeActionService runtimeActionService) voidsetScheduler(org.quartz.Scheduler scheduler) voidsetStartupNodeService(NodeService startupNodeService) Sets the node service to use during startup, which won't do permissions check etc
-
Field Details
-
JOB_SCHEDULE_NODEREF
- See Also:
-
JOB_ACTION_NODEREF
- See Also:
-
SCHEDULED_ACTION_ROOT_NODE_REF
-
ACTION_TYPES
-
SCHEDULER_GROUP
- See Also:
-
-
Constructor Details
-
ScheduledPersistedActionServiceImpl
public ScheduledPersistedActionServiceImpl()
-
-
Method Details
-
setBehaviourFilter
-
setScheduler
public void setScheduler(org.quartz.Scheduler scheduler) -
setNodeService
-
setStartupNodeService
Sets the node service to use during startup, which won't do permissions check etc -
setRepositoryHelper
-
setRuntimeActionService
-
locatePersistanceFolder
protected void locatePersistanceFolder() -
schedulePreviouslyPersisted
public void schedulePreviouslyPersisted()Find all our previously persisted scheduled actions, and tell the scheduler to start handling them. Called by spring when startup is complete. -
createSchedule
Creates a new schedule, for the specified Action.- Specified by:
createSchedulein interfaceScheduledPersistedActionService
-
saveSchedule
Saves the changes to the schedule to the repository, and updates the Scheduler with any changed details.- Specified by:
saveSchedulein interfaceScheduledPersistedActionService
-
deleteSchedule
Removes the schedule for the action, and cancels future executions of it. The persisted action is unchanged.- Specified by:
deleteSchedulein interfaceScheduledPersistedActionService
-
getSchedule
Description copied from interface:ScheduledPersistedActionServiceReturns the schedule for the specified action, or null if it isn't currently scheduled.- Specified by:
getSchedulein interfaceScheduledPersistedActionService
-
getSchedule
Description copied from interface:ScheduledPersistedActionServiceReturns the schedule for the specified action nodeRef, or null if it isn't currently scheduled.- Specified by:
getSchedulein interfaceScheduledPersistedActionService
-
listSchedules
Returns all currently scheduled actions.- Specified by:
listSchedulesin interfaceScheduledPersistedActionService
-
loadPersistentSchedule
-
removeFromScheduler
Takes an entry out of the scheduler, if it's currently there. -
addToScheduler
Builds up the Quartz details, and adds it to the Quartz scheduler when the transaction completes. We have to wait for the transaction to finish, otherwise Quartz may end up trying and failing to load the details of a job that hasn't been committed to the repo yet! -
buildJobDetail
-