super.setMessageListener(ml);
// create task executor with custom thread pool for:
// 1) GetMeta request processing
// 2) ReleaseCAS request
if ( taskExecutor == null ) {
UimaAsThreadFactory tf = new UimaAsThreadFactory(threadGroup);
tf.setDaemon(false);
if ( isFreeCasQueueListener()) {
tf.setThreadNamePrefix(controller.getComponentName()+" - FreeCASRequest Thread");
} else if ( isGetMetaListener() ) {
tf.setThreadNamePrefix(super.getBeanName()+" - Thread");
} else if ( getDestination() != null && getMessageSelector() != null ) {
tf.setThreadNamePrefix(controller.getComponentName() + " Process Thread");
} else if ( endpoint != null && endpoint.isTempReplyDestination() ) {
tf.setThreadNamePrefix(super.getBeanName()+" - Thread");
} else {
throw new Exception("Unknown Context Detected in setUimaASThreadPoolExecutor()");
}
ExecutorService es = Executors.newFixedThreadPool(consumentCount,tf);
if ( es instanceof ThreadPoolExecutor ) {
threadPoolExecutor = (ThreadPoolExecutor)es;
super.setTaskExecutor(es);
}
} else {
UimaAsThreadFactory tf = new UimaAsThreadFactory(threadGroup);
tf.setDaemon(false);
if ( isFreeCasQueueListener()) {
tf.setThreadNamePrefix(controller.getComponentName()+" - FreeCASRequest Thread");
} else if ( isGetMetaListener() ) {
tf.setThreadNamePrefix(super.getBeanName()+" - Thread");
} else if ( getDestination() != null && getMessageSelector() != null ) {
tf.setThreadNamePrefix(controller.getComponentName() + " Process Thread");
} else if ( endpoint != null && endpoint.isTempReplyDestination() ) {
tf.setThreadNamePrefix(super.getBeanName()+" - Thread");
} else {
throw new Exception("Unknown Context Detected in setUimaASThreadPoolExecutor()");
}
}