/** * As this proxy may behave as an notification emitter it delegates to the member * NotificationBroadcasterSupport object * */ private void sendNotification(Object notification) { emitter.sendNotification((Notification) notification); }
@Override public void sendNotification(Notification notification) throws MBeanException, RuntimeOperationsException { if (m_generalBroadcaster != null) { m_generalBroadcaster.sendNotification(notification); } }
/** * Invoked when a client has gracefully disconnected from this process or when this process has * gracefully disconnected from a CacheServer. */ @Override public void memberLeft(ClientMembershipEvent event) { Notification notification = new Notification(JMXNotificationType.CLIENT_LEFT, serverSource, SequenceNumber.next(), System.currentTimeMillis(), ManagementConstants.CLIENT_LEFT_PREFIX + event.getMemberId()); serverLevelNotifEmitter.sendNotification(notification); memberLevelNotifEmitter.sendNotification(notification); }
/** * Invoked when a client has unexpectedly disconnected from this process or when this process * has unexpectedly disconnected from a CacheServer. */ @Override public void memberCrashed(ClientMembershipEvent event) { Notification notification = new Notification(JMXNotificationType.CLIENT_CRASHED, serverSource, SequenceNumber.next(), System.currentTimeMillis(), ManagementConstants.CLIENT_CRASHED_PREFIX + event.getMemberId()); serverLevelNotifEmitter.sendNotification(notification); memberLevelNotifEmitter.sendNotification(notification); }
/** * Invoked when a client has connected to this process or when this process has connected to a * CacheServer. */ @Override public void memberJoined(ClientMembershipEvent event) { Notification notification = new Notification(JMXNotificationType.CLIENT_JOINED, serverSource, SequenceNumber.next(), System.currentTimeMillis(), ManagementConstants.CLIENT_JOINED_PREFIX + event.getMemberId()); serverLevelNotifEmitter.sendNotification(notification); memberLevelNotifEmitter.sendNotification(notification); }
public void addAppenderEvent(Category logger, Appender appender) { log.debug("addAppenderEvent called: logger="+logger.getName()+ ", appender="+appender.getName()); Notification n = new Notification(ADD_APPENDER+logger.getName(), this, 0); n.setUserData(appender); log.debug("sending notification."); nbs.sendNotification(n); }
@Override public void handleNotification(Notification notification, Object handback) { notification.setSequenceNumber(SequenceNumber.next()); systemLevelNotifEmitter.sendNotification(notification); } }
protected void handleGatewaySenderStop(GatewaySender sender) throws ManagementException { if (!isServiceInitialised("handleGatewaySenderStop")) { return; } Notification notification = new Notification(JMXNotificationType.GATEWAY_SENDER_STOPPED, memberSource, SequenceNumber.next(), System.currentTimeMillis(), ManagementConstants.GATEWAY_SENDER_STOPPED_PREFIX + sender.getId()); memberLevelNotifEmitter.sendNotification(notification); }
public void memberDeparted(InternalDistributedMember id, boolean crashed) { Notification notification = new Notification(JMXNotificationType.CACHE_MEMBER_DEPARTED, MBeanJMXAdapter.getMemberNameOrUniqueId(id), SequenceNumber.next(), System.currentTimeMillis(), ManagementConstants.CACHE_MEMBER_DEPARTED_PREFIX + MBeanJMXAdapter.getMemberNameOrUniqueId(id) + " has crashed = " + crashed); systemLevelNotifEmitter.sendNotification(notification); }
protected void handleGatewaySenderResumed(GatewaySender sender) throws ManagementException { if (!isServiceInitialised("handleGatewaySenderResumed")) { return; } Notification notification = new Notification(JMXNotificationType.GATEWAY_SENDER_RESUMED, memberSource, SequenceNumber.next(), System.currentTimeMillis(), ManagementConstants.GATEWAY_SENDER_RESUMED_PREFIX + sender.getId()); memberLevelNotifEmitter.sendNotification(notification); }
protected void handleGatewaySenderPaused(GatewaySender sender) throws ManagementException { if (!isServiceInitialised("handleGatewaySenderPaused")) { return; } Notification notification = new Notification(JMXNotificationType.GATEWAY_SENDER_PAUSED, memberSource, SequenceNumber.next(), System.currentTimeMillis(), ManagementConstants.GATEWAY_SENDER_PAUSED_PREFIX + sender.getId()); memberLevelNotifEmitter.sendNotification(notification); }
public void memberJoined(InternalDistributedMember id) { Notification notification = new Notification(JMXNotificationType.CACHE_MEMBER_JOINED, MBeanJMXAdapter.getMemberNameOrUniqueId(id), SequenceNumber.next(), System.currentTimeMillis(), ManagementConstants.CACHE_MEMBER_JOINED_PREFIX + MBeanJMXAdapter.getMemberNameOrUniqueId(id)); systemLevelNotifEmitter.sendNotification(notification); }
public void memberSuspect(InternalDistributedMember id, InternalDistributedMember whoSuspected) { Notification notification = new Notification(JMXNotificationType.CACHE_MEMBER_SUSPECT, MBeanJMXAdapter.getMemberNameOrUniqueId(id), SequenceNumber.next(), System.currentTimeMillis(), ManagementConstants.CACHE_MEMBER_SUSPECT_PREFIX + MBeanJMXAdapter.getMemberNameOrUniqueId(id) + " By : " + whoSuspected.getName()); systemLevelNotifEmitter.sendNotification(notification); } }
@Override public void sendAttributeChangeNotification(AttributeChangeNotification notification) throws MBeanException, RuntimeOperationsException { if (notification == null) throw new RuntimeOperationsException(new IllegalArgumentException( "Notification cannot be null.")); getAttributeChangeBroadcaster().sendNotification(notification); Logger modelMBeanLogger = getModelMBeanLogger(notification.getType()); if (modelMBeanLogger != null) if (modelMBeanLogger.isEnabledFor(Logger.DEBUG)) modelMBeanLogger.debug("ModelMBean log: " + new Date() + " - " + notification); Logger logger = getLogger(); if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Attribute change notification " + notification + " sent"); }
/** * Handles Gateway receiver creation * * @param recv specific gateway receiver */ protected void handleGatewayReceiverStop(GatewayReceiver recv) throws ManagementException { if (!isServiceInitialised("handleGatewayReceiverStop")) { return; } GatewayReceiverMBean mbean = (GatewayReceiverMBean) service.getLocalGatewayReceiverMXBean(); GatewayReceiverMBeanBridge bridge = mbean.getBridge(); bridge.stopServer(); Notification notification = new Notification(JMXNotificationType.GATEWAY_RECEIVER_STOPPED, memberSource, SequenceNumber.next(), System.currentTimeMillis(), ManagementConstants.GATEWAY_RECEIVER_STOPPED_PREFIX); memberLevelNotifEmitter.sendNotification(notification); }
private void createGatewayReceiverMBean(GatewayReceiver recv) { GatewayReceiverMBeanBridge bridge = new GatewayReceiverMBeanBridge(recv); GatewayReceiverMXBean receiverMBean = new GatewayReceiverMBean(bridge); ObjectName recvObjectName = MBeanJMXAdapter .getGatewayReceiverMBeanName(internalCache.getDistributedSystem().getDistributedMember()); ObjectName changedMBeanName = service.registerInternalMBean(receiverMBean, recvObjectName); service.federate(changedMBeanName, GatewayReceiverMXBean.class, true); Notification notification = new Notification(JMXNotificationType.GATEWAY_RECEIVER_CREATED, memberSource, SequenceNumber.next(), System.currentTimeMillis(), ManagementConstants.GATEWAY_RECEIVER_CREATED_PREFIX); memberLevelNotifEmitter.sendNotification(notification); }
protected 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); }
@Test public void testNotifications() { uaaMetricsEmitter.enableNotification(); emitter.sendNotification(new Notification("/api", 45L, 0)); Mockito.verify(statsDClient).time("requests.api.latency", 45L); }
protected void handleAsyncEventQueueCreation(AsyncEventQueue queue) throws ManagementException { if (!isServiceInitialised("handleAsyncEventQueueCreation")) { return; } AsyncEventQueueMBeanBridge bridge = new AsyncEventQueueMBeanBridge(queue); AsyncEventQueueMXBean queueMBean = new AsyncEventQueueMBean(bridge); ObjectName senderObjectName = MBeanJMXAdapter.getAsyncEventQueueMBeanName( 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); }
protected void handleGatewaySenderRemoved(GatewaySender sender) throws ManagementException { if (!isServiceInitialised("handleGatewaySenderRemoved")) { return; } if ((sender.getRemoteDSId() < 0)) { return; } GatewaySenderMBean bean = (GatewaySenderMBean) service.getLocalGatewaySenderMXBean(sender.getId()); bean.stopMonitor(); ObjectName gatewaySenderName = MBeanJMXAdapter.getGatewaySenderMBeanName( internalCache.getDistributedSystem().getDistributedMember(), sender.getId()); service.unregisterMBean(gatewaySenderName); Notification notification = new Notification(JMXNotificationType.GATEWAY_SENDER_REMOVED, memberSource, SequenceNumber.next(), System.currentTimeMillis(), ManagementConstants.GATEWAY_SENDER_REMOVED_PREFIX + sender.getId()); memberLevelNotifEmitter.sendNotification(notification); }