Package com.sap.cds.services.application
Interface ApplicationLifecycleService
- All Superinterfaces:
Service
The interface for the technical service which indicates application's lifecycle events.
Handlers of the
ApplicationLifecycleService
are notified on several application events.
E.g. ApplicationLifecycleService#EVENT_APPLICATION_PREPARED
is sent when all application
objects have been initialized but the adapters hasn't been started yet. For Spring applications all beans
are available.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
Called when the application is fully initialized but not started yet.void
Called when the application is stopped to allow termination of regular task threads.errorResponse
(ServiceException exception) Called by protocol adapters to control transformation of exception and messages into an error response.
-
Field Details
-
DEFAULT_NAME
- See Also:
-
EVENT_APPLICATION_PREPARED
- See Also:
-
EVENT_APPLICATION_STOPPED
- See Also:
-
EVENT_ERROR_RESPONSE
- See Also:
-
-
Method Details
-
applicationPrepared
void applicationPrepared()Called when the application is fully initialized but not started yet. -
applicationStopped
void applicationStopped()Called when the application is stopped to allow termination of regular task threads. Please note, that it is not guaranteed that this event is fired, if the application is terminated. This event is especially useful in Spring contexts, to gracefully handle closing of an ApplicationContext. -
errorResponse
Called by protocol adapters to control transformation of exception and messages into an error response. This event can be used to augment standard response.- Parameters:
exception
- theServiceException
- Returns:
- the
ErrorResponseEventContext.ErrorResponse
-