*/
public static Executor createExecutor(Bus bus, String name) {
WorkQueueManager manager = bus.getExtension(WorkQueueManager.class);
if (manager != null) {
AutomaticWorkQueue workQueue1 = manager.getNamedWorkQueue(name);
final WorkQueue workQueue = (workQueue1 == null) ? manager.getAutomaticWorkQueue() : workQueue1;
return new Executor() {
@Override
public void execute(Runnable command) {
workQueue.execute(command, 0);
}
};
} else {
return Executors.newFixedThreadPool(20);
}