com.ibm.commerce.subscription.scheduler

Class SubscriptionSchedulerCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, SubscriptionSchedulerCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    public class SubscriptionSchedulerCmdImpl
    extends ControllerCommandImpl
    implements SubscriptionSchedulerCmd
    This command is the implementation of the SubscriptionSchedulerCmd interface. This scheduler command executes all the scheduled actions to be executed in the batch at this point of time. The command also looks ahead to find all the action within a certain interval to be executed. The look ahead interval is defined in the subscription configuration. Each action is treated as a separate transaction and processed. If a scheduled action fails, it will be retried if the action has not exhausted all its retries. If the action can be retried, the action will be moved to retry failure state. If the action cannot be retried, it will marked as failed. The scheduled action would be moved to completed state on success. This command retrieves the list of scheduled actions to be processed and invokes the appropriate action handlers.

    The command exits if an unexpected error was encountered or when it has completed executing all actions until the batch size required is reached.

    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright notice field.
        See Also:
        Constant Field Values
      • SCHEDULED_ACTIONS_QUERY

        public static final java.lang.String SCHEDULED_ACTIONS_QUERY
        The name of the query used to retrieve the list of scheduled actions.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SubscriptionSchedulerCmdImpl

        public SubscriptionSchedulerCmdImpl()
    • Method Detail

      • performExecute

        public void performExecute()
                            throws ECException
        This method executes all the scheduled actions to be executed in the batch at this point of time.
        Each action is treated as a separate transaction and processed. For each scheduled actions that were retrieved for execution, the following actions are performed:
        • The scheduled action is locked by this thread by moving it to processing.
        • The scheduled action command to execute the action is initialized
        • The scheduled action command is executed.
        • Based on the result of the execution, the action is updated.If a scheduled action fails, it will be retried if the action has not exhausted all its retries. If the action can be retried, the action will be moved to retry failure state. If the action cannot be retried, it will marked as failed. The scheduled action would be moved to completed state on success.

        The batch size is looked up from the request properties for this scheduler command. If the batch size is not specified, the default batch size is used SubscriptionSchedulerCmd.DEFAULT_BATCH_SIZE. The look ahead interval is obtained from the subscription configuration.

        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException
      • getJobProcessInterval

        public java.lang.Long getJobProcessInterval()
        This method returns the job process interval in seconds.
        Returns:
        The value of the job process interval in seconds.
      • setJobProcessInterval

        public void setJobProcessInterval(java.lang.Long interval)
        This method sets the job process interval in seconds.
        Parameters:
        interval - The value of the job process interval in seconds.