public class LocalConverter extends ConverterAdapter
LocalConverter delegates its conversions to a IExternalConverter.
Such converters must be registered manually as long as they are shipped with documents4j where they are discovered
on the class path.
Important: There should only exist one
LocalConverter per physical machine!
This instance needs to communicate with external applications via command line and needs to shut down
and start up applications. This cannot be done in a safely manner without introducing a major latency. It
is therefore the responsibility of the application developer to only run this program once per physical machine.
It should be made explicit: It is not enough to create a singleton instance per JVM a LocalConverter
on another JVM would share external application state.| Modifier and Type | Class and Description |
|---|---|
static class |
LocalConverter.Builder
A builder for constructing a
LocalConverter. |
DEFAULT_CLOSE_STREAMJOB_PRIORITY_HIGH, JOB_PRIORITY_LOW, JOB_PRIORITY_NORMAL| Modifier | Constructor and Description |
|---|---|
protected |
LocalConverter(File baseFolder,
int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
long processTimeout,
TimeUnit processTimeoutUnit,
Map<Class<? extends IExternalConverter>,Boolean> converterConfiguration) |
| Modifier and Type | Method and Description |
|---|---|
static LocalConverter.Builder |
builder()
Creates a new builder instance.
|
IConversionJobWithSourceUnspecified |
convert(IFileSource source) |
Map<DocumentType,Set<DocumentType>> |
getSupportedConversions() |
boolean |
isOperational() |
void |
kill() |
static IConverter |
make()
Creates a new
LocalConverter with default configuration. |
protected IConversionManager |
makeConversionManager(File baseFolder,
long processTimeout,
TimeUnit unit,
Map<Class<? extends IExternalConverter>,Boolean> converterConfiguration) |
void |
shutDown() |
convert, convert, convert, convert, deregisterShutdownHook, getTempFileFolder, makeExecutorService, makeTemporaryFile, makeTemporaryFile, registerShutdownHookpublic static LocalConverter.Builder builder()
public static IConverter make()
LocalConverter with default configuration.LocalConverter with default configuration.protected IConversionManager makeConversionManager(File baseFolder, long processTimeout, TimeUnit unit, Map<Class<? extends IExternalConverter>,Boolean> converterConfiguration)
public Map<DocumentType,Set<DocumentType>> getSupportedConversions()
public IConversionJobWithSourceUnspecified convert(IFileSource source)
convert in interface IConverterconvert in class ConverterAdapterpublic boolean isOperational()
public void shutDown()
shutDown in interface IConvertershutDown in class ConverterAdapterpublic void kill()
kill in interface IConverterkill in class ConverterAdapterCopyright © 2013–2016. All rights reserved.