use of org.bedework.sysevents.events.SysEventBase.Attribute in project bw-calendar-engine by Bedework.
the class JmsNotificationsHandlerImpl method post.
@Override
public void post(final SysEventBase ev) throws NotificationException {
if (debug) {
debug(ev.toString());
}
long start = System.currentTimeMillis();
send: {
if (ev instanceof MillisecsEvent) {
monitor.post(ev);
if ((ev instanceof TimedEvent) || (ev instanceof HttpEvent)) {
break send;
}
}
syslog.post(ev);
boolean changeEvent = false;
for (final Attribute attr : ev.getMessageAttributes()) {
if (!"changeEvent".equals(attr.name)) {
continue;
}
changeEvent = Boolean.valueOf(attr.value);
break;
}
if (changeEvent) {
changes.post(ev);
}
if (ev instanceof EntityQueuedEvent) {
final EntityQueuedEvent eqe = (EntityQueuedEvent) ev;
if (((EntityQueuedEvent) ev).getInBox()) {
scheduleIn.post(ev);
} else {
scheduleOut.post(ev);
break send;
}
}
if (ev instanceof ScheduleUpdateEvent) {
scheduleIn.post(ev);
}
}
// send
sends++;
sendTime += System.currentTimeMillis() - start;
if ((sends % 100) == 0) {
debug("Sends: " + sends + " avg: " + sendTime / sends);
}
}
Aggregations