Class PixelDataThread

  • All Implemented Interfaces:
    java.lang.Runnable, java.util.EventListener, org.springframework.context.ApplicationListener<ome.io.messages.MissingPyramidMessage>

    public class PixelDataThread
    extends ExecutionThread
    implements org.springframework.context.ApplicationListener<ome.io.messages.MissingPyramidMessage>
    Since:
    Beta4.3
    • Constructor Detail

      • PixelDataThread

        @Deprecated
        public PixelDataThread​(SessionManager manager,
                               Executor executor,
                               PixelDataHandler handler,
                               java.lang.String uuid)
        Deprecated.
        Uses default Principal for processing
      • PixelDataThread

        @Deprecated
        public PixelDataThread​(SessionManager manager,
                               Executor executor,
                               PixelDataHandler handler,
                               java.lang.String uuid,
                               int numThreads)
        Deprecated.
        Uses default Principal for processing and a NullMetrics instance.
      • PixelDataThread

        @Deprecated
        public PixelDataThread​(SessionManager manager,
                               Executor executor,
                               PixelDataHandler handler,
                               ome.system.Principal principal,
                               java.lang.String uuid,
                               int numThreads)
        Deprecated.
        Calculates performProcessing based on the existence of the "pixelDataTrigger" and passes all parameters to the main ctor passing a NullMetrics as necessary.
      • PixelDataThread

        @Deprecated
        public PixelDataThread​(SessionManager manager,
                               Executor executor,
                               PixelDataHandler handler,
                               java.lang.String uuid,
                               int numThreads,
                               ome.system.metrics.Metrics metrics)
        Deprecated.
        Calculates performProcessing based on the existence of the "pixelDataTrigger" and passes all parameters to the main ctor.
      • PixelDataThread

        public PixelDataThread​(SessionManager manager,
                               Executor executor,
                               PixelDataHandler handler,
                               java.lang.String uuid,
                               int numThreads,
                               ome.system.metrics.Metrics metrics,
                               ReadOnlyStatus readOnly)
        Calculates performProcessing based on the existence of the "pixelDataTrigger" and passes all parameters to the main ctor.
      • PixelDataThread

        @Deprecated
        public PixelDataThread​(SessionManager manager,
                               Executor executor,
                               PixelDataHandler handler,
                               ome.system.Principal principal,
                               java.lang.String uuid,
                               int numThreads,
                               ome.system.metrics.Metrics metrics)
        Deprecated.
        Calculates performProcessing based on the existence of the "pixelDataTrigger" and passes all parameters to the main ctor.
      • PixelDataThread

        @Deprecated
        public PixelDataThread​(SessionManager manager,
                               Executor executor,
                               PixelDataHandler handler,
                               ome.system.Principal principal,
                               java.lang.String uuid,
                               int numThreads,
                               ome.system.metrics.Metrics metrics,
                               ReadOnlyStatus readOnly)
        Deprecated.
        Calculates performProcessing based on the existence of the "pixelDataTrigger" and passes all parameters to the main ctor.
      • PixelDataThread

        public PixelDataThread​(boolean performProcessing,
                               SessionManager manager,
                               Executor executor,
                               PixelDataHandler handler,
                               ome.system.Principal principal,
                               java.lang.String uuid,
                               int numThreads)
        Calls main constructor with NullMetrics.
      • PixelDataThread

        public PixelDataThread​(boolean performProcessing,
                               SessionManager manager,
                               Executor executor,
                               PixelDataHandler handler,
                               ome.system.Principal principal,
                               java.lang.String uuid,
                               int numThreads,
                               ome.system.metrics.Metrics metrics)
        Calls main constructor with read-only status being all read-write.
      • PixelDataThread

        public PixelDataThread​(boolean performProcessing,
                               SessionManager manager,
                               Executor executor,
                               PixelDataHandler handler,
                               ome.system.Principal principal,
                               java.lang.String uuid,
                               int numThreads,
                               ome.system.metrics.Metrics metrics,
                               ReadOnlyStatus readOnly)
        Main constructor. No arguments can be null.
    • Method Detail

      • start

        public void start()
        Called by Spring on creation. Currently a no-op.
      • doRun

        public void doRun()
        Loads event logs from the PixelDataHandler processing them all then in a background thread via a ExecutorCompletionService. numThreads variable is also used there, so the value returned should match. In case it isn't, we additionally use an ArrayBlockingQueue to hold the results.
        Specified by:
        doRun in class ExecutionThread
      • onExecutionException

        protected void onExecutionException​(java.util.concurrent.ExecutionException ee)
        Basic handling just logs at ERROR level. Subclasses (especially for testing) can do more.
      • stop

        public void stop()
        Called by Spring on destruction.
      • onApplicationEvent

        public void onApplicationEvent​(ome.io.messages.MissingPyramidMessage mpm)
        Called in the main server (Blitz-0) in order to create a PIXELDATA EventLog which will get processed by PixelData-0.
        Specified by:
        onApplicationEvent in interface org.springframework.context.ApplicationListener<ome.io.messages.MissingPyramidMessage>