Package com.mongodb.event
Interface ClusterListener
- All Superinterfaces:
EventListener
- All Known Implementing Classes:
ClusterListenerAdapter
A listener for cluster-related events.
It does not have to be thread-safe. All events received by ClusterListener, ServerListener,
ServerMonitorListener are totally ordered (and the event order implies the happens-before order), provided that the listeners
are not shared by different MongoClients. This means that even if you have a single class implementing all of
ClusterListener, ServerListener, ServerMonitorListener, it does not have to be thread-safe.
- Since:
- 3.3
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidclusterClosed(ClusterClosedEvent event) Invoked when a cluster is closed.default voidInvoked when a cluster description changes.default voidInvoked when a cluster is opened.
-
Method Details
-
clusterOpening
Invoked when a cluster is opened.- Parameters:
event- the event
-
clusterClosed
Invoked when a cluster is closed.- Parameters:
event- the event
-
clusterDescriptionChanged
Invoked when a cluster description changes.- Parameters:
event- the event
-