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
Modifier and TypeClassDescriptionstatic enum
The validity of the current stylesheet.static class
SpecialXSLTProcessor.TransformerHandlerAndValidity
with 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear the resolution cache in the request.void
dispose()
DisposablegetTransformerHandler
(Source stylesheet) getTransformerHandler
(Source stylesheet, XMLFilter filter) getTransformerHandlerAndValidity
(Source stylesheet) getTransformerHandlerAndValidity
(Source stylesheet, XMLFilter filter) void
Initializevoid
parameterize
(Parameters params) Configure the componentCalled by the processor when it encounters an xsl:include, xsl:import, or document() function.void
service
(ServiceManager manager) Compose.void
setTransformerFactory
(String classname) void
transform
(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:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
Initialize- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
dispose
Disposable- Specified by:
dispose
in interfaceDisposable
-
parameterize
Configure the component- Specified by:
parameterize
in interfaceParameterizable
- Throws:
ParameterException
-
setTransformerFactory
- Specified by:
setTransformerFactory
in interfaceXSLTProcessor
-
getTransformerHandler
- Specified by:
getTransformerHandler
in interfaceXSLTProcessor
- Throws:
XSLTProcessorException
-
getTransformerHandler
public TransformerHandler getTransformerHandler(Source stylesheet, XMLFilter filter) throws XSLTProcessorException - Specified by:
getTransformerHandler
in interfaceXSLTProcessor
- Throws:
XSLTProcessorException
-
getTransformerHandlerAndValidity
public XSLTProcessor.TransformerHandlerAndValidity getTransformerHandlerAndValidity(Source stylesheet) throws XSLTProcessorException - Specified by:
getTransformerHandlerAndValidity
in interfaceXSLTProcessor
- Throws:
XSLTProcessorException
-
getTransformerHandlerAndValidity
public XSLTProcessor.TransformerHandlerAndValidity getTransformerHandlerAndValidity(Source stylesheet, XMLFilter filter) throws XSLTProcessorException - Specified by:
getTransformerHandlerAndValidity
in interfaceXSLTProcessor
- Throws:
XSLTProcessorException
-
transform
public void transform(Source source, Source stylesheet, Parameters params, Result result) throws XSLTProcessorException - Specified by:
transform
in interfaceXSLTProcessor
- Throws:
XSLTProcessorException
-
resolve
Called by the processor when it encounters an xsl:include, xsl:import, or document() function.- Specified by:
resolve
in 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.
-