public class ThumbnailGenerator
extends java.lang.Object
implements java.lang.Runnable
| Modifier and Type | Field and Description |
|---|---|
protected static java.util.concurrent.ExecutorService |
executorService
Executor service for thumbnails generation.
|
protected static java.util.Map<FileElement,ThumbnailGenerator> |
generators
Map containing references to running thumbnail generators.
|
protected static java.lang.Object |
generatorsLock
Generator references map operations lock.
|
| Constructor and Description |
|---|
ThumbnailGenerator(WebFileList list,
FileElement element,
boolean disabled)
Constructs thumbnail generator for the specified file element.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Abort thumbnail generation.
|
static void |
abortThumbnailLoad(FileElement element)
Forces thumbnail generation to be aborted for the specified element.
|
FileElement |
getElement()
Returns file element for which thumbnail is being generated.
|
WebFileList |
getList()
Returns file list this generator is working for.
|
boolean |
isAborted()
Returns whether this generator was aborted or not.
|
boolean |
isDisabled()
Returns whether disabled thumbnail will also be generated or not.
|
static void |
queueThumbnailLoad(WebFileList list,
FileElement element,
boolean disabled)
Adds specified element into thumbnails generation queue.
|
void |
run()
Starts thumbnail generation.
|
protected static final java.util.concurrent.ExecutorService executorService
protected static final java.util.Map<FileElement,ThumbnailGenerator> generators
protected static final java.lang.Object generatorsLock
public ThumbnailGenerator(WebFileList list, FileElement element, boolean disabled)
list - file list this generator is working forelement - element to queue thumbnail generation fordisabled - whether should generate disabled state thumbnail or notpublic WebFileList getList()
public FileElement getElement()
public boolean isDisabled()
public boolean isAborted()
public void abort()
public void run()
run in interface java.lang.Runnablepublic static void queueThumbnailLoad(WebFileList list, FileElement element, boolean disabled)
list - file list this generator is working forelement - element to queue thumbnail generation fordisabled - whether should generate disabled state thumbnail or notpublic static void abortThumbnailLoad(FileElement element)
element - element to abort thumbnail generation for