Class Archive.ExtractorExecutorHolder

java.lang.Object
com.github.junrar.Archive.ExtractorExecutorHolder
Enclosing class:
Archive

private static final class Archive.ExtractorExecutorHolder extends Object
Class to ensure the lazy initialization of the ThreadPoolExecutor upon first usage.

Using a cached thread pool executor is more efficient and creating a new thread for each extraction. The total number of threads will only increase if there are tasks on its queue and all current threads are busy. If there are available threads, those will be reused instead of a new one being created.

Configuration options:

  • To avoid the possibility of too many simultaneous active threads being started, the maximum number of threads can be configured through the junrar.extractor.max-threads system property. The default maximum number of threads is unbounded.
  • The keep alive time can be configured through the junrar.extractor.thread-keep-alive-seconds system property. The default is 5s.
Version:
$LastChangedRevision$
  • Field Details

  • Constructor Details

    • ExtractorExecutorHolder

      private ExtractorExecutorHolder()
  • Method Details

    • getMaxThreads

      private static int getMaxThreads()
    • getThreadKeepAlive

      private static int getThreadKeepAlive()