- public java.lang.AutoCloseable createInstance() {
- return getThreadCount()==null ? new NioEventLoopGroupCloseable() : new NioEventLoopGroupCloseable(getThreadCount());
- }
-
+ public AutoCloseable createInstance() {
+ // The service is provided via blueprint so wait for and return it here for backwards compatibility.
+ String typeFilter = String.format("(type=%s)", getIdentifier().getInstanceName());
+ final WaitingServiceTracker<EventLoopGroup> tracker = WaitingServiceTracker.create(
+ EventLoopGroup.class, bundleContext, typeFilter);
+ final EventLoopGroup group = tracker.waitForService(WaitingServiceTracker.FIVE_MINUTES);