[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] Aspects: problem weaving same class file in different bundles

I suspect I can't do what I want to, but here goes anyway....

I have two 'applications' as bundles in equinox. Each use the same
code, they only differ in configuration and Bundle-SymbolicName. By
same code I mean they have identical copies, not shared code/services
or anything. Like this:

Bundle A
Bundle-SymbolicName: Widget_1
Has class Widget

Bundle B
Bundle-SymbolicName: Widget_2
Has class Widget

I have a separate bundle for the aspects which has this in the header:
Eclipse-SupplementBundle: Widget_*

If I install all three bundles and start bundle A then all fine. If I
then start B I get errors such as:
java.lang.LinkageError: loader constraint violation.....
.....MyAspects have different Class objects for the type Widget used
in the signature

I can understand what is happening I think, the Widget object having
already been woven, can not be woven again.

Is there a way around this? Would it help (possible?) to have a more
tightly defined pointcut (currently using constructor call on Widget),
ie something which can distinguish between the two Widgets?

Would it help to have aspects for each Widget in separate bundles and
have a more specific Eclipse-SupplementBundle header?

Rowan