Example usage for java.util.function BiConsumer accept

List of usage examples for java.util.function BiConsumer accept

Introduction

In this page you can find the example usage for java.util.function BiConsumer accept.

Prototype

void accept(T t, U u);

Source Link

Document

Performs this operation on the given arguments.

Usage

From source file:org.sonar.db.DBSessionsImplTest.java

private void verifyDelegation(boolean batchOrRegular, boolean firstCall, BiConsumer<DbSession, DbSession> r) {
    when(myBatis.openSession(batchOrRegular)).thenReturn(myBatisDbSession).thenThrow(oneCallTooMuch());
    r.accept(myBatisDbSession, underTest.openSession(batchOrRegular));
    verify(myBatisDbSession, times(firstCall ? 1 : 0)).getSqlSession();
    verifyNoMoreInteractions(myBatisDbSession);
    reset(myBatis, myBatisDbSession);//from   w  ww. j a v a  2 s .  co m
}

From source file:org.springframework.test.web.reactive.server.LoggingActions.java

private ResponseAssertions<T> doLog(Predicate<Log> predicate, BiConsumer<Log, String> consumer) {
    if (predicate.test(logger)) {
        consumer.accept(logger, getOutput());
    }/*w  w w  . j ava 2 s .c  o  m*/
    return this.resultAssertions;
}

From source file:org.springframework.test.web.reactive.server.LoggingExchangeConsumer.java

private ExchangeActions doLog(Predicate<Log> logLevelPredicate, BiConsumer<Log, String> logAction) {
    if (logLevelPredicate.test(logger)) {
        logAction.accept(logger, this.exchangeInfo.toString());
    }/*from w ww  .j ava 2s  .c om*/
    return this.exchangeActions;
}

From source file:sh.isaac.api.LookupService.java

/**
 * start all core isaac services in a background thread, returning
 * immediately.//from ww  w  .  j a  v a  2  s . c o m
 *
 * @param callWhenStartComplete (optional) - if provided, a call back will
 * be provided notifying of successfully start of ISAAC, or providing the
 * Exception, if the startup sequence failed.
 */
public static void startupIsaac(BiConsumer<Boolean, Exception> callWhenStartComplete) {
    LOG.info("Background starting ISAAC services");
    Get.applicationStates().add(ApplicationStates.STARTING);

    final Thread backgroundLoad = new Thread(() -> {
        try {
            startupIsaac();
            LOG.info("Background start complete - runlevel now "
                    + getService(RunLevelController.class).getCurrentRunLevel());

            if (callWhenStartComplete != null) {
                callWhenStartComplete.accept(isIsaacStarted(), null);
            }
        } catch (final Exception e) {
            LOG.warn("Background start failed - runlevel now "
                    + getService(RunLevelController.class).getCurrentRunLevel(), e);

            if (callWhenStartComplete != null) {
                callWhenStartComplete.accept(false, e);
            }
        }
    }, "Datastore init thread");

    backgroundLoad.start();
}

From source file:shuffle.fwk.data.simulation.SimulationTask.java

public void executeFinishedActions(ActivateComboEffect comboEffect) {
    if (finishedActions.isEmpty()) {
        return;/*  w  ww  .ja  v a  2 s .co  m*/
    }
    Collection<BiConsumer<ActivateComboEffect, SimulationTask>> toActivate = new ArrayList<BiConsumer<ActivateComboEffect, SimulationTask>>(
            finishedActions);
    finishedActions.clear();
    for (BiConsumer<ActivateComboEffect, SimulationTask> action : toActivate) {
        action.accept(comboEffect, this);
    }
}