private void close0() { if (!closed) { closed = true; for (;;) { AcquireTask task = pendingAcquireQueue.poll(); if (task == null) { break; } ScheduledFuture<?> f = task.timeoutFuture; if (f != null) { f.cancel(false); } task.promise.setFailure(new ClosedChannelException()); } acquiredChannelCount.set(0); pendingAcquireCount = 0; // Ensure we dispatch this on another Thread as close0 will be called from the EventExecutor and we need // to ensure we will not block in a EventExecutor. GlobalEventExecutor.INSTANCE.execute(new Runnable() { @Override public void run() { FixedChannelPool.super.close(); } }); } } }
private void close0() { if (!closed) { closed = true; for (;;) { AcquireTask task = pendingAcquireQueue.poll(); if (task == null) { break; } ScheduledFuture<?> f = task.timeoutFuture; if (f != null) { f.cancel(false); } task.promise.setFailure(new ClosedChannelException()); } acquiredChannelCount.set(0); pendingAcquireCount = 0; // Ensure we dispatch this on another Thread as close0 will be called from the EventExecutor and we need // to ensure we will not block in a EventExecutor. GlobalEventExecutor.INSTANCE.execute(new Runnable() { @Override public void run() { FixedChannelPool.super.close(); } }); } } }
private void close0() { if (!closed) { closed = true; for (;;) { AcquireTask task = pendingAcquireQueue.poll(); if (task == null) { break; } ScheduledFuture<?> f = task.timeoutFuture; if (f != null) { f.cancel(false); } task.promise.setFailure(new ClosedChannelException()); } acquiredChannelCount.set(0); pendingAcquireCount = 0; // Ensure we dispatch this on another Thread as close0 will be called from the EventExecutor and we need // to ensure we will not block in a EventExecutor. GlobalEventExecutor.INSTANCE.execute(new Runnable() { @Override public void run() { FixedChannelPool.super.close(); } }); } } }
public FibManagerImpl(final NexthopManager nexthopManager, final VrfEntryListener vrfEntryListener, final BundleContext bundleContext) { this.nexthopManager = nexthopManager; this.vrfEntryListener = vrfEntryListener; GlobalEventExecutor.INSTANCE.execute(new Runnable() { @Override public void run() { final WaitingServiceTracker<IVpnManager> tracker = WaitingServiceTracker.create( IVpnManager.class, bundleContext); vpnmanager = tracker.waitForService(WaitingServiceTracker.FIVE_MINUTES); LOG.info("FibManagerImpl initialized. IVpnManager={}", vpnmanager); } }); }
public FloatingIPListener(final DataBroker dataBroker, final IMdsalApiManager mdsalManager, final OdlInterfaceRpcService interfaceManager, final IdManagerService idManager, final BundleContext bundleContext) { super(IpMapping.class); this.dataBroker = dataBroker; this.mdsalManager = mdsalManager; this.interfaceManager = interfaceManager; this.idManager = idManager; GlobalEventExecutor.INSTANCE.execute(new Runnable() { @Override public void run() { final WaitingServiceTracker<FloatingIPHandler> tracker = WaitingServiceTracker.create( FloatingIPHandler.class, bundleContext); floatingIPHandler = tracker.waitForService(WaitingServiceTracker.FIVE_MINUTES); LOG.info("FloatingIPListener initialized. FloatingIPHandler={}", floatingIPHandler); } }); }
private static void completeFuture(CompletableFuture<Void> future) { if (GlobalEventExecutor.INSTANCE.inEventLoop()) { future.complete(null); } else { GlobalEventExecutor.INSTANCE.execute(() -> future.complete(null)); } }
private static void completeFutureExceptionally(CompletableFuture<Void> future, Throwable cause) { if (GlobalEventExecutor.INSTANCE.inEventLoop()) { future.completeExceptionally(cause); } else { GlobalEventExecutor.INSTANCE.execute(() -> future.completeExceptionally(cause)); } }
private void close0() { if (!closed) { closed = true; for (;;) { AcquireTask task = pendingAcquireQueue.poll(); if (task == null) { break; } ScheduledFuture<?> f = task.timeoutFuture; if (f != null) { f.cancel(false); } task.promise.setFailure(new ClosedChannelException()); } acquiredChannelCount.set(0); pendingAcquireCount = 0; // Ensure we dispatch this on another Thread as close0 will be called from the EventExecutor and we need // to ensure we will not block in a EventExecutor. GlobalEventExecutor.INSTANCE.execute(new Runnable() { @Override public void run() { FixedChannelPool.super.close(); } }); } } }
GlobalEventExecutor.INSTANCE.execute(new Runnable() { @Override public void run() {