There are a couple of places where we need to create an
XMLStreamReader and to do this we are doing
XMLInputFactory.newInstance("javax.xml.stream.XMLInputFactory",
classLoader)
to obtain the factory (the classloader is the runtime classloader and
this form avoids messing with the TCCL).
I think it would be better to add a system service that components
can wire to rather than using the newInstance() call everywhere. The
problem is that XMLInputFactory is an abstract class so cannot be
used as a service interface.
We can tackle this two ways:
1) add support for class-based services as we need that for the spec
anyway
2) add an interface our components use instead of XMLInputFactory
(e.g. o.a.t.spi.services.XMLInputFactory)
The first is going to require some asm magic to bytecode generate
concrete subclasses and a bunch of other work to integrate it.
Although we need to do this at some point, it seems like a lot of
effort to solve this particular problem.
I'd like to suggest we go with the second option as an interim solution.
Any comments? Is this a service anyone is interested in implementing?
--
Jeremy
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]