Interface QRuntimeServiceInterface
- All Known Implementing Classes:
EsbRuntimeService,HealthRuntimeService,RealtimeRuntimeService
public interface QRuntimeServiceInterface
A long-running service that an application starts along with its server,
and stops at shutdown (e.g., a message consumer). Registered via
QInstance.withRuntimeService; an application launcher loads each one (via
QCodeLoader, so it needs a no-arg constructor), starts them in registration
order, and stops them in reverse order.
If start throws, the launcher stops the services it had already started
(not the one that threw), and fails. stop is called at most once per
started service, and should not throw.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidRelease application-owned resources after the launcher has attempted every service stop, including scheduler and HTTP shutdown.getName()Name of the service, for logs and errors.voidStart the service, for the application's (validated) instance.voidstop()Stop the service's work.
-
Method Details
-
getName
String getName()Name of the service, for logs and errors. -
start
Start the service, for the application's (validated) instance.- Throws:
QException
-
stop
void stop()Stop the service's work. Resources shared with other application work may be released in afterApplicationStop instead, once all stops are attempted. -
afterApplicationStop
default void afterApplicationStop()Release application-owned resources after the launcher has attempted every service stop, including scheduler and HTTP shutdown. Called at most once for each successfully started service, including failed application startup. No QContext is guaranteed. Failed or timed-out stops may leave work running; this callback does not extend their deadlines or force that work to finish.
-