use of javax.management.Notification in project groovy by apache.
the class JmxEventEmitter method send.
/**
* 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;
}
use of javax.management.Notification in project camel by apache.
the class SimpleBean method touch.
public void touch() {
Notification n = new Notification("touched", this, mSequence++, mTimestamp, "I was touched");
sendNotification(n);
}
use of javax.management.Notification in project camel by apache.
the class JMXNotificationTraceEventHandler method traceExchange.
public void traceExchange(ProcessorDefinition<?> node, Processor target, TraceInterceptor traceInterceptor, Exchange exchange) throws Exception {
if (notificationSender != null && tracer.isJmxTraceNotifications()) {
String body = MessageHelper.extractBodyForLogging(exchange.getIn(), "", false, true, tracer.getTraceBodySize());
if (body == null) {
body = "";
}
String message = body.substring(0, Math.min(body.length(), MAX_MESSAGE_LENGTH));
Map<String, Object> tm = createTraceMessage(node, exchange, body);
Notification notification = new Notification("TraceNotification", exchange.toString(), num.getAndIncrement(), System.currentTimeMillis(), message);
notification.setUserData(tm);
notificationSender.sendNotification(notification);
}
}
use of javax.management.Notification in project quasar by puniverse.
the class MonitoringServices method addPerfNotificationListener.
public synchronized void addPerfNotificationListener(NotificationListener listener, Object handback) {
timer.addNotificationListener(listener, new NotificationFilter() {
@Override
public boolean isNotificationEnabled(Notification notification) {
return "perfTimer".equals(notification.getType());
}
}, handback);
perfTimerListeners++;
manageTimer();
}
use of javax.management.Notification in project quasar by puniverse.
the class MonitoringServices method addStructuralNotificationListener.
public synchronized void addStructuralNotificationListener(NotificationListener listener, Object handback) {
timer.addNotificationListener(listener, new NotificationFilter() {
@Override
public boolean isNotificationEnabled(Notification notification) {
return "structTimer".equals(notification.getType());
}
}, handback);
structuralTimerListeners++;
manageTimer();
}
Aggregations