public interface NotificationManager
For Standard MBeans that implement the NotificationEmitter interface and Platform MBeans registered with the Coherence Registry, notifications will be automatically sent to the corresponding MBean within the Coherence domain (e.g. "Coherence:type=Platform,Domain=java.lang,subType=Memory,nodeId=1"). Additionally, application logic can send notifications using the NotificationManager as follows:
Cluster cluster = CacheFactory.ensureCluster();
Registry registry = cluster.getManagement();
NotificationManager manager = registry.getNotificationManger();
String sName = registry.ensureGlobalName("type=CustomMBean");
if (manager.isSubscribedTo(sName))
{
manager.trigger(sName, "custom.notification.type", "Custom notification message");
}
| Modifier and Type | Method and Description |
|---|---|
boolean |
isSubscribedTo(String sName)
Determine if any subscriptions exist for the specified MBean.
|
void |
trigger(String sName, Notification notification)
Trigger the notification on subscribers for a given MBean.
|
void |
trigger(String sName, String sType, String sMessage)
Trigger the notification on subscribers for a given MBean.
|
boolean isSubscribedTo(String sName)
sName - the MBean name to check for subscriptionsvoid trigger(String sName, String sType, String sMessage) throws IllegalArgumentException
sName - the MBean namesType - the notification typesMessage - the notification messageIllegalArgumentException - if an MBean with the specified name does not existsvoid trigger(String sName, Notification notification) throws IllegalArgumentException
Note: if the specified Notification object has a negative SequenceNumber, it will be automatically assigned.
sName - the MBean namenotification - the notification objectIllegalArgumentException - if an MBean with the specified name does not exists