Package org.alfresco.repo.action
Class ActionTrackingServiceImpl
java.lang.Object
org.alfresco.repo.action.ActionTrackingServiceImpl
- All Implemented Interfaces:
ActionTrackingService
Action execution tracking service implementation
- Author:
- Nick Burch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static ExecutionDetailsbuildExecutionDetails(Action action) Builds up the details to be stored in a cache for a specific actionprotected static ExecutionDetailsbuildExecutionDetails(Action action, NodeRef actionedUponNodeRef) Builds up the details to be stored in a cache for a specific actionprotected static ExecutionSummaryTurns a cache key back into its constituent parts, for easier access.protected static ExecutionSummarybuildExecutionSummary(Action action) protected static StringgenerateCacheKey(Action action) Generates the cache key for the specified action.protected static StringgenerateCacheKey(ExecutionSummary summary) Retrieve summary details of all the actions currently executing.getExecutingActions(String type) Retrieve summary details of all the actions of the given type that are currently executing.getExecutingActions(String type, NodeRef actionedUponNodeRef) Retrieve summary details of all the actions of the given type acting on the givenNodeRefthat are currently executing.getExecutingActions(Action action) Retrieve summary details of all instances of the specified action that are currently executing.getExecutionDetails(ExecutionSummary executionSummary) Retrieves the execution details on the given executing action, such as when it started, and what machine it is executing on.booleanHas cancellation been requested for the given action? This method is most commonly called by the action in question, to check to see if someone has calledActionTrackingService.requestActionCancellation(CancellableAction)for them.voidrecordActionComplete(Action action) Record that an action has completed execution without error.voidrecordActionExecuting(Action action) Record that an action has begun execution.voidrecordActionExecuting(Action action, NodeRef actionedUponNodeRef) Record that an action has begun execution.voidrecordActionFailure(Action action, Throwable exception) Schedule the recording of the action failure to occur in another transactionvoidrecordActionPending(ActionImpl action) voidrecordActionPending(ActionImpl action, NodeRef actionedUponNodeRef) voidrecordActionPending(Action action) Record that an action has been scheduled for asynchronous execution, and is pending being executed.voidrecordActionPending(Action action, NodeRef actionedUponNodeRef) Record that an action against aNodeRefhas been scheduled for asynchronous execution, and is pending being executed.voidRequests that the specified Action cancel itself and aborts execution, as soon as possible.voidrequestActionCancellation(ExecutionSummary executionSummary) Requests that the specified Action cancel itself and aborts execution, as soon as possible.protected voidUsed by unit tests onlyvoidsetExecutingActionsCache(SimpleCache<String, ExecutionDetails> executingActionsCache) Sets the cache used to store details of currently executing actions, cluster wide.voidsetNodeService(NodeService nodeService) Set the node servicevoidsetRuntimeActionService(RuntimeActionService runtimeActionService) Set the runtime action servicevoidsetTransactionService(TransactionService transactionService) Set the transaction service
-
Constructor Details
-
ActionTrackingServiceImpl
public ActionTrackingServiceImpl()
-
-
Method Details
-
setTransactionService
Set the transaction service- Parameters:
transactionService- the transaction service
-
setNodeService
Set the node service- Parameters:
nodeService- the node service
-
setRuntimeActionService
Set the runtime action service- Parameters:
runtimeActionService- the runtime action service
-
setExecutingActionsCache
Sets the cache used to store details of currently executing actions, cluster wide. -
resetNextExecutionId
protected void resetNextExecutionId()Used by unit tests only -
recordActionPending
Description copied from interface:ActionTrackingServiceRecord that an action has been scheduled for asynchronous execution, and is pending being executed.- Specified by:
recordActionPendingin interfaceActionTrackingService- Parameters:
action- the action that has been scheduled
-
recordActionPending
Description copied from interface:ActionTrackingServiceRecord that an action against aNodeRefhas been scheduled for asynchronous execution, and is pending being executed.- Specified by:
recordActionPendingin interfaceActionTrackingService- Parameters:
action- the action that has been scheduledactionedUponNodeRef- theNodeRefthe action is acting on
-
recordActionPending
-
recordActionPending
-
recordActionComplete
Description copied from interface:ActionTrackingServiceRecord that an action has completed execution without error.- Specified by:
recordActionCompletein interfaceActionTrackingService- Parameters:
action- the action that has been finished
-
recordActionExecuting
Description copied from interface:ActionTrackingServiceRecord that an action has begun execution.- Specified by:
recordActionExecutingin interfaceActionTrackingService- Parameters:
action- the action that has begun execution
-
recordActionExecuting
Description copied from interface:ActionTrackingServiceRecord that an action has begun execution.- Specified by:
recordActionExecutingin interfaceActionTrackingService- Parameters:
action- the action that has been scheduledactionedUponNodeRef- theNodeRefthe action is acting on
-
recordActionFailure
Schedule the recording of the action failure to occur in another transaction- Specified by:
recordActionFailurein interfaceActionTrackingService- Parameters:
action- the action that has failed
-
isCancellationRequested
Description copied from interface:ActionTrackingServiceHas cancellation been requested for the given action? This method is most commonly called by the action in question, to check to see if someone has calledActionTrackingService.requestActionCancellation(CancellableAction)for them.- Specified by:
isCancellationRequestedin interfaceActionTrackingService- Parameters:
action- The action to check about- Returns:
- if cancellation has been requested or not
-
requestActionCancellation
Description copied from interface:ActionTrackingServiceRequests that the specified Action cancel itself and aborts execution, as soon as possible. Cancellable actions periodically check to see if a cancel has been requested, and will take note of the cancel request once seen.- Specified by:
requestActionCancellationin interfaceActionTrackingService- Parameters:
action- The action to request the cancel of
-
requestActionCancellation
Description copied from interface:ActionTrackingServiceRequests that the specified Action cancel itself and aborts execution, as soon as possible. Cancellable actions periodically check to see if a cancel has been requested, and will take note of the cancel request once seen. If the specified action is not a cancellable action, nothing will happen.- Specified by:
requestActionCancellationin interfaceActionTrackingService- Parameters:
executionSummary- ExecutionSummary
-
getAllExecutingActions
Description copied from interface:ActionTrackingServiceRetrieve summary details of all the actions currently executing.- Specified by:
getAllExecutingActionsin interfaceActionTrackingService- Returns:
- the execution summaries
-
getExecutingActions
Description copied from interface:ActionTrackingServiceRetrieve summary details of all instances of the specified action that are currently executing.- Specified by:
getExecutingActionsin interfaceActionTrackingService- Returns:
- the execution summaries
-
getExecutingActions
Description copied from interface:ActionTrackingServiceRetrieve summary details of all the actions of the given type that are currently executing.- Specified by:
getExecutingActionsin interfaceActionTrackingService- Parameters:
type- the action type- Returns:
- the execution summaries
-
getExecutingActions
Description copied from interface:ActionTrackingServiceRetrieve summary details of all the actions of the given type acting on the givenNodeRefthat are currently executing.- Specified by:
getExecutingActionsin interfaceActionTrackingService- Parameters:
type- the action typeactionedUponNodeRef- the node the action is acting on- Returns:
- the execution summaries
-
getExecutionDetails
Description copied from interface:ActionTrackingServiceRetrieves the execution details on the given executing action, such as when it started, and what machine it is executing on.- Specified by:
getExecutionDetailsin interfaceActionTrackingService- Parameters:
executionSummary- the execution summary- Returns:
- the execution details
-
generateCacheKey
Generates the cache key for the specified action. -
generateCacheKey
-
buildExecutionDetails
Builds up the details to be stored in a cache for a specific action -
buildExecutionDetails
Builds up the details to be stored in a cache for a specific action -
buildExecutionSummary
Turns a cache key back into its constituent parts, for easier access. -
buildExecutionSummary
-