/** * sendNotification * * @param eventType * @param data * @param msg */ public void sendNotification(String eventType, Object data, String msg) { Notification notif = new Notification(eventType, this, sequenceNumber .incrementAndGet(), System.currentTimeMillis(), msg); if (data != null) { notif.setUserData(data); } emitter.sendNotification(notif); }
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) { NotificationKey key = new NotificationKey(name); notification.setUserData(memberSource); repo.putEntryInLocalNotificationRegion(key, notification); }
notif.setUserData(notifBytes); this.modelMBean.sendNotification(notif);
/** * Called to broadcast message on MBeanServer event bus. Internally, it calls * NotificationBroadCasterSupport.sendNotification() method to dispatch the event. * * @param data - a data object sent as part of the event parameter. * @return a sequence number associated with the emitted event. */ public long send(Object data) { long seq = NumberSequencer.getNextSequence(); Notification note = new Notification( this.getEvent(), this, seq, System.currentTimeMillis(), "Event notification " + this.getEvent() ); note.setUserData(data); super.sendNotification(note); return seq; }
/** * Implementation handles creation of region by extracting the details from the given event object * and sending the {@link SystemMemberJmx#NOTIF_REGION_CREATED} notification to the connected JMX * Clients. Region Path is set as User Data in Notification. * * @param event event object corresponding to the creation of a region */ @Override public void handleRegionCreate(SystemMemberRegionEvent event) { Notification notification = new Notification(NOTIF_REGION_CREATED, this.modelMBean, Helper.getNextNotificationSequenceNumber(), Helper.getRegionEventDetails(event)); notification.setUserData(event.getRegionPath()); Helper.sendNotification(this, notification); }
/** * Implementation handles creation of region by extracting the details from the given event object * and sending the {@link SystemMemberJmx#NOTIF_REGION_CREATED} notification to the connected JMX * Clients. Region Path is set as User Data in Notification. * * @param event event object corresponding to the creation of a region */ @Override public void handleRegionCreate(SystemMemberRegionEvent event) { Notification notification = new Notification(NOTIF_REGION_CREATED, this.modelMBean, Helper.getNextNotificationSequenceNumber(), Helper.getRegionEventDetails(event)); notification.setUserData(event.getRegionPath()); Helper.sendNotification(this, notification); }
/** * Sends the alert with the Object source as member. This notification will get filtered out for * particular alert level * */ protected void handleSystemNotification(AlertDetails details) { if (!isServiceInitialised("handleSystemNotification")) { return; } if (service.isManager()) { String systemSource = "DistributedSystem(" + service.getDistributedSystemMXBean().getDistributedSystemId() + ")"; Map<String, String> userData = prepareUserData(details); Notification notification = new Notification(JMXNotificationType.SYSTEM_ALERT, systemSource, SequenceNumber.next(), details.getMsgTime().getTime(), details.getMsg()); notification.setUserData(userData); service.handleNotification(notification); } }
/** * Implementation should handle loss of region by extracting the details from the given event * object and sending the {@link SystemMemberJmx#NOTIF_REGION_LOST} notification to the connected * JMX Clients. Region Path is set as User Data in Notification. Additionally, it also clears the * ManagedResources created for the region that is lost. * * @param event event object corresponding to the loss of a region */ @Override public void handleRegionLoss(SystemMemberRegionEvent event) { SystemMemberCacheJmxImpl cacheResource = this.managedSystemMemberCache; if (cacheResource != null) { ManagedResource cleanedUp = cacheResource.cleanupRegionResources(event.getRegionPath()); if (cleanedUp != null) { MBeanUtil.unregisterMBean(cleanedUp); } } Notification notification = new Notification(NOTIF_REGION_LOST, this.modelMBean, Helper.getNextNotificationSequenceNumber(), Helper.getRegionEventDetails(event)); notification.setUserData(event.getRegionPath()); Helper.sendNotification(this, notification); } }
/** * Implementation should handle loss of region by extracting the details from the given event * object and sending the {@link SystemMemberJmx#NOTIF_REGION_LOST} notification to the connected * JMX Clients. Region Path is set as User Data in Notification. Additionally, it also clears the * ManagedResources created for the region that is lost. * * @param event event object corresponding to the loss of a region */ @Override public void handleRegionLoss(SystemMemberRegionEvent event) { SystemMemberCacheJmxImpl cacheResource = this.managedSystemMemberCache; if (cacheResource != null) { ManagedResource cleanedUp = cacheResource.cleanupRegionResources(event.getRegionPath()); if (cleanedUp != null) { MBeanUtil.unregisterMBean(cleanedUp); } } Notification notification = new Notification(NOTIF_REGION_LOST, this.modelMBean, Helper.getNextNotificationSequenceNumber(), Helper.getRegionEventDetails(event)); notification.setUserData(event.getRegionPath()); Helper.sendNotification(this, notification); } }
public Notification fromMessage(Message<?> message) { String type = resolveNotificationType(message); Assert.hasText(type, "No notification type header is available, and no default has been provided."); Object payload = message.getPayload(); String notificationMessage = (payload instanceof String) ? (String) payload : null; Notification notification = new Notification(type, this.sourceObjectName, this.sequence.incrementAndGet(), System.currentTimeMillis(), notificationMessage); if (!(payload instanceof String)) { notification.setUserData(payload); } return notification; }
/** * sendNotification * * @param eventType * @param data * @param msg */ public void sendNotification(String eventType, Object data, String msg) { Notification notif = new Notification(eventType, this, sequenceNumber.incrementAndGet(), System.currentTimeMillis(), msg); if (data != null) { notif.setUserData(data); } emitter.sendNotification(notif); }
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); }
public void onFailure(Throwable t) { Notification notif = new Notification(StreamEvent.class.getCanonicalName() + ".failure", StreamManagerMBean.OBJECT_NAME, seq.getAndIncrement()); notif.setUserData(t.fillInStackTrace().toString()); sendNotification(notif); } }
public void onFailure(Throwable t) { Notification notif = new Notification(StreamEvent.class.getCanonicalName() + ".failure", StreamManagerMBean.OBJECT_NAME, seq.getAndIncrement()); notif.setUserData(t.fillInStackTrace().toString()); sendNotification(notif); } }
public void onSuccess(StreamState result) { Notification notif = new Notification(StreamEvent.class.getCanonicalName() + ".success", StreamManagerMBean.OBJECT_NAME, seq.getAndIncrement()); notif.setUserData(StreamStateCompositeData.toCompositeData(result)); sendNotification(notif); }
public void onSuccess(StreamState result) { Notification notif = new Notification(StreamEvent.class.getCanonicalName() + ".success", StreamManagerMBean.OBJECT_NAME, seq.getAndIncrement()); notif.setUserData(StreamStateCompositeData.toCompositeData(result)); sendNotification(notif); }
public void featureEvent(FeatureEvent event) { if (!event.isReplay()) { Notification notification = new Notification(FEATURE_EVENT_TYPE, objectName, sequenceNumber++); notification.setUserData(new JmxFeatureEvent(event).asCompositeData()); sendNotification(notification); } }
public void repositoryEvent(RepositoryEvent event) { if (!event.isReplay()) { Notification notification = new Notification(REPOSITORY_EVENT_TYPE, objectName, sequenceNumber++); notification.setUserData(new JmxRepositoryEvent(event).asCompositeData()); 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); }