|
This class maintains the performance measures for the transformers as well, making sure that there is an extra penalty for transformers that fail regularly.
Fields inherited from class org.alfresco.repo.content.transform.AbstractContentTransformerLimits |
transformerDebug |
Fields inherited from class org.alfresco.repo.content.transform.ContentTransformerHelper |
transformerConfig |
Constructor Summary | ||
protected |
AbstractContentTransformer2() All transformers start with an average transformation time of 0.0 ms, unless there is an Alfresco global property <beanName>.time. |
Method Summary | ||
protected void |
checkTransformable(ContentReader reader, ContentWriter writer, TransformationOptions options) Convenience method to check the transformability of a transformation |
|
protected ExecutorService |
getExecutorService() Gets the ExecutorService to be used for timeout-aware extraction. |
|
long |
getTransformationTime() | |
long |
getTransformationTime(String sourceMimetype, String targetMimetype) Provides an estimate, usually a worst case guess, of how long a transformation will take. |
|
isTransformationLimitedInternally() | ||
protected void |
recordError(String sourceMimetype, String targetMimetype, long transformationTime) Records an error and updates the average time as if the transformation took a long time, so that it is less likely to be called again. |
|
protected void |
recordTime(long transformationTime) Deprecated. use method with mimetypes. |
|
protected void |
recordTime(String sourceMimetype, String targetMimetype, long transformationTime) Records and updates the average transformation time for this transformer. |
|
void |
register() Registers this instance with the registry if it is present. |
|
void |
setAdditionalThreadTimout(long additionalThreadTimout) | |
void |
setExecutorService(ExecutorService executorService) Sets the ExecutorService to be used for timeout-aware transformation. |
|
void |
setRegisterTransformer(boolean registerTransformer) | |
void |
setRegistry(ContentTransformerRegistry registry) The registry to auto-register with |
|
void |
setRetryTransformOnDifferentMimeType(boolean retryTransformOnDifferentMimeType) | |
void |
setUseTimeoutThread(Boolean useTimeoutThread) | |
toString() | ||
void |
transform(ContentReader reader, ContentWriter writer) | |
void |
transform(ContentReader reader, ContentWriter writer, Map<String,Object> options) Transforms the content provided by the reader and source mimetype to the writer and target mimetype. |
|
void |
transform(ContentReader reader, ContentWriter writer, TransformationOptions options) Transforms the content provided by the reader and source mimetype to the writer and target mimetype with the provided transformation options. |
|
protected abstract void |
transformInternal(ContentReader reader, ContentWriter writer, TransformationOptions options) Method to be implemented by subclasses wishing to make use of the common infrastructural code provided by this class. |
Methods inherited from class org.alfresco.repo.content.transform.AbstractContentTransformerLimits |
getLimits, getLimits, getLimits, getMaxPages, getMaxSourceSizeKBytes, getMaxSourceSizeKBytes, getPageLimit, getReadLimitKBytes, getReadLimitTimeMs, getTimeoutMs, isPageLimitSupported, isTransformable, isTransformable, isTransformableMimetype, isTransformableSize, setLimits, setMaxPages, setMaxSourceSizeKBytes, setMimetypeLimits, setPageLimit, setPageLimitsSupported, setReaderLimits, setReadLimitKBytes, setReadLimitTimeMs, setTimeoutMs, setTransformerDebug |
Methods inherited from class org.alfresco.repo.content.transform.ContentTransformerHelper |
deprecatedSetter, equals, getBeanName, getComments, getCommentsOnlySupports, getExtensionOrAny, getMimetype, getMimetypeService, getName, getSimpleName, hashCode, isExplicitTransformation, isSupportedTransformation, onlySupports, setBeanName, setExplicitTransformations, setMimetypeService, setSupportedTransformations, setTransformerConfig, setUnsupportedTransformations |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.alfresco.repo.content.transform.ContentTransformer |
getComments, getName, isExplicitTransformation |
The transformation viability can be determined by an up front call to ContentTransformer.isTransformable(String, String, TransformationOptions).
The source and target mimetypes must be available on the ContentAccessor.getMimetype() methods of both the reader and the writer.
Both reader and writer will be closed after the transformation completes.
The provided options can be null.
The source and target mimetypes must be available on the ContentAccessor.getMimetype() methods of both the reader and the writer.
Both reader and writer will be closed after the transformation completes.
This method is used to determine, up front, which of a set of equally reliant transformers will be used for a specific transformation.
Subclasses should call this after every transformation in order to keep the running average of the transformation times up to date.
This method is thread-safe. The time spent in this method is negligible so the impact will be minor.
ExecutorService
to be used for timeout-aware extraction.
If no ExecutorService
has been defined a default of Executors.newCachedThreadPool()
is used during AbstractMappingMetadataExtracter.init().
ExecutorService
ExecutorService
to be used for timeout-aware transformation.
|