[EMAIL PROTECTED] wrote:
Hi all,

this week I learned the hard way that Component references are not
initialized during startup but on the first method call on a Service.

I found some flags called "eagerinit" in the code and a matching
annotation "@EagerInit". In the SCA specification this annotation is not
documented well, but I think that it may be used to annotate a
implementation class to perform initialization on startup time.
Of course I tested it, but nothing happened.
So is my understanding of "@EagerInit" right that this annotation would
force a Service to initlaize it's references before a method is called ?
And is this annotation supported by Tuscany ?


Bye,
Daniel

@EagerInit seems to be supported. I've been successful with @Scope("COMPOSITE") @EagerInit, that combination causes a component instance to be created when the Tuscany node starts, and its references injected with pointers to the other components in the composite.

However, I had to place my EagerInit component at the bottom of the composite file to get it initialized after the other components that it was referencing. That's probably a Tuscany bug, I'm hoping that the Tuscany developers working on that part of the code jump in and help clarify that part.

--
Jean-Sebastien

Reply via email to