Closed eduarddrenth closed 4 years ago
The transformerFactory field is now private. The only way to change the factory is via withTransformerFactory(). This should be sufficient for thread safety, shouldn't it?
Well...not exactly, what matters is if the methods can be called from multiple threads. Saxonica transformerfactory methods can be called concurrently from multiple threads, xalan transformerfactory is not threadsafe.
But... since you call one transformerFactory method during instanciation and the other from validate in a synchronized block, you're safe. You don't have to synchronize in withResolver by the way, since you operate on a new Schematron there
You don't have to synchronize in withResolver by the way, since you operate on a new Schematron there.
The Schematron is new but it might have a shared TransformerFactory.
You don't have to synchronize in withResolver by the way, since you operate on a new Schematron there.
The Schematron is new but it might have a shared TransformerFactory.
Yes, very good, makes me think if this is desirable, in #validate this now shared transformerfactory is used, synchronizing on different schematron instances. Perhaps new Schenatron should always create a new TransformerFactory.
Added some improvements among which one bugfix (tf not passed)
Added some improvements among which one bugfix (tf not passed).
Turned saxon (update to 10?) into runtime dependency, which is not realy necessary for users stick to xslt1. If users want to use another implementation they can always exclude saxon and plugin their own.
Thanks, merged to master.
Some code improvements and docs