Class ParserExecutor
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
org.nuiton.i18n.plugin.parser.ParserExecutor
- All Implemented Interfaces:
AutoCloseable, Executor, ExecutorService, I18nParserConfiguration
- Since:
- 1.2.2
- Author:
- poussin
-
Nested Class Summary
Nested classes/interfaces inherited from class ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final I18nParserConfigurationthe incoming configuration (from mojo which contains shared result and logger)protected intnumber of files registred to consumelist of files touched (says having at least one i18n key)list of files consumed -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFile(FileParser parser, File... files) Add a file to be consumed.protected voidafterExecute(Runnable r, Throwable t) voidclear()clean internal state after usage of the thread.protected I18nParserConfigurationorg.apache.maven.plugin.logging.LoggetLog()protected intorg.nuiton.io.SortedPropertiesbooleanbooleanisSilent()booleanvoidAsk the thread to stop.Methods inherited from class ThreadPoolExecutor
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, execute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated, toStringMethods inherited from class AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submitMethods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ExecutorService
close
-
Field Details
-
configuration
the incoming configuration (from mojo which contains shared result and logger) -
treatedFiles
-
touchedFiles
-
nbFiles
protected int nbFilesnumber of files registred to consume
-
-
Constructor Details
-
ParserExecutor
-
-
Method Details
-
afterExecute
- Overrides:
afterExecutein classThreadPoolExecutor
-
isVerbose
public boolean isVerbose()- Specified by:
isVerbosein interfaceI18nParserConfiguration
-
isSilent
public boolean isSilent()- Specified by:
isSilentin interfaceI18nParserConfiguration
-
isShowTouchedFiles
public boolean isShowTouchedFiles()- Specified by:
isShowTouchedFilesin interfaceI18nParserConfiguration
-
getLog
public org.apache.maven.plugin.logging.Log getLog()- Specified by:
getLogin interfaceI18nParserConfiguration
-
getResult
public org.nuiton.io.SortedProperties getResult()- Specified by:
getResultin interfaceI18nParserConfiguration
-
getTreatedFiles
-
getTouchedFiles
-
clear
public void clear()clean internal state after usage of the thread. -
addFile
Add a file to be consumed.- Parameters:
parser- the parser of the filefiles- files to parse
-
terminatesAndWaits
Ask the thread to stop. It will finish all incoming files (but will not accept more files to parse) Note: The method does not return until all files are not consumed.- Throws:
InterruptedException- if something wrong while waiting end of executor
-
getConfiguration
-
getNbFilesToTreate
protected int getNbFilesToTreate()
-