Class ProcessingThread

java.lang.Object
java.lang.Thread
com.jalios.jcms.fileprocessor.processingmanagement.ProcessingThread
All Implemented Interfaces:
Runnable

public class ProcessingThread extends Thread
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.
  • Field Details

    • MAX_THROWABLE

      public static final int MAX_THROWABLE
      Maximum 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()
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • 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

      public ProcessingData 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

      public boolean checkPermission(Repository repository, File file)
      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