Dear JXPath Develpers,

I have a feature request for JXPathIntrospector regardings its strategy to
find/load "...XBeanInfo" classes:

Currenty, JXPathIntrospector tries to load the bean info (e.g.
ClientRelationshipXBeanInfo) classes through the classloader defining the
bean class (e.g. ClientRelationship) or through the classloader defining
JXPathIntrospector itself. By the way: the source code comments in
JXPathIntrospector state that the bootstrap or system classloader is used,
which is wrong. As far as I know, Class.forName(...) uses the caller's
classloader which is JXPathIntrospector.class.getClassloader().

I think it would be nice to try the current thread's context classloader as
well.

Argument 1:
This would allow us to place the JXPath library into the lib/ext directory
of the JRE, the bean classes into a common jar archive (for instance
together with my J2EE beans) and the bean info classe into the
WEB-INF/classes directory of my web application.

Argument 2:
The J2EE specification states, that J2EE 1.3 containers must provide a per
thread context classloader which can be used by system or library classes
(like JXPath) to load custom application classes. So, if the containers
support this feature, why not using it?

Argument 3:
The class "java.beans.Introspector" is implementing this startegy as well.

But ...
Perhaps there is a reason why this is not implemented until today. As far as
I can see it, Digester is also not using the current thread's context
classloader but instead allows to set the classloader explicitly by calling
digester.setClassloader(...). Is there a drawback in using the context
classloader?

In the meantime, we do not use bean info objects but register
DynamicPropertyHandlers in JXPathIntrospector.


Regards,

Stephan


--
Stephan Markwalder, Numcom Software AG
Hardturmstrasse 66, CH-8005 Zürich
Tel +41 (0)43 204 06 08, Direct +41 (0)43 204 06 03
Fax +41 (0)43 204 06 09, Mobile +41 (0)79 349 66 40
mailto:[EMAIL PROTECTED], http://www.numcom.ch




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to