List of usage examples for javax.management Notification setSource
public void setSource(Object source)
From source file:kr.okplace.job.support.JobExecutionNotificationPublisher.java
/** * Publish the provided message to an external listener if there is one. * //from www . j a va 2 s .c om * @param message the message to publish */ private void publish(String message) { if (notificationPublisher != null) { Notification notification = new Notification("JobExecutionApplicationEvent", this, notificationCount++, message); /* * We can't create a notification with a null source, but we can set * it to null after creation(!). We want it to be null so that * Spring will replace it automatically with the ObjectName (in * ModelMBeanNotificationPublisher). */ notification.setSource(null); notificationPublisher.sendNotification(notification); } }
From source file:org.springframework.batch.sample.jmx.JobExecutionNotificationPublisher.java
/** * Publish the provided message to an external listener if there is one. * //from w w w . j a va 2 s. com * @param message the message to publish */ private void publish(String message) { if (notificationPublisher != null) { Notification notification = new Notification("JobExecutionApplicationEvent", this, notificationCount++, message); /* * We can't create a notification with a null source, but we can set * it to null after creation(!). We want it to be null so that * Spring will replace it automatically with the ObjectName (in * ModelMBeanNotificationPublisher). */ notification.setSource(null); notificationPublisher.sendNotification(notification); } }