|
The im4java Library, Version 1.4.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
org.im4java.process.ProcessExecutor
org.im4java.utils.BatchConverter
public class BatchConverter
This class implements various batch-conversion methods.
ProcessExecutor
Note that not every mode will work with every operation. The batch-mode will typically fail with all operations using ImageMagick's image-sequence operators (e.g. -clone).
Sequential and parallel-mode will convert all images and will
save the indices of failed conversions. You can query these
indices with the method getFailedConversions(). The batch mode
behaves differently: it is a all-or-nothing conversion.
| Nested Class Summary | |
|---|---|
class |
BatchConverter.ConvertException
This nested exception wraps the original exception of failed conversions. |
static class |
BatchConverter.Mode
Enumeration-type for the conversion mode: SEQUENTIAL: run commands sequentially for all images (this mode is mainly for debugging and benchmarking) PARALLEL: run commands in parallel using a ProcessExecutor
BATCH: convert images at once with a single command. |
| Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor |
|---|
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy |
| Constructor Summary | |
|---|---|
BatchConverter(BatchConverter.Mode pMode)
The constructor. |
|
| Method Summary | |
|---|---|
java.util.List<BatchConverter.ConvertException> |
getFailedConversions()
Return the list of exceptions. |
BatchConverter.Mode |
getMode()
Return the current run-mode |
void |
processTerminated(ProcessEvent pEvent)
This method is called at normal or abnormal process termination. |
void |
run(Operation pOp,
java.util.List<java.lang.String> pImages,
java.lang.String pTargetPattern)
Convert the given images with the given Operation. |
| Methods inherited from class org.im4java.process.ProcessExecutor |
|---|
afterExecute, beforeExecute, destroy, processInitiated, processStarted, shutdownNow |
| Methods inherited from class java.util.concurrent.ThreadPoolExecutor |
|---|
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, execute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, terminated |
| Methods inherited from class java.util.concurrent.AbstractExecutorService |
|---|
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BatchConverter(BatchConverter.Mode pMode)
pMode - The conversion mode of this BatchConverter| Method Detail |
|---|
public void run(Operation pOp,
java.util.List<java.lang.String> pImages,
java.lang.String pTargetPattern)
throws java.lang.Exception,
java.io.IOException,
java.lang.InterruptedException,
IM4JavaException
Operation.
pOp - the conversion-operationpImages - List of images to convertpTargetPattern - Pattern for the target-files.
See FilenamePatternResolver for details
java.lang.Exception
java.io.IOException
java.lang.InterruptedException
IM4JavaExceptionpublic void processTerminated(ProcessEvent pEvent)
processTerminated in interface ProcessEventListenerprocessTerminated in class ProcessExecutorpublic java.util.List<BatchConverter.ConvertException> getFailedConversions()
public BatchConverter.Mode getMode()
|
The im4java Library, Version 1.4.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||