org.alfresco.repo.action.scheduled
Class AbstractScheduledAction

java.lang.Object
  extended by org.alfresco.repo.action.scheduled.AbstractScheduledAction
All Implemented Interfaces:
ScheduledActionDefinition, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
CronScheduledQueryBasedTemplateActionDefinition

public abstract class AbstractScheduledAction
extends java.lang.Object
implements ScheduledActionDefinition

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.


Nested Class Summary
static class AbstractScheduledAction.CompensatingActionMode
          Enum to define if compensating actions are run.
static class AbstractScheduledAction.JobDefinition
          Job definition to run scheduled action
static class AbstractScheduledAction.Pair
          Simple class to hold to related objects
static class AbstractScheduledAction.TransactionMode
          Enum to define the transaction mode.
 
Constructor Summary
AbstractScheduledAction()
          Simple constructor
 
Method Summary
abstract  Action getAction(org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Generate the actual action for the given node from the action template.
 ActionService getActionService()
          Get the actions service.
 AbstractScheduledAction.CompensatingActionMode getCompensatingActionModeEnum()
          Get the behaviour for compensating actions.
abstract  java.util.List getNodes()
          Get the list of nodes against which this action should run.
 java.lang.String getRunAsUser()
          Get the user in whose name to run the action.
 TemplateActionDefinition getTemplateActionDefinition()
          Get the template definition.
 AbstractScheduledAction.TransactionMode getTransactionModeEnum()
          Get the transaction mode.
 TransactionService getTransactionService()
          Get the transaction service.
abstract  org.quartz.Trigger getTrigger()
          Get the trigger definition for this job.
 void register(org.quartz.Scheduler scheduler)
          Register with teh scheduler.
 void setActionService(ActionService actionService)
          Set the action service - IOC.
 void setCompensatingActionMode(java.lang.String compensatingActionModeString)
          Set the behaviour for compensating actiions.
 void setRunAsUser(java.lang.String runAsUser)
          Set the user in whose name to run the action.
 void setTemplateActionDefinition(TemplateActionDefinition templateActionDefinition)
          Set the template action that is used to generate the real action for each node.
 void setTransactionMode(java.lang.String transactionModeString)
          Set transactional behaviour.
 void setTransactionService(TransactionService transactionService)
          Set the transactions service - IOC.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.alfresco.repo.action.scheduled.ScheduledActionDefinition
getJobGroup, getJobName, getTriggerGroup, getTriggerName, setJobGroup, setJobName, setTriggerGroup, setTriggerName
 
Methods inherited from interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
 

Constructor Detail

AbstractScheduledAction

public AbstractScheduledAction()
Simple constructor

Method Detail

getRunAsUser

public java.lang.String getRunAsUser()
Get the user in whose name to run the action.

Returns:
- the user as whom to run the action

setRunAsUser

public void setRunAsUser(java.lang.String runAsUser)
Set the user in whose name to run the action.

Parameters:
runAsUser -

getTemplateActionDefinition

public TemplateActionDefinition getTemplateActionDefinition()
Get the template definition.

Specified by:
getTemplateActionDefinition in interface ScheduledActionDefinition
Returns:
- the template action definition

setActionService

public void setActionService(ActionService actionService)
Set the action service - IOC.

Parameters:
actionService -

getActionService

public ActionService getActionService()
Get the actions service.

Returns:
- the action service

setCompensatingActionMode

public void setCompensatingActionMode(java.lang.String compensatingActionModeString)
Set the behaviour for compensating actiions.

Parameters:
compensatingActionModeString -

setTransactionMode

public void setTransactionMode(java.lang.String transactionModeString)
Set transactional behaviour.

Parameters:
transactionModeString -

getTransactionService

public TransactionService getTransactionService()
Get the transaction service.

Returns:
- the transaction service.

setTransactionService

public void setTransactionService(TransactionService transactionService)
Set the transactions service - IOC.

Parameters:
transactionService -

setTemplateActionDefinition

public void setTemplateActionDefinition(TemplateActionDefinition templateActionDefinition)
Set the template action that is used to generate the real action for each node.

Specified by:
setTemplateActionDefinition in interface ScheduledActionDefinition
Parameters:
templateActionDefinition -

getCompensatingActionModeEnum

public AbstractScheduledAction.CompensatingActionMode getCompensatingActionModeEnum()
Get the behaviour for compensating actions.

Returns:
- the compensating action mode.

getTransactionModeEnum

public AbstractScheduledAction.TransactionMode 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:
register in interface ScheduledActionDefinition
Parameters:
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

public abstract java.util.List 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

public abstract Action getAction(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Generate the actual action for the given node from the action template.

Parameters:
nodeRef -
Returns:
- the action to execute.


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.