final JBossThreadPoolExecutor executor = this.executor;
if (executor == null) {
throw new IllegalStateException();
}
context.asynchronous();
executor.shutdown();
executor.addShutdownListener(new EventListener<StopContext>() {
public void handleEvent(final StopContext stopContext) {
stopContext.complete();
}
}, context);