/** * Converts the execution context to an executor, preparing it first. * @param ec the execution context. * @return the Java Executor. */ private static Executor toExecutor(ExecutionContext ec) { ExecutionContext prepared = ec.prepare(); if (prepared instanceof Executor) { return (Executor) prepared; } else { return prepared::execute; } }
@Override public void execute(Runnable command) { executionContext.execute(command); }
@Override public void reportFailure(Throwable cause) { executionContext.reportFailure(cause); } }
/** * Converts the execution context to an executor, preparing it first. * @param ec the execution context. * @return the Java Executor. */ private static Executor toExecutor(ExecutionContext ec) { ExecutionContext prepared = ec.prepare(); if (prepared instanceof Executor) { return (Executor) prepared; } else { return prepared::execute; } }
@Override public void execute(Runnable command) { executionContext.execute(command); }
@Override public void reportFailure(Throwable cause) { executionContext.reportFailure(cause); } }
@Override public ExecutionContext prepare() { return executionContext.prepare(); }
@Override public void execute(Runnable command) { executionContext.execute(command); }
@Override public void reportFailure(Throwable cause) { executionContext.reportFailure(cause); } }
@Override public ExecutionContext prepare() { return executionContext.prepare(); }
@SuppressWarnings("unchecked") @Override final ClientActorBehavior<T> onReceiveCommand(final Object command) { if (command instanceof InternalCommand) { return ((InternalCommand<T>) command).execute(this); } if (command instanceof SuccessEnvelope) { return onRequestSuccess((SuccessEnvelope) command); } if (command instanceof FailureEnvelope) { return internalOnRequestFailure((FailureEnvelope) command); } if (MessageAssembler.isHandledMessage(command)) { context().dispatchers().getDispatcher(DispatcherType.Serialization).execute( () -> responseMessageAssembler.handleMessage(command, context().self())); return this; } if (context().messageSlicer().handleMessage(command)) { return this; } return onCommand(command); }
/** * Converts the execution context to an executor, preparing it first. * @param ec the execution context. * @return the Java Executor. */ private static Executor toExecutor(ExecutionContext ec) { ExecutionContext prepared = ec.prepare(); if (prepared instanceof Executor) { return (Executor) prepared; } else { return prepared::execute; } }
@Override public ExecutionContext prepare() { return executionContext.prepare(); }
public static Executor toExecutor(ExecutionContext ec) { ExecutionContext prepared = ec.prepare(); if (prepared instanceof Executor) { return (Executor) prepared; } else { return prepared::execute; } }
/** * Converts the execution context to an executor, preparing it first. */ private static Executor toExecutor(ExecutionContext ec) { ExecutionContext prepared = ec.prepare(); if (prepared instanceof Executor) { return (Executor) prepared; } else { return prepared::execute; } }