@Override public void close() { progressors.forEach( IndexProgressor::close ); }
/** * Closes this deframer and frees any resources. After this method is called, additional * calls will have no effect. */ @Override public void close() { try { if (unprocessed != null) { unprocessed.forEach(ByteBuf::release); } } finally { unprocessed = null; } }
/** * Notify observers about changes. * * @param segmentId Segment which was been changed. */ void notifyObservers(long segmentId) { observers.forEach(observer -> observer.accept(segmentId)); } }
/** * Disconnects and destroys all bridges */ public void stop() { done=true; bridges.forEach(Bridge::stop); bridges.clear(); }
@Override public void close() { // cancel futures if available cancelQuietly(splitFuture); dataRequests.forEach(ThriftIndexPageSource::cancelQuietly); }
public void process() { if (!queuedMessages.isEmpty()) { queuedMessages.forEach(this::add); queuedMessages.clear(); } }
/** * Closes the session. */ public boolean close() { if (open.compareAndSet(true, false)) { futures.forEach(future -> future.completeExceptionally(new IllegalStateException("Closed session"))); return true; } return false; } }
backoff.getFailureDuration().convertTo(SECONDS), backoff.getFailureRequestTimeTotal().convertTo(SECONDS))); errorsSinceLastSuccess.forEach(exception::addSuppressed); throw exception;
@Test public void shouldFilterByExclusionRegex() { basicReader().withExclusionRegex(".*good.*").execute(); assertThat(capturedOutput.size(), is(24)); capturedOutput.forEach(msg -> assertThat(msg, not(containsString("goodbye")))); }
@Override public void forEach(final Consumer action) { queue.forEach(action); }
/** * Set the recipients for this router. * @param recipients The recipients. */ public void setRecipients(List<Recipient> recipients) { Assert.notEmpty(recipients, "'recipients' must not be empty"); Queue<Recipient> newRecipients = new ConcurrentLinkedQueue<>(recipients); newRecipients.forEach(this::setupRecipient); if (logger.isDebugEnabled()) { logger.debug("Channel Recipients: " + this.recipients + " replaced with: " + newRecipients); } this.recipients = newRecipients; }
@Override protected void onInit() { super.onInit(); this.recipients.forEach(this::setupRecipient); }
@Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (AnnotatedElementUtils.isAnnotated(AopUtils.getTargetClass(bean), IntegrationManagedResource.class.getName())) { this.siBeanNames.add(beanName); this.mBeanExportersForExcludes.forEach(mBeanExporter -> mBeanExporter.addExcludedBean(beanName)); } if (bean instanceof MBeanExporter && !(bean instanceof IntegrationMBeanExporter)) { MBeanExporter mBeanExporter = (MBeanExporter) bean; this.mBeanExportersForExcludes.add(mBeanExporter); this.siBeanNames.forEach(mBeanExporter::addExcludedBean); } return bean; }
@Override public void close() { progressors.forEach( IndexProgressor::close ); }
/** * @param action * @see java.lang.Iterable#forEach(java.util.function.Consumer) */ public void forEach(Consumer<? super T> action) { list.forEach(action); }
/** * Iterators constructor. * @param iterators The iterators to join. * @throws NullPointerException if any of the given iterators is <code>null</code>. */ public JoinIterator(@Nonnull final Stream<Iterator<E>> iterators) { iteratorQueue = iterators.collect(toCollection(LinkedList::new)); iteratorQueue.forEach(Objects::requireNonNull); }
@Override public final void close() { shutdown = true; handlerExecutorCache.invalidateAll(); handlerExecutorCache.cleanUp(); handlerExecutorPool.forEach(HandlerTaskExecutor::close); handlerExecutorPool.clear(); }
@Override public void delete() { if (lock != null) { lock.close(); } queue.forEach(Commit::close); queue.clear(); timers.values().forEach(Scheduled::cancel); timers.clear(); }
void reset() { exportedServices.forEach(key -> astrixTestContext.setProxyState(key.getBeanType(), key.getQualifier(), null)); exportedServices.clear(); testApiByType.clear(); testApis.forEach(this::ensureLoaded); }
@Override protected void onInit() { super.onInit(); this.recipients.forEach(recipient -> recipient.setChannelResolver(getChannelResolver())); }