Class AuxiliaryTablesWatchdog

java.lang.Object
de.hybris.platform.task.impl.AuxiliaryTablesWatchdog
All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean
Direct Known Subclasses:
SchedulerAuxiliaryTablesWatchdog

public abstract class AuxiliaryTablesWatchdog extends Object implements org.springframework.beans.factory.DisposableBean
Manages executor service, that allows to run only one watchdog task at the moment. The executor service uses thread poll, that creates RegistrableThread as suspendable operation. The executor service is destroyed while bean is disposed.
  • Field Details

    • NO_OP

      public static final AuxiliaryTablesWatchdogTask NO_OP
      No operation watchdog task. Provided when watchdog is disabled and start task is invoked.
  • Constructor Details

    • AuxiliaryTablesWatchdog

      protected AuxiliaryTablesWatchdog(String name)
      Creates a new watchdog instance with a specified name
      Parameters:
      name - used to identify the thread created by the thread watchdog factory
  • Method Details

    • startWatchdog

      public AuxiliaryTablesWatchdogTask startWatchdog(RuntimeConfigHolder runtimeConfigHolder, TaskEngineParameters taskEngineParameters)
      Starts watchdog task, that executes specified operation until stopped
      Parameters:
      runtimeConfigHolder - configuration holder
      taskEngineParameters - task engine run parameters
      Returns:
      watchdog task
      Throws:
      IllegalStateException - thrown when watchdog cannot start a task. This may occur when there is an attempt to execute next task while the previous is still in progress.
    • createTask

      protected abstract AuxiliaryTablesWatchdogTask createTask(RuntimeConfigHolder runtimeConfigHolder, TaskEngineParameters taskEngineParameters)
      Creates watchdog task based on runtime configuration
      Parameters:
      runtimeConfigHolder - runtime configuration provider
      taskEngineParameters - runtime parameters
      Returns:
      watchdog task
    • canRunWatchdog

      protected abstract boolean canRunWatchdog(RuntimeConfigHolder runtimeConfigHolder)
      Determines whether the watchdog can be run
      Parameters:
      runtimeConfigHolder - runtime configuration provider
      Returns:
      true if watchdog can be run
    • destroy

      public void destroy() throws Exception
      Shuts down the watchdog executor if it is active
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean
      Throws:
      Exception
    • getName

      public String getName()
      Provides watchdog name
      Returns:
      watchdog name