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 aTemplatescache, for performance purpose.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classThreadSafeTraxProcessor.CacheValidityThe validity of the current stylesheet.static classThreadSafeTraxProcessor.ExtendedTransformerHandlerAndValiditySpecialXSLTProcessor.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 Constructor Description ThreadSafeTraxProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()DisposableTransformerHandlergetTransformerHandler(Source stylesheet)TransformerHandlergetTransformerHandler(Source stylesheet, XMLFilter filter)XSLTProcessor.TransformerHandlerAndValiditygetTransformerHandlerAndValidity(Source stylesheet)XSLTProcessor.TransformerHandlerAndValiditygetTransformerHandlerAndValidity(Source stylesheet, XMLFilter filter)voidinitialize()Initializevoidparameterize(Parameters params)Configure the componentSourceresolve(String href, String base)Called 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 Detail
-
ThreadSafeTraxProcessor
public ThreadSafeTraxProcessor()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
Compose. Try to get the store- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
initialize
public void initialize() throws Exception
Initialize- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
dispose
public void dispose()
Disposable- Specified by:
disposein interfaceDisposable
-
parameterize
public void parameterize(Parameters params) throws ParameterException
Configure the component- Specified by:
parameterizein interfaceParameterizable- Throws:
ParameterException
-
setTransformerFactory
public void setTransformerFactory(String classname)
- Specified by:
setTransformerFactoryin interfaceXSLTProcessor
-
getTransformerHandler
public TransformerHandler getTransformerHandler(Source stylesheet) throws XSLTProcessorException
- 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
public Source resolve(String href, String base) throws TransformerException
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.
-
-