Gang,
I had an unexpected behavior of Activatable, which I don't know whether it
is a bug or confusing me in general.
If I do
public class AbcMixin
implements Activatable, Abc
{
}
The activate() method will NOT be called if the AbcMixin is part of a
ServiceComposite and that ServiceComposite does NOT extends Activatable.
I have not checked, but I suspect that, only Activatable is called on the
ServiceComposite and not on the Mixin fragment, which means only one
activate() method on the Mixin will be called.
Somehow this feels very strange. Perhaps my use-case is tainting my
objectivity but isn't it the Mixin itself that has "activation" and
"passivation" needs, and not the Composite? Only the Mixin knows what
resources it needs to allocate and free up. Why would the ServiceComposite
have a clue? And likewise, if more than one Mixin has a need only one will
be called, and can't deal with it unless one create a strong relationship
from one to the other....
That said, I realize that a Mixin would always have the same need, no matter
if it is part of a ServiceComposite or some other Composite, and we can't
fulfill such contract easily (or can we?).
My proposal is that Activatable is checked on the Fragments and called
individually upon ServiceComposite activation/passivation.
WDYT?
Cheers
Niclas
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev