use of org.xwiki.observation.remote.RemoteObservationManager in project xwiki-platform by xwiki.
the class LocalEventListener method onEvent.
@Override
public void onEvent(Event event, Object source, Object data) {
if (this.remoteObservationManager == null) {
try {
// Make sure to not receive events until RemoteObservationManager is ready
ObservationManager om = this.componentManager.getInstance(ObservationManager.class);
om.removeListener(getName());
this.remoteObservationManager = this.componentManager.getInstance(RemoteObservationManager.class);
om.addListener(this);
this.remoteObservationManager.notify(new LocalEventData(event, source, data));
} catch (ComponentLookupException e) {
this.logger.error("Failed to initialize the Remote Observation Manager", e);
}
} else {
this.remoteObservationManager.notify(new LocalEventData(event, source, data));
}
}
Aggregations