xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Isaac Shabtay" <ishab...@netvision.net.il>
Subject Services API?
Date Thu, 11 Oct 2001 21:20:51 GMT
Hey again.

JAXP has javax.xml.parsers.DocumentBuilderFactory and
javax.xml.transform.TransformerFactory, which are used to create a factory
Both have some sequence of searching to the factory implementation name. One
of the steps is quoted below (from
javax.xml.parsers.DocumentBuilderFactory's javadoc):

========START QUOTE=========

Use the Services API (as detailed in the JAR specification), if available,
to determine the classname. The Services API will look for a classname in
the file META-INF/services/javax.xml.parsers.DocumentBuilderFactory in jars
available to the runtime.
Platform default DocumentBuilderFactory instance.

========END QUOTE=========

My question is- what is this "services API"? I've been looking in the JAR
file specification, and all I could see there is just a short explanation
about this mechanism. There was no API there. They gave an example there,
which uses a class named "Service" and a method called "providers", but I
couldn't find this "Service" class anywhere.

The problem is, that currently, Apache's version of
javax.xml.parsers.DocumentBuilderFactory (as well as
javax.xml.transform.TransformerFactory) uses "the hard way" in order to get
this data (constructing an input stream, a reader etc. to read the file,
then read the line in that file etc.). Anyway, logically, if the "service
provider" issue is so standardized, it's obvious that some programmatic API
should be supplied. This way, we can avoid bugs like #2291

Any comments? Did I miss anything?

    - Isaac

In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org

View raw message