public class ActionTrackingServiceImpl extends Object implements ActionTrackingService
Constructor and Description |
---|
ActionTrackingServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected static ExecutionDetails |
buildExecutionDetails(Action action)
Builds up the details to be stored in a cache for a specific action
|
protected static ExecutionDetails |
buildExecutionDetails(Action action,
org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
Builds up the details to be stored in a cache for a specific action
|
protected static ExecutionSummary |
buildExecutionSummary(Action action) |
protected static ExecutionSummary |
buildExecutionSummary(String key)
Turns a cache key back into its constituent parts, for easier access.
|
protected static String |
generateCacheKey(Action action)
Generates the cache key for the specified action.
|
protected static String |
generateCacheKey(ExecutionSummary summary) |
List<ExecutionSummary> |
getAllExecutingActions()
Retrieve summary details of all the actions
currently executing.
|
List<ExecutionSummary> |
getExecutingActions(Action action)
Retrieve summary details of all instances of
the specified action that are currently
executing.
|
List<ExecutionSummary> |
getExecutingActions(String type)
Retrieve summary details of all the actions
of the given type that are currently executing.
|
List<ExecutionSummary> |
getExecutingActions(String type,
org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
Retrieve summary details of all the actions
of the given type acting on the given
NodeRef
that are currently executing. |
ExecutionDetails |
getExecutionDetails(ExecutionSummary executionSummary)
Retrieves the execution details on the given
executing action, such as when it started,
and what machine it is executing on.
|
boolean |
isCancellationRequested(CancellableAction action)
Has 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 called
ActionTrackingService.requestActionCancellation(CancellableAction)
for them. |
void |
recordActionComplete(Action action)
Record that an action has completed execution
without error.
|
void |
recordActionExecuting(Action action)
Record that an action has begun execution.
|
void |
recordActionExecuting(Action action,
org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
Record that an action has begun execution.
|
void |
recordActionFailure(Action action,
Throwable exception)
Schedule the recording of the action failure to occur in another
transaction
|
void |
recordActionPending(Action action)
Record that an action has been scheduled for
asynchronous execution, and is pending
being executed.
|
void |
recordActionPending(ActionImpl action) |
void |
recordActionPending(ActionImpl action,
org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef) |
void |
recordActionPending(Action action,
org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
Record that an action against a
NodeRef
has been scheduled for asynchronous execution, and is pending
being executed. |
void |
requestActionCancellation(CancellableAction action)
Requests that the specified Action cancel itself
and aborts execution, as soon as possible.
|
void |
requestActionCancellation(ExecutionSummary executionSummary)
Requests that the specified Action cancel itself
and aborts execution, as soon as possible.
|
protected void |
resetNextExecutionId()
Used by unit tests only
|
void |
setExecutingActionsCache(org.alfresco.repo.cache.SimpleCache<String,ExecutionDetails> executingActionsCache)
Sets the cache used to store details of currently executing actions,
cluster wide.
|
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Set the node service
|
void |
setRuntimeActionService(RuntimeActionService runtimeActionService)
Set the runtime action service
|
void |
setTransactionService(TransactionService transactionService)
Set the transaction service
|
public void setTransactionService(TransactionService transactionService)
transactionService
- the transaction servicepublic void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService
- the node servicepublic void setRuntimeActionService(RuntimeActionService runtimeActionService)
runtimeActionService
- the runtime action servicepublic void setExecutingActionsCache(org.alfresco.repo.cache.SimpleCache<String,ExecutionDetails> executingActionsCache)
protected void resetNextExecutionId()
public void recordActionPending(Action action)
ActionTrackingService
recordActionPending
in interface ActionTrackingService
action
- the action that has been scheduledpublic void recordActionPending(Action action, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
ActionTrackingService
NodeRef
has been scheduled for asynchronous execution, and is pending
being executed.recordActionPending
in interface ActionTrackingService
action
- the action that has been scheduledactionedUponNodeRef
- the NodeRef
the action is acting onpublic void recordActionPending(ActionImpl action)
public void recordActionPending(ActionImpl action, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
public void recordActionComplete(Action action)
ActionTrackingService
recordActionComplete
in interface ActionTrackingService
action
- the action that has been finishedpublic void recordActionExecuting(Action action)
ActionTrackingService
recordActionExecuting
in interface ActionTrackingService
action
- the action that has begun executionpublic void recordActionExecuting(Action action, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
ActionTrackingService
recordActionExecuting
in interface ActionTrackingService
action
- the action that has been scheduledactionedUponNodeRef
- the NodeRef
the action is acting onpublic void recordActionFailure(Action action, Throwable exception)
recordActionFailure
in interface ActionTrackingService
action
- the action that has failedpublic boolean isCancellationRequested(CancellableAction action)
ActionTrackingService
ActionTrackingService.requestActionCancellation(CancellableAction)
for them.isCancellationRequested
in interface ActionTrackingService
action
- The action to check aboutpublic void requestActionCancellation(CancellableAction action)
ActionTrackingService
requestActionCancellation
in interface ActionTrackingService
action
- The action to request the cancel ofpublic void requestActionCancellation(ExecutionSummary executionSummary)
ActionTrackingService
requestActionCancellation
in interface ActionTrackingService
executionSummary
- ExecutionSummarypublic List<ExecutionSummary> getAllExecutingActions()
ActionTrackingService
getAllExecutingActions
in interface ActionTrackingService
public List<ExecutionSummary> getExecutingActions(Action action)
ActionTrackingService
getExecutingActions
in interface ActionTrackingService
public List<ExecutionSummary> getExecutingActions(String type)
ActionTrackingService
getExecutingActions
in interface ActionTrackingService
type
- the action typepublic List<ExecutionSummary> getExecutingActions(String type, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
ActionTrackingService
NodeRef
that are currently executing.getExecutingActions
in interface ActionTrackingService
type
- the action typeactionedUponNodeRef
- the node the action is acting onpublic ExecutionDetails getExecutionDetails(ExecutionSummary executionSummary)
ActionTrackingService
getExecutionDetails
in interface ActionTrackingService
executionSummary
- the execution summaryprotected static String generateCacheKey(Action action)
protected static String generateCacheKey(ExecutionSummary summary)
protected static ExecutionDetails buildExecutionDetails(Action action)
protected static ExecutionDetails buildExecutionDetails(Action action, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
protected static ExecutionSummary buildExecutionSummary(String key)
protected static ExecutionSummary buildExecutionSummary(Action action)
Copyright © 2005–2017 Alfresco Software. All rights reserved.