Search in sources :

Example 36 with Notification

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

the class ManagementAdapter method handleAsyncEventQueueCreation.

public void handleAsyncEventQueueCreation(AsyncEventQueue queue) throws ManagementException {
    if (!isServiceInitialised("handleAsyncEventQueueCreation")) {
        return;
    }
    AsyncEventQueueMBeanBridge bridge = new AsyncEventQueueMBeanBridge(queue);
    AsyncEventQueueMXBean queueMBean = new AsyncEventQueueMBean(bridge);
    ObjectName senderObjectName = MBeanJMXAdapter.getAsycnEventQueueMBeanName(internalCache.getDistributedSystem().getDistributedMember(), queue.getId());
    ObjectName changedMBeanName = service.registerInternalMBean(queueMBean, senderObjectName);
    service.federate(changedMBeanName, AsyncEventQueueMXBean.class, true);
    Notification notification = new Notification(JMXNotificationType.ASYNC_EVENT_QUEUE_CREATED, memberSource, SequenceNumber.next(), System.currentTimeMillis(), ManagementConstants.ASYNC_EVENT_QUEUE_CREATED_PREFIX);
    memberLevelNotifEmitter.sendNotification(notification);
}
Also used : AsyncEventQueueMXBean(org.apache.geode.management.AsyncEventQueueMXBean) Notification(javax.management.Notification) ObjectName(javax.management.ObjectName)

Example 37 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 38 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 39 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 40 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)

Aggregations

Notification (javax.management.Notification)204 ObjectName (javax.management.ObjectName)68 NotificationListener (javax.management.NotificationListener)35 AttributeChangeNotification (javax.management.AttributeChangeNotification)29 CompositeData (javax.management.openmbean.CompositeData)25 IOException (java.io.IOException)23 Test (org.junit.Test)20 HashMap (java.util.HashMap)19 MalformedObjectNameException (javax.management.MalformedObjectNameException)19 Test (org.testng.annotations.Test)18 ListenerNotFoundException (javax.management.ListenerNotFoundException)17 ArrayList (java.util.ArrayList)16 MBeanServer (javax.management.MBeanServer)16 NotificationFilter (javax.management.NotificationFilter)15 NotificationEmitter (javax.management.NotificationEmitter)14 JMXConnector (javax.management.remote.JMXConnector)14 JMXServiceURL (javax.management.remote.JMXServiceURL)14 MBeanServerConnection (javax.management.MBeanServerConnection)12 MalformedURLException (java.net.MalformedURLException)11 JMXConnectorServer (javax.management.remote.JMXConnectorServer)11