// this is problematic. There are still active threads pending a shutdown.
@Override
    @StartHandler(phase = Phase.INBOUND_EVENT_CONNECTORS)
    public void start() {
        if (activeProcessorThreads() > 0 || workLauncherRunning.get()) {
            if (state.get().isRunning()) {
                // then it's ok. It's already running
                return;
            } else {
                // this is problematic. There are still active threads pending a shutdown.
                throw new IllegalStateException("Cannot start this processor. It is pending shutdown...");
            }
        }
        State previousState = state.getAndSet(State.STARTED);
        if (!previousState.isRunning()) {
            startSegmentWorkers();
        }
    }
return;
} else {
// this is problematic. There are still active threads pending a shutdown.
throw new IllegalStateException("Cannot start this processor. It is pending shutdown...");
}
@Override
@StartHandler(phase = Phase.INBOUND_EVENT_CONNECTORS)
public void start() {
if (activeProcessorThreads() > 0 || workLauncherRunning.get()) {
if (state.get().isRunning()) {
// then it's ok. It's already running
return;
} else {
// this is problematic. There are still active threads pending a shutdown.
throw new IllegalStateException("Cannot start this processor. It is pending shutdown...");
}
}
State previousState = state.getAndSet(State.STARTED);
if (!previousState.isRunning()) {
startSegmentWorkers();
}
}
@Override
@StartHandler(phase = Phase.INBOUND_EVENT_CONNECTORS)
public void start() {
if (activeProcessorThreads() > 0 || workLauncherRunning.get()) {
if (state.get().isRunning()) {
// then it's ok. It's already running
return;
} else {
// this is problematic. There are still active threads pending a shutdown.
throw new IllegalStateException("Cannot start this processor. It is pending shutdown...");
}
}
State previousState = state.getAndSet(State.STARTED);
if (!previousState.isRunning()) {
startSegmentWorkers();
}
}