Class AbstractJobTerminationStateService
java.lang.Object
org.opencastproject.terminationstate.api.AbstractJobTerminationStateService
- All Implemented Interfaces:
TerminationStateService
- Direct Known Subclasses:
AutoScalingTerminationStateService,TerminationStateServiceImpl
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opencastproject.terminationstate.api.TerminationStateService
TerminationStateService.TerminationState -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected longCount the current number of jobs this node is processingprotected ServiceRegistrygetState()protected booleanIf waiting and no jobs running change the state to readyvoidsetServiceRegistry(ServiceRegistry service) OSGI dependency injection of service registryvoid
-
Constructor Details
-
AbstractJobTerminationStateService
public AbstractJobTerminationStateService()
-
-
Method Details
-
setState
- Specified by:
setStatein interfaceTerminationStateService
-
getState
- Specified by:
getStatein interfaceTerminationStateService
-
countJobs
Count the current number of jobs this node is processing- Returns:
- number jobs
- Throws:
ServiceRegistryException
-
readyToTerminate
protected boolean readyToTerminate()If waiting and no jobs running change the state to ready- Returns:
- ready to terminate
-
setServiceRegistry
OSGI dependency injection of service registry- Parameters:
service- ServiceRegistry instance
-
getServiceRegistry
-