Hi Stephan,

in your reply you wrote:
[... snip ...]

>(An OOo extension, on the other hand, would have problems to specify a >URL for the saxon9.jar in the OOo installation---and should also of >course not do so at all, as saxon9.jar is not part of the stable >interface between OOo and its extensions---and would need to include >its own copy of saxon9.jar next to its main jar file instead.

later on you wrote:

You must not place the extension jar on the global class path.


Now I have a theoretical problem, or well maybe I am just not sure about how things would work in that case:

The OOo Extension would provide a class that is loaded via class.forName() from the XMLTransformer(XMLFilter.jar) and some class inside saxon9.jar would want to call a method there with some parameter being of the type of an interface also defined in saxon9.jar. If I now place an own copy of saxon9.jar next to my extension jar and reference that in the MANIFEST of my extension jar wouldn´t there be a conflict than that there would be the classloader which loaded the interface from the offical saxon9.jar and the other classloader that loaded it from my own copy of saxon9.jar for my class. Would those two instances with the same name of an java interface not be considered to be different by the JVM because they have been loaded by different classloaders. And wouldn´t than some Saxon class loaded from the XML Filter which loaded it by OOo Context-ClassLoader analysing the methods of my class not see anymore that the parameter for the classes method is supposed to be of the same interface (defined in the OOo saxon9.jar) that it expects to find in order to determine on how to call my method. Wouldn´t the saxon java extension mechanism not just fail to work if I do so?

Bye the way: Let's leave the discussion of what is or is not to be considered to be part of a "stable" interface between OOo and its extensions aside. I am mainly just interested in how to get things working which I am currently experimenting with ;-). And besides: well if we do ship "some" XSLT Engine with OpenOffice and do allow to create XML Filters as Extensions depending on which XSLT Features (and XSLT level 1.0 vs. 2.0 etc.) the Filter wants to use and the support of those features in our XSLT Engine or non-support of them is already some kind of interface contract/requirement between OOo and the Extension, isn´t it?

You see well maybe I am not just sure about what ClassLoaders would do here: When my class from my extension is loaded and it uses an interface in saxon9.jar would that interface be defined for my class by a classloader which would recoginze the MANIFEST entry in my jar (and thus my own provided copy of saxon9.jar) or by the context classloader which already loaded the OOo saxon9.jar inside the XMLTransformer before?


-Stephan


Kind regards,
Bernd


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to