|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.alfresco.repo.content.transform.TransformerDebug
public class TransformerDebug
Debugs transformers selection and activity.
As transformations are frequently composed of lower level transformations, log
messages include a prefix to identify the transformation. A numeric dot notation
is used (such as 123.1.2 indicating the second third level transformation
of the 123rd top level transformation).
In order to track of the nesting of transforms, this class has a stack to represent
the Transformers. Each Transformer calls TransformerDebug.pushTransform(org.alfresco.repo.content.transform.ContentTransformer, java.lang.String, java.lang.String, java.lang.String, long) at the start of a
transform and TransformerDebug.popTransform() at the end. However the top level transform may
be selected from a list of available transformers. To record this activity,
TransformerDebug.pushAvailable(java.lang.String, java.lang.String, java.lang.String), TransformerDebug.unavailableTransformer(org.alfresco.repo.content.transform.ContentTransformer, long) (to record the reason a
transformer is rejected), TransformerDebug.availableTransformers(java.util.List, long, java.lang.String) (to record the available
transformers) and TransformerDebug.popAvailable() are called.
| Constructor Summary | |
|---|---|
TransformerDebug(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
Constructor |
|
| Method Summary | |
|---|---|
void |
availableTransformers(java.util.List transformers,
long sourceSize,
java.lang.String calledFrom)
Called once all available transformers have been identified. |
void |
debug(java.lang.String message)
Log a message prefixed with the current transformation reference. |
void |
debug(java.lang.String message,
java.lang.Throwable t)
Log a message prefixed with the current transformation reference and include a exception, suppressing the stack trace if repeated as we return up the stack of transformers. |
boolean |
isEnabled()
Indicates if any logging is required. |
void |
popAvailable()
Called after working out what transformers are available and any resulting transform has been called. |
void |
popTransform()
Called after performing a transform. |
void |
pushAvailable(java.lang.String fromUrl,
java.lang.String sourceMimetype,
java.lang.String targetMimetype)
Called prior to working out what transformers are available. |
void |
pushTransform(ContentTransformer transformer,
java.lang.String fromUrl,
java.lang.String sourceMimetype,
java.lang.String targetMimetype,
long sourceSize)
Called prior to performing a transform. |
java.lang.Throwable |
setCause(java.lang.Throwable t)
Sets the cause of a transformation failure, so that only the message of the Throwable is reported later rather than the full stack trace over and over. |
static boolean |
setDebugOutput(boolean debugOutput)
Enable or disable debug log output. |
void |
unavailableTransformer(ContentTransformer transformer,
long maxSourceSizeKBytes)
Called to identify a transformer that cannot be used during working out available transformers. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TransformerDebug(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
| Method Detail |
|---|
public void pushAvailable(java.lang.String fromUrl,
java.lang.String sourceMimetype,
java.lang.String targetMimetype)
public void pushTransform(ContentTransformer transformer,
java.lang.String fromUrl,
java.lang.String sourceMimetype,
java.lang.String targetMimetype,
long sourceSize)
public void unavailableTransformer(ContentTransformer transformer,
long maxSourceSizeKBytes)
public void availableTransformers(java.util.List transformers,
long sourceSize,
java.lang.String calledFrom)
public void popAvailable()
public void popTransform()
public boolean isEnabled()
public static boolean setDebugOutput(boolean debugOutput)
debugOutput - if true both debug and trace is generated. Otherwise all output is trace.
public void debug(java.lang.String message)
message -
public void debug(java.lang.String message,
java.lang.Throwable t)
message - public java.lang.Throwable setCause(java.lang.Throwable t)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||