Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » how to handle circular dependency with jdom, jaxen and dom4j?
how to handle circular dependency with jdom, jaxen and dom4j? [message #335001] Sat, 14 March 2009 20:33 Go to next message
Eclipse UserFriend
Originally posted by: wbeckwith.gmail.com

For an rcp, I need to make plug-ins of jdom 1.0, jaxen 1.1.1 and dom4j
1.6.1. Unfortunately the plugins have the following 2 cycles

jdom depends on jaxen which depends on jdom
jaxen depends on dom4j depends on jaxen

Now I could put them all in a single plug-in and that would fix
potential classloader issues, but it would also bind requiring plug-ins
to the exposed classes, which is something I'd rather not do.

I thought about using buddy classloading and making each a registered
buddy of the other. In theory, this seems like it will work but am I
missing something or is there a better way to handle this?

Wb
Re: how to handle circular dependency with jdom, jaxen and dom4j? [message #335003 is a reply to message #335001] Sun, 15 March 2009 07:06 Go to previous messageGo to next message
Walter Harley is currently offline Walter HarleyFriend
Messages: 847
Registered: July 2009
Senior Member
"Wendell Beckwith" <wbeckwith@gmail.com> wrote in message
news:gph4a9$3jj$1@build.eclipse.org...
> For an rcp, I need to make plug-ins of jdom 1.0, jaxen 1.1.1 and dom4j
> 1.6.1. Unfortunately the plugins have the following 2 cycles
>
> jdom depends on jaxen which depends on jdom
> jaxen depends on dom4j depends on jaxen
>
> Now I could put them all in a single plug-in and that would fix potential
> classloader issues, but it would also bind requiring plug-ins to the
> exposed classes, which is something I'd rather not do.
>
> I thought about using buddy classloading and making each a registered
> buddy of the other. In theory, this seems like it will work but am I
> missing something or is there a better way to handle this?


Do they really all depend on each other, or can you separate interfaces and
implementations?
Re: how to handle circular dependency with jdom, jaxen and dom4j? [message #335039 is a reply to message #335003] Wed, 18 March 2009 17:00 Go to previous message
Eclipse UserFriend
Originally posted by: wbeckwith.gmail.com

Yes they really do but I believe I have it all worked out by refactoring
the jars and using buddy classloading. From Jdom, I moved the jaxen
classes to a new jar, jdom-jaxen,jar and configured the new jar to jave
kaxen and jdom as depedencies. Also the jdom and jaexn jars has a buddy
policy of registered. The jdom-jaxen.jar is registered to both the jdom
and jaxen jars.

Thus when a user needs a jdom or jaxen only class then they are fine.
However if the in jdom and they need to create an XPath.newInstance(...)
class which really depends on jaxen, then they classloader will fail to
find the class in the jdom bundle and will then ask it's registered
buddies to find it. Because the jdom-jaxen bundle hold the
implementation it will be found. However in the loading of the
JaxenXPath class, it will also need to load other jaxen classes which it
will have visibility to since it has the jaxen.jar on it's
require-bundle classpath.

I repeated the same things for jaxen and dom4j and all seems well.

Wb

Walter Harley wrote:
> "Wendell Beckwith" <wbeckwith@gmail.com> wrote in message
> news:gph4a9$3jj$1@build.eclipse.org...
>> For an rcp, I need to make plug-ins of jdom 1.0, jaxen 1.1.1 and dom4j
>> 1.6.1. Unfortunately the plugins have the following 2 cycles
>>
>> jdom depends on jaxen which depends on jdom
>> jaxen depends on dom4j depends on jaxen
>>
>> Now I could put them all in a single plug-in and that would fix potential
>> classloader issues, but it would also bind requiring plug-ins to the
>> exposed classes, which is something I'd rather not do.
>>
>> I thought about using buddy classloading and making each a registered
>> buddy of the other. In theory, this seems like it will work but am I
>> missing something or is there a better way to handle this?
>
>
> Do they really all depend on each other, or can you separate interfaces and
> implementations?
>
>
Previous Topic:add project nature filter for "Project References" list for a given project nature
Next Topic:Post save event listener
Goto Forum:
  


Current Time: Thu Jun 27 20:57:57 GMT 2024

Powered by FUDForum. Page generated in 0.03593 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top