java.lang.Object
org.jpo.cache.ThumbnailCreationDaemon
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionprotected final intThe polling interval in milliseconds -
Constructor Summary
ConstructorsConstructorDescriptionThumbnailCreationDaemon(int pollingInterval) Constructor that creates the thread. -
Method Summary
Modifier and TypeMethodDescriptionvoidA requester can ask for the thread to be shut down.voidrun()The run method for the thread that keeps checking whether there are anyThumbnailQueueRequestobjects on the queue to be rendered.
-
Field Details
-
pollingInterval
protected final int pollingIntervalThe 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 anyThumbnailQueueRequestobjects on the queue to be rendered. -
endThread
public void endThread()A requester can ask for the thread to be shut down.
-