public interface ServiceApp
The methods of this interface are calls by the service application holder to its client, the service application.
Modifier and Type | Method and Description |
---|---|
ServiceStats |
createStats(StatsOwner statsOwner)
Creates a stats instance.
|
boolean |
onAlert(Alert alert)
Called when a alert has been received.
|
boolean |
onEvent(Event event)
Called when a event has been received.
|
void |
onServicesNotReady()
Called when some services are not ready.
|
void |
onServicesReady()
Called when the pending actions processing is completed.
|
boolean |
onSignal(Signal signal)
Called when a signal has been received.
|
boolean |
setUp(Service service)
Sets up the application.
|
void |
start()
Starts the application.
|
void |
stop()
Stops the application.
|
void |
tearDown()
Tears down the application.
|
@Nonnull @CheckReturnValue ServiceStats createStats(@Nonnull StatsOwner statsOwner)
statsOwner
- The stats owner.@CheckReturnValue boolean onAlert(@Nonnull Alert alert)
Caution: this is called while synchronized on the service.
alert
- The alert.@CheckReturnValue boolean onEvent(@Nonnull Event event)
Caution: this is called while synchronized on the service.
event
- The event.void onServicesNotReady()
This is called by the pending actions processing when it not known if all registered services are ready. This may be used by a service thread to trigger some state refresh when the pending actions processing is completed; at that time, all the registered services will be ready.
void onServicesReady()
@CheckReturnValue boolean onSignal(@Nonnull Signal signal)
Caution: this is called while synchronized on the service.
signal
- The signal.@CheckReturnValue boolean setUp(@Nonnull Service service)
Overidden as needed.
Called by the framework and by overriding classes at the beginning of the override.
service
- The service holding this application.void start()
Overidden as needed by the application.
Called by the framework.
Should return only when the application is started.
void stop()
Overidden as needed by the application.
Called by the framework.
void tearDown()
Overidden as needed by the application.
Called by the framework and by overriding classes at the end of the override.
Copyright © 2003-2019 Serge Brisson. All Rights Reserved.