On Wed, Jan 20, 2010 at 9:39 PM, Stanislav Muhametsin
<[email protected]> wrote:

> @Mixins({MyEmptyInterface.MyLifecycleMixin.class})

> Is this a bug or a feature?

It is a feature (which unfortunately bites you in the butt often). The
@Mixins annotation is NOT "put in these Mixins" but a list of "Here
are the Mixins that you can pick method implementations from". So, the
Composite interface is scanned for methods, and for each found method
it will look in the list of mixins and pick a method that is
compatible, and for each of the classes found the instantiation will
occur.

> I assume this also happens when I want to implement Initializable interface
> instead of Lifecycle, however I did not test this.

Yes, Initializable is checked upon instantiation of the Mixin.


Note that "methods" in my explanation also includes the methods of the
Private Mixin references, i.e.

@This
private Niclas mixin;

and can often help in the situations I think you are exploring.


Cheers
-- 
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java

I  live here; http://tinyurl.com/2qq9er
I  work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to