Package org.ametys.runtime.cocoon
Class ThreadSafeTraxProcessor
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.runtime.cocoon.ThreadSafeTraxProcessor
- All Implemented Interfaces:
URIResolver,Disposable,Initializable,Component,LogEnabled,Parameterizable,Serviceable,XSLTProcessor
public class ThreadSafeTraxProcessor
extends AbstractLogEnabled
implements XSLTProcessor, Serviceable, Initializable, Disposable, Parameterizable, URIResolver
Adaptation of Excalibur's XSLTProcessor implementation to allow for better error reporting. This implementation is also threadsafe.
It also handles a
It also handles a
Templates cache, for performance purpose.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe validity of the current stylesheet.static classSpecialXSLTProcessor.TransformerHandlerAndValiditywith information about the cache state of the underlyingTemplates.Nested classes/interfaces inherited from interface org.apache.excalibur.xml.xslt.XSLTProcessor
XSLTProcessor.TransformerHandlerAndValidity -
Field Summary
Fields inherited from interface org.apache.excalibur.xml.xslt.XSLTProcessor
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClear the resolution cache in the request.voiddispose()DisposablegetTransformerHandler(Source stylesheet) getTransformerHandler(Source stylesheet, XMLFilter filter) getTransformerHandlerAndValidity(Source stylesheet) getTransformerHandlerAndValidity(Source stylesheet, XMLFilter filter) voidInitializevoidparameterize(Parameters params) Configure the componentCalled by the processor when it encounters an xsl:include, xsl:import, or document() function.voidservice(ServiceManager manager) Compose.voidsetTransformerFactory(String classname) voidtransform(Source source, Source stylesheet, Parameters params, Result result) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Constructor Details
-
ThreadSafeTraxProcessor
public ThreadSafeTraxProcessor()
-
-
Method Details
-
service
Compose. Try to get the store- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
initialize
Initialize- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
dispose
Disposable- Specified by:
disposein interfaceDisposable
-
parameterize
Configure the component- Specified by:
parameterizein interfaceParameterizable- Throws:
ParameterException
-
setTransformerFactory
- Specified by:
setTransformerFactoryin interfaceXSLTProcessor
-
getTransformerHandler
- Specified by:
getTransformerHandlerin interfaceXSLTProcessor- Throws:
XSLTProcessorException
-
getTransformerHandler
public TransformerHandler getTransformerHandler(Source stylesheet, XMLFilter filter) throws XSLTProcessorException - Specified by:
getTransformerHandlerin interfaceXSLTProcessor- Throws:
XSLTProcessorException
-
getTransformerHandlerAndValidity
public XSLTProcessor.TransformerHandlerAndValidity getTransformerHandlerAndValidity(Source stylesheet) throws XSLTProcessorException - Specified by:
getTransformerHandlerAndValidityin interfaceXSLTProcessor- Throws:
XSLTProcessorException
-
getTransformerHandlerAndValidity
public XSLTProcessor.TransformerHandlerAndValidity getTransformerHandlerAndValidity(Source stylesheet, XMLFilter filter) throws XSLTProcessorException - Specified by:
getTransformerHandlerAndValidityin interfaceXSLTProcessor- Throws:
XSLTProcessorException
-
transform
public void transform(Source source, Source stylesheet, Parameters params, Result result) throws XSLTProcessorException - Specified by:
transformin interfaceXSLTProcessor- Throws:
XSLTProcessorException
-
resolve
Called by the processor when it encounters an xsl:include, xsl:import, or document() function.- Specified by:
resolvein interfaceURIResolver- Parameters:
href- An href attribute, which may be relative or absolute.base- The base URI in effect when the href attribute was encountered.- Returns:
- A Source object, or null if the href cannot be resolved, and the processor should try to resolve the URI itself.
- Throws:
TransformerException- if an error occurs when trying to resolve the URI.
-
clearResolutionCache
Clear the resolution cache in the request. Useful for testcases.
-