public interface Alerter
Classes implementing this interface take the responsibility of the
transport of Alert objects between related services.
Each service must have its own instance of the class.
| Modifier and Type | Interface and Description |
|---|---|
static class |
Alerter.Abstract
Abstract alerter.
|
static class |
Alerter.Factory
Alerter factory.
|
static interface |
Alerter.Listener
Alert listener.
|
static class |
Alerter.SharedContext
Shared context.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addListener(Alerter.Listener listener)
Adds a listener.
|
Optional<Alerter> |
getActiveInstance()
Gets the active instance.
|
boolean |
isEmbedded()
Asks if this alerter is embedded.
|
boolean |
isRunning()
Asks if this alerter is running.
|
boolean |
isShared()
Gets the shared indicator.
|
boolean |
isStealth()
Gets the stealth indicator.
|
boolean |
removeListener(Alerter.Listener listener)
Removes a listener.
|
void |
send(Alert alert)
Sends an alert.
|
boolean |
setUp(Config config,
KeyedGroups alerterProperties,
Thread.UncaughtExceptionHandler owner)
Sets up the alerter.
|
void |
start()
Starts.
|
void |
stop()
Stops.
|
void |
tearDown()
Tears down what has been set up.
|
@CheckReturnValue
boolean addListener(@Nonnull
Alerter.Listener listener)
listener - The listener to be added.@Nonnull @CheckReturnValue Optional<Alerter> getActiveInstance()
@CheckReturnValue boolean isEmbedded()
@CheckReturnValue boolean isRunning()
@CheckReturnValue boolean isShared()
@CheckReturnValue boolean isStealth()
@CheckReturnValue
boolean removeListener(@Nonnull
Alerter.Listener listener)
listener - The listener to be removed.void send(@Nonnull
Alert alert)
throws InterruptedException,
ServiceNotAvailableException
alert - The alert.InterruptedException - When the service is stopped.ServiceNotAvailableException - When the service is not available.@CheckReturnValue
boolean setUp(@Nonnull
Config config,
@Nonnull
KeyedGroups alerterProperties,
@Nonnull
Thread.UncaughtExceptionHandler owner)
config - The service configuration.alerterProperties - The alerter configuration properties.owner - The alerter owner.void start()
throws InterruptedException
InterruptedException - When interrupted.void stop()
void tearDown()
Copyright © 2003-2019 Serge Brisson. All Rights Reserved.