Class AbstractJobTerminationStateService

java.lang.Object
org.opencastproject.terminationstate.api.AbstractJobTerminationStateService
All Implemented Interfaces:
TerminationStateService

public abstract class AbstractJobTerminationStateService extends Object implements TerminationStateService
AbstractJobTerminationStateService. Abstract implementation of of TerminationStateService API which checks whether there are any jobs running before changing the termination state from WAIT to READY once a termination notification has been received.
  • Constructor Details

    • AbstractJobTerminationStateService

      public AbstractJobTerminationStateService()
  • Method Details

    • setState

      public void setState(TerminationStateService.TerminationState state)
      Specified by:
      setState in interface TerminationStateService
    • getState

      Specified by:
      getState in interface TerminationStateService
    • countJobs

      protected long countJobs() throws org.opencastproject.serviceregistry.api.ServiceRegistryException
      Count the current number of jobs this node is processing
      Returns:
      number jobs
      Throws:
      org.opencastproject.serviceregistry.api.ServiceRegistryException
    • readyToTerminate

      protected boolean readyToTerminate()
      If waiting and no jobs running change the state to ready
      Returns:
      ready to terminate
    • setServiceRegistry

      public void setServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry service)
      OSGI dependency injection of service registry
      Parameters:
      service - ServiceRegistry instance
    • getServiceRegistry

      protected org.opencastproject.serviceregistry.api.ServiceRegistry getServiceRegistry()