Class ProcessingThread
java.lang.Object
java.lang.Thread
com.jalios.jcms.fileprocessor.processingmanagement.ProcessingThread
- All Implemented Interfaces:
Runnable
This class is a Thread of processing. ProcessingData are submitted to this thread with a
producer/consumer mecanism.
This thread may be started and stopped through FileProcessorManager.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMaximum number of throwable allowed per component (processor/parser) before considering it should be removed from repository configurationFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckPermission(Repository repository, File file) Checks if the specified file is allowed for processing based on current permission/limitation configured in the repository.Retrieve the ProcessingData instance that processed during last loop of this thread.booleanTell if the processing of files is alive (which is expected at all time after JCMS startup, even if FileProcessor is disabled, otherwise a complete restart is required).booleanTell if the processing of files is running (Otherwise, it is stopped, or waiting).static voidReset all throwable counters.voidrun()Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Field Details
-
MAX_THROWABLE
public static final int MAX_THROWABLEMaximum number of throwable allowed per component (processor/parser) before considering it should be removed from repository configuration- See Also:
-
-
Method Details
-
run
public void run() -
isProcessingAlive
public boolean isProcessingAlive()Tell if the processing of files is alive (which is expected at all time after JCMS startup, even if FileProcessor is disabled, otherwise a complete restart is required).- Returns:
- true if the processing is currently not stopped
-
isProcessingRunning
public boolean isProcessingRunning()Tell if the processing of files is running (Otherwise, it is stopped, or waiting).- Returns:
- true if the processing is currently running
-
getLastProcessingData
Retrieve the ProcessingData instance that processed during last loop of this thread.- Returns:
- a ProcessingData instance or null if no processing has yet occured.
-
resetThrowableCounter
public static void resetThrowableCounter()Reset all throwable counters.Used during unit test in which processors voluntarly triggers failures but do not want to be excluded.
-
checkPermission
Checks if the specified file is allowed for processing based on current permission/limitation configured in the repository.
Can be configured by modifying properties"fileprocessor.repository.{repository-id}.permission.size.*".- Returns:
- true if file can be processed, false otheriwse
- Since:
- jcms-8.0.3
-