Module org.jpo
Package org.jpo.cache

Class ThumbnailCreationDaemon

java.lang.Object
org.jpo.cache.ThumbnailCreationDaemon
All Implemented Interfaces:
Runnable

public class ThumbnailCreationDaemon extends Object implements Runnable
Instantiated objects of this class sit on their thread, polling the ThumbnailCreationQueue for new thumbnail creation requests. If a new request is found it is pulled off the queue and the daemon goes to work creating the thumbnail image. Using notification the GUI can then learn about a created Thumbnail and can redraw the picture. ThumbnailCreationQueue for new ThumbnailQueueRequest and process them.
  • Field Details

    • pollingInterval

      protected final int pollingInterval
      The polling interval in milliseconds
  • Constructor Details

    • ThumbnailCreationDaemon

      public ThumbnailCreationDaemon(int pollingInterval)
      Constructor that creates the thread. It creates the thread with a Thread.MIN_PRIORITY priority to ensure good overall response.
      Parameters:
      pollingInterval - The polling interval in milliseconds
  • Method Details

    • run

      public void run()
      The run method for the thread that keeps checking whether there are any ThumbnailQueueRequest objects on the queue to be rendered.
      Specified by:
      run in interface Runnable
    • endThread

      public void endThread()
      A requester can ask for the thread to be shut down.