[Yanel-development] Some questions on bug 4985 (Implement chainof responsibility)

Paloma Gomez paloma.gomez at wyona.com
Wed Nov 22 12:09:04 CET 2006


> Paloma Gomez wrote:
>
>>Dear Michael,
>>

>>However, this has nothing to do with some of the notes you wrote
>> yesterday
>>in the IRC, which makes me think that I might not have understood what
>> you
>>tried to explain. There were references to MANIFEST files
>>
>
> Currently the MapFactoryImpl is hardcoded within MapFactory and should
> actually
> be retrieved through a MANIFEST or something like this similar to Xerces
> is being loaded
> dynamically and not hardcoded withi xml-apis

I have had a look at the way classes are loaded in Xerces. Xerces provides
an implementation of javax.xml.parsers.SAXParserFactory in
org.apache.xerces.jaxp.SAXParserFactoryImpl. In order to allow the dynamic
loading of the class, javax.xml.parsers.SAXParserFactory#newInstance()
invokes

[code]
return (SAXParserFactory) FactoryFinder.find(
                /* The default property name according to the JAXP spec */
                "javax.xml.parsers.SAXParserFactory",
                /* The fallback implementation class name */
                "org.apache.crimson.jaxp.SAXParserFactoryImpl");
[/code]

javax.xml.parsers.FactoryFinder.java is a package private class that
contains methods to find the appropriate class loader, find the
implementation of an abstract class or interface and create an instance of
the implementing class. This class is also used by
javax.xml.parsers.DocumentBuilderFactory and is duplicated for each JAXP
subpackage.

I would like to know if I should implement a similar class or I should
include the code in MapFactory.java. I guess that it is better to keep
things separated, isn't it?

Thanks,

Paloma



More information about the Yanel-development mailing list