class StandardProcessScheduler implements ProcessScheduler {

    @Override
    public synchronized CompletableFuture<Void> startProcessor(final ProcessorNode procNode, final boolean failIfStopping) {
        final LifecycleState lifecycleState = getLifecycleState(requireNonNull(procNode), true);

        final StandardProcessContext processContext = new StandardProcessContext(procNode, this.controllerServiceProvider,
            this.encryptor, getStateManager(procNode.getIdentifier()), lifecycleState::isTerminated);

        final CompletableFuture<Void> future = new CompletableFuture<>();
        final SchedulingAgentCallback callback = new SchedulingAgentCallback() {
            @Override
            public void trigger() {
                lifecycleState.clearTerminationFlag();
                getSchedulingAgent(procNode).schedule(procNode, lifecycleState);
                future.complete(null);
            }

            @Override
            public Future<?> scheduleTask(final Callable<?> task) {
                lifecycleState.incrementActiveThreadCount(null);
                return componentLifeCycleThreadPool.submit(task);
            }

            @Override
            public void onTaskComplete() {
                lifecycleState.decrementActiveThreadCount(null);
            }
        };

        LOG.info("Starting {}", procNode);
        procNode.start(this.componentMonitoringThreadPool, this.administrativeYieldMillis, processContext, callback, failIfStopping);
        return future;
    }

    public  StandardProcessScheduler(final FlowEngine componentLifecycleThreadPool, final FlowController flowController, final StringEncryptor encryptor,
        final StateManagerProvider stateManagerProvider, final NiFiProperties nifiProperties);

}