}
private ExecutorService buildAndConfigureExecutorService(String factoryName, Properties p, String componentName) throws Exception {
Properties props = new Properties(p); // defensive copy
if (p != null && !p.isEmpty()) props.putAll(p);
ExecutorFactory f = (ExecutorFactory) Util.getInstance(factoryName, globalConfiguration.getClassLoader());
setComponentName(componentName, props);
setDefaultThreads(KnownComponentNames.getDefaultThreads(componentName), props);
setDefaultThreadPrio(KnownComponentNames.getDefaultThreadPrio(componentName), props);
return f.getExecutor(props);
}