Interface StatefulService
- All Superinterfaces:
AutoCloseable, Service, ShutdownableService, SuspendableService
- All Known Subinterfaces:
BacklogDebugger, ContextServiceLoaderPluginResolver
- All Known Implementing Classes:
ServiceSupport, Transformer, Validator
A
Service that exposes its current ServiceStatus together with the full lifecycle, including
suspend/resume from SuspendableService and shutdown from ShutdownableService.
Most Camel built-in services extend this contract via ServiceSupport in camel-support, so route code
can ask any service whether it is started, suspended, stopping, etc.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the current statusbooleanHelper methods so the service knows if it should keep running.booleanWhether the service is startedbooleanWhether the service is startingbooleanWhether the service is stoppedbooleanWhether the service is stoppingbooleanWhether the service is suspendingMethods inherited from interface ShutdownableService
shutdownMethods inherited from interface SuspendableService
isSuspended, resume, suspend
-
Method Details
-
getStatus
-
isStarted
boolean isStarted()Whether the service is started- Returns:
- true if this service has been started
-
isStarting
boolean isStarting()Whether the service is starting- Returns:
- true if this service is being started
-
isStopping
boolean isStopping()Whether the service is stopping- Returns:
- true if this service is in the process of stopping
-
isStopped
boolean isStopped()Whether the service is stopped- Returns:
- true if this service is stopped
-
isSuspending
boolean isSuspending()Whether the service is suspending- Returns:
- true if this service is in the process of suspending
-
isRunAllowed
boolean isRunAllowed()Helper methods so the service knows if it should keep running. Returns false if the service is being stopped or is stopped.- Returns:
- true if the service should continue to run.
-