use of org.opendaylight.controller.messagebus.spi.EventSourceRegistry in project controller by opendaylight.
the class MessageBusAppImplModule method createInstance.
@Override
public java.lang.AutoCloseable createInstance() {
final WaitingServiceTracker<EventSourceRegistry> tracker = WaitingServiceTracker.create(EventSourceRegistry.class, bundleContext);
final EventSourceRegistry service = tracker.waitForService(WaitingServiceTracker.FIVE_MINUTES);
return new EventSourceRegistry() {
@Override
public void close() {
// We need to close the WaitingServiceTracker however we don't want to close the actual
// service instance because its life-cycle is controlled via blueprint.
tracker.close();
}
@Override
public <T extends EventSource> EventSourceRegistration<T> registerEventSource(T eventSource) {
return service.registerEventSource(eventSource);
}
};
}
Aggregations