Kent, I think you are right that we can't have this on Objects and Values, as you point out, we don't control the destruction,
The problem of supporting ServiceActivator on the composites together with Mixins at the same time is that there is a 'precedence' problem; If several Mixins implements it, then one of them will be called via the invocation stack whereas the others won't. It makes an imbalanced execution expectation on the Mixins. Maybe not major, but a bit odd. Niclas On Thu, Nov 12, 2015 at 6:19 PM, Kent Sølvsten <[email protected]> wrote: > What about something like > > (1) @Activators can be declared either on composites or mixins (today > only on composites) > (2) As as side-effect, both a composite or a mixin may implements > ServiceActivation with the desired effect (just syntactical sugar around > @Activators) > (3) Initializable could be changed to be syntactical sugar around > @Activators - so may be used both on composites or mixins > > Open question: Can ObjectFactory#newObject in any meaningful way be > changed to use @Activators instead of Initializable? > I guess not, since the destruction methods would never be invoked, thus > potentially leading to confusion. > > /Kent > > > Den 12-11-2015 kl. 09:52 skrev Paul Merlin: > > Niclas Hedhman a écrit : > >> Ok, naming might be an issue, but there is a deeper one. > >> > >> Is it correct that the ServiceActivation.activateService() is called on > the > >> ServiceComposite and not each Mixin implementing it?? > > Correct. > > > >> Just like Initializable was changed to be called on the Mixin, instead > of > >> the Composite, I think a similar lifecycle method pair is needed for > >> Services. Otherwise it is really hard to make very generic Mixins that > >> works independently of the whole ServiceComposite. > >> > >> Lifecycle is another interface with these semantics for entities. > > Makes sense. Could you please capture that in a JIRA? > > > > Cheers > > > > /Paul > > > > -- Niclas Hedhman, Software Developer http://zest.apache.org - New Energy for Java
