You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@polygene.apache.org by zhuangmz08 <zh...@qq.com> on 2016/04/19 16:11:48 UTC

回复: service initialization order?

Thank you so much.
Yes, I'm Chinese living in Shenzhen about 1000km away from Shanghai. I'm surprised that you live in China too. Yes, I think we can meet up someday this year:)
I love zest so much!




------------------ 原始邮件 ------------------
发件人: "Niclas Hedhman";<he...@gmail.com>;
发送时间: 2016年4月19日(星期二) 晚上9:36
收件人: "dev"<de...@zest.apache.org>; 

主题: Re: service initialization order?



1. Yes dependency trees are effectively in place. In reality is somewhat
simpler... A model is built from all registered types and what injection is
required for each. When the service is referenced, and it hasn't been
activated, it is activated.
That means if serviceA has serviceB injected, when the serviceA is
activated, the serviceB will be activated if needed. That is pretty
obvious. But if both serviceA and serviceB is marked instantiate on
startup, you will not be guaranteed that serviceB will be activated first,
just because serviceA depends on it.
I don't think you can influence this, other than create a third service
that calls them in order

2. Yes

3. I need Paul to answer that. I am not sure.

BTW, I guess you are Chinese. Do you live in China? In Shanghai? If you
want, we can meet up...

Niclas
On Apr 19, 2016 09:03, "zhuangmz08" <zh...@qq.com> wrote:

> Hi,
>
>
> I'd like to ask the following 3 questions, any help will be appreciated.
> 1.  What's the extract order when multiple service activate? Does it
> starts up along the dependency tree? Can I specific the order?
> 2.  Does they passive one by one in the reverse order?
> 3.  Could you explain more details on the life cycle of a service?
>   beforeConstructor -> constructor -> postConstructor -> beforeActivation
> -> activate -> postActivation -> beforePassivation -> passavate ->
> afterPassivation?
> Thanks a lot.

Re: service initialization order?

Posted by Niclas Hedhman <ni...@hedhman.org>.
Well, SZ is a bit too far for regular hanging out. But sure contact me
when/if you come to SH.

Also, I will be at Qihoo360 open source conference in Beijing on 20-22 May.

On Tue, Apr 19, 2016 at 10:11 PM, zhuangmz08 <zh...@qq.com> wrote:

> Thank you so much.
> Yes, I'm Chinese living in Shenzhen about 1000km away from Shanghai. I'm
> surprised that you live in China too. Yes, I think we can meet up someday
> this year:)
> I love zest so much!
>
>
>
>
> ------------------ 原始邮件 ------------------
> 发件人: "Niclas Hedhman";<he...@gmail.com>;
> 发送时间: 2016年4月19日(星期二) 晚上9:36
> 收件人: "dev"<de...@zest.apache.org>;
>
> 主题: Re: service initialization order?
>
>
>
> 1. Yes dependency trees are effectively in place. In reality is somewhat
> simpler... A model is built from all registered types and what injection is
> required for each. When the service is referenced, and it hasn't been
> activated, it is activated.
> That means if serviceA has serviceB injected, when the serviceA is
> activated, the serviceB will be activated if needed. That is pretty
> obvious. But if both serviceA and serviceB is marked instantiate on
> startup, you will not be guaranteed that serviceB will be activated first,
> just because serviceA depends on it.
> I don't think you can influence this, other than create a third service
> that calls them in order
>
> 2. Yes
>
> 3. I need Paul to answer that. I am not sure.
>
> BTW, I guess you are Chinese. Do you live in China? In Shanghai? If you
> want, we can meet up...
>
> Niclas
> On Apr 19, 2016 09:03, "zhuangmz08" <zh...@qq.com> wrote:
>
> > Hi,
> >
> >
> > I'd like to ask the following 3 questions, any help will be appreciated.
> > 1.  What's the extract order when multiple service activate? Does it
> > starts up along the dependency tree? Can I specific the order?
> > 2.  Does they passive one by one in the reverse order?
> > 3.  Could you explain more details on the life cycle of a service?
> >   beforeConstructor -> constructor -> postConstructor -> beforeActivation
> > -> activate -> postActivation -> beforePassivation -> passavate ->
> > afterPassivation?
> > Thanks a lot.
>



-- 
Niclas Hedhman, Software Developer
http://zest.apache.org - New Energy for Java