The code is problematic to hard-code such classes. I understand it's used to set up the TCCL under OSGi, but we already have a better way to do so:

org.apache.tuscany.sca.extensibility.ClassLoaderContext.setContextClassLoader(ClassLoader, ServiceDiscovery, Class<?>...);

We can call the SPI as follows:

                   ClassLoader oldTCCL =
ClassLoaderContext.setContextClassLoader(parent, ServiceDiscovery .getInstance(), XMLInputFactory.class, DocumentBuilderFactory.class);

The idea is to use ServiceDiscovery to find the implementation classes for the system services such as XMLInputFactory first and get the classloader of the impl class.

I'll fix the code.

Thanks,
Raymond
--------------------------------------------------
From: "ant elder" <[email protected]>
Sent: Wednesday, March 03, 2010 12:11 PM
To: <[email protected]>
Subject: Re: Axis2EngineIntegration hardcoded to use Woodstox

On Thu, Mar 4, 2010 at 8:52 AM, ant elder <[email protected]> wrote:
The WS binding class Axis2EngineIntegration has a hardcoded reference
to a Woodstox implementation class com.ctc.wstx.stax.WstxInputFactory
so it only works with the Woodstox parser. It looks like that was done
intentionally so is there a reason it must use woodstox or could there
be a generic approach that would work with other parser impls?

  ...ant


And same question on the use of the Xerces DocumentBuilderFactoryImpl
class, is it required to use the Xerces specific impl?

...ant

Reply via email to