public class OcrExecutorService extends ThreadPoolExecutor
| Modifier and Type | Class and Description |
|---|---|
static class |
OcrExecutorService.OcrCallable
Represents an OCR task.
|
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy| Modifier and Type | Field and Description |
|---|---|
static ThreadLocal<Ocr> |
threadLocalOcr |
| Constructor and Description |
|---|
OcrExecutorService(String lang,
String speed)
A service executor with thread count equal to number of CPU core available.
|
OcrExecutorService(String lang,
String speed,
int poolSize)
Creates a new instance of OCR service executor
|
| Modifier and Type | Method and Description |
|---|---|
static int |
getCpuCores()
Returns number of CPU core available for the current JVM.
|
void |
shutdown() |
void |
stopOcrEngines() |
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, execute, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdownNow, toStringpublic static final ThreadLocal<Ocr> threadLocalOcr
public OcrExecutorService(String lang, String speed)
lang - language to recognizespeed - speed settings, e.g., Ocr.SPEED_FASTEST.public OcrExecutorService(String lang, String speed, int poolSize)
lang - language to recognizespeed - speed settings, e.g., Ocr.SPEED_FASTEST.poolSize - number of threads to be used in this executor.public void shutdown()
shutdown in interface ExecutorServiceshutdown in class ThreadPoolExecutorpublic void stopOcrEngines()
public static int getCpuCores()
Copyright © Asprise Software. All Rights Reserved. Please visit the product page at asprise.com