public interface AgentStatusListener
AgentStatusAggregator
to receive notifications when an agent connects or disconnects from the buses, or when
there are changes in data channels published by one of the connected agents.
Typically, a listener is registered with an AgentChannelsFilter
or with explicit sets of agents and channels to limit events that trigger notifications.
See AgentStatusAggregator for details on how the notifications are filtered.
Note that due to asynchronous nature of communication over the buses, agents are
not guaranteed to remain in the reported state by the time listeners are notified.
For every agent, the listener will receive events in the following order:
connect(event)
configure(event)
statusChanged(event)
disconnect(event)
All methods are called consecutively on a dedicated thread. Implementations of these methods should return quickly. Any time consuming or potentially blocking operations should be scheduled on separate threads.
Empty default implementations are provided for all methods.
| Modifier and Type | Method and Description |
|---|---|
default void |
configure(AgentStatusEvent event)
Called when the complete static information on the source agent (including
channels dictionary) becomes available for the first time, and when it changes.
|
default void |
connect(AgentStatusEvent event)
Called when a new agent connects to the buses.
|
default void |
disconnect(AgentStatusEvent event)
Called when an agent disconnects from the buses or goes into OFFLINE state.
|
default void |
statusChanged(AgentStatusEvent event)
Called on status change.
|
default void connect(AgentStatusEvent event)
The event passed to this method does not contain any information on channels
(corresponding methods return empty collections) or a reference to a status message.
The event can only be used to retrieve AgentInfo descriptor and a reference
to the AgentStatusAggregator instance.
The implementation should return quickly. Any blocking operations should be scheduled on a separate thread.
event - Event.default void configure(AgentStatusEvent event)
The event passed to this method contains a list of added channels. Methods accessing lists
of changed and removed channels will return empty collections. Since the configuration event
is not necessarily triggered by a status message, getMessage() method returns null.
event - Event.default void disconnect(AgentStatusEvent event)
The event passed to this method does not contain any information on channels status -
corresponding methods return empty collections. Since the disconnection event might or might not
be triggered by a status message, getMessage() method might return null.
The implementation should return quickly. Any blocking operations should be scheduled on a separate thread.
event - Event.default void statusChanged(AgentStatusEvent event)
event - event Event.Copyright © 2018 LSST. All rights reserved.