}
public static Worker createWorker(SearchConfiguration cfg, WorkerBuildContext context, QueueingProcessor queueingProcessor) {
Properties props = getProperties( cfg );
String impl = props.getProperty( Environment.WORKER_SCOPE );
Worker worker;
if ( StringHelper.isEmpty( impl ) ) {
worker = new TransactionalWorker();
}
else if ( "transaction".equalsIgnoreCase( impl ) ) {
worker = new TransactionalWorker();
}
else {
worker = ClassLoaderHelper.instanceFromName(
Worker.class,
impl, WorkerFactory.class, "worker"
);
}
worker.initialize( props, context, queueingProcessor );
return worker;
}