Search in sources :

Example 46 with Notification

use of javax.management.Notification in project geode by apache.

the class DistributedSystemBridge method memberSuspect.

public void memberSuspect(InternalDistributedMember id, InternalDistributedMember whoSuspected) {
    Notification notification = new Notification(JMXNotificationType.CACHE_MEMBER_SUSPECT, MBeanJMXAdapter.getMemberNameOrId(id), SequenceNumber.next(), System.currentTimeMillis(), ManagementConstants.CACHE_MEMBER_SUSPECT_PREFIX + MBeanJMXAdapter.getMemberNameOrId(id) + " By : " + whoSuspected.getName());
    systemLevelNotifEmitter.sendNotification(notification);
}
Also used : Notification(javax.management.Notification)

Example 47 with Notification

use of javax.management.Notification in project geode by apache.

the class DistributedSystemBridge method memberJoined.

public void memberJoined(InternalDistributedMember id) {
    Notification notification = new Notification(JMXNotificationType.CACHE_MEMBER_JOINED, MBeanJMXAdapter.getMemberNameOrId(id), SequenceNumber.next(), System.currentTimeMillis(), ManagementConstants.CACHE_MEMBER_JOINED_PREFIX + MBeanJMXAdapter.getMemberNameOrId(id));
    systemLevelNotifEmitter.sendNotification(notification);
}
Also used : Notification(javax.management.Notification)

Example 48 with Notification

use of javax.management.Notification in project geode by apache.

the class DistributedSystemBridge method memberDeparted.

public void memberDeparted(InternalDistributedMember id, boolean crashed) {
    Notification notification = new Notification(JMXNotificationType.CACHE_MEMBER_DEPARTED, MBeanJMXAdapter.getMemberNameOrId(id), SequenceNumber.next(), System.currentTimeMillis(), ManagementConstants.CACHE_MEMBER_DEPARTED_PREFIX + MBeanJMXAdapter.getMemberNameOrId(id) + " has crashed = " + crashed);
    systemLevelNotifEmitter.sendNotification(notification);
}
Also used : Notification(javax.management.Notification)

Example 49 with Notification

use of javax.management.Notification in project geode by apache.

the class ManagementAdapter method handleGatewaySenderStart.

public void handleGatewaySenderStart(GatewaySender sender) throws ManagementException {
    if (!isServiceInitialised("handleGatewaySenderStart")) {
        return;
    }
    if ((sender.getRemoteDSId() < 0)) {
        return;
    }
    GatewaySenderMBean bean = (GatewaySenderMBean) service.getLocalGatewaySenderMXBean(sender.getId());
    bean.getBridge().setDispatcher();
    Notification notification = new Notification(JMXNotificationType.GATEWAY_SENDER_STARTED, memberSource, SequenceNumber.next(), System.currentTimeMillis(), ManagementConstants.GATEWAY_SENDER_STARTED_PREFIX + sender.getId());
    memberLevelNotifEmitter.sendNotification(notification);
}
Also used : Notification(javax.management.Notification)

Example 50 with Notification

use of javax.management.Notification in project geode by apache.

the class ManagementAdapter method handleAsyncEventQueueRemoval.

/**
   * Handles AsyncEventQueue Removal
   *
   * @param queue The AsyncEventQueue being removed
   */
public void handleAsyncEventQueueRemoval(AsyncEventQueue queue) throws ManagementException {
    if (!isServiceInitialised("handleAsyncEventQueueRemoval")) {
        return;
    }
    ObjectName asycnEventQueueMBeanName = MBeanJMXAdapter.getAsycnEventQueueMBeanName(internalCache.getDistributedSystem().getDistributedMember(), queue.getId());
    AsyncEventQueueMBean bean;
    try {
        bean = (AsyncEventQueueMBean) service.getLocalAsyncEventQueueMXBean(queue.getId());
        if (bean == null) {
            return;
        }
    } catch (ManagementException e) {
        // If no bean found its a NO-OP
        if (logger.isDebugEnabled()) {
            logger.debug(e.getMessage(), e);
        }
        return;
    }
    bean.stopMonitor();
    service.unregisterMBean(asycnEventQueueMBeanName);
    Notification notification = new Notification(JMXNotificationType.ASYNC_EVENT_QUEUE_CLOSED, memberSource, SequenceNumber.next(), System.currentTimeMillis(), ManagementConstants.ASYNC_EVENT_QUEUE_CLOSED_PREFIX + queue.getId());
    memberLevelNotifEmitter.sendNotification(notification);
}
Also used : ManagementException(org.apache.geode.management.ManagementException) Notification(javax.management.Notification) ObjectName(javax.management.ObjectName)

Aggregations

Notification (javax.management.Notification)134 ObjectName (javax.management.ObjectName)47 NotificationListener (javax.management.NotificationListener)30 AttributeChangeNotification (javax.management.AttributeChangeNotification)22 HashMap (java.util.HashMap)16 MBeanServer (javax.management.MBeanServer)15 JMXConnector (javax.management.remote.JMXConnector)14 JMXServiceURL (javax.management.remote.JMXServiceURL)14 NotificationFilter (javax.management.NotificationFilter)13 MBeanServerConnection (javax.management.MBeanServerConnection)12 JMXConnectorServer (javax.management.remote.JMXConnectorServer)11 Test (org.junit.Test)11 IOException (java.io.IOException)10 MBeanServerNotification (javax.management.MBeanServerNotification)9 ArrayList (java.util.ArrayList)8 Attribute (javax.management.Attribute)8 ListenerNotFoundException (javax.management.ListenerNotFoundException)7 CompositeData (javax.management.openmbean.CompositeData)7 JMXConnectionNotification (javax.management.remote.JMXConnectionNotification)7 MalformedURLException (java.net.MalformedURLException)6