You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Jeff Peterson <j....@gmail.com> on 2008/12/23 19:12:38 UTC

Servicemix and the JBI lifecycle

Hi,

I am playing around with creating purist JBI components.  I have
noticed that what appears to be some odd behavior with respect to the
bootstrap lifecycle and component lifecycle.  I've created very basic
implementations of the Bootstrap, Component, ComponentLifeCycle, and
ServiceUnitManager interfaces.  I placed logging statements in each
one of the lifecycle methods (init, doInstall, doUninstall, start,
stop, shutdown, etc).

When I place my component zip file in the hotdeploy directory I see
all the startup related logging messages, as expected.  What I don't
see is any stop/shutdown related logging messages when I stop
servicemix (CTRL-C).  Is this normal?  If I drop a new version of my
component in the hotdeploy directory, I see servicemix attempting to
deploy the new version, but never stopping/shutting down the old
version.  Is this expected behavior?  In fact, the only time I see any
stop/shutdown messages is when I remove the component from the
hotdeploy directory while servicemix is running.

If I wanted to write a component that grabbed some resource on startup
and needed to free it or clean it up on stop, how would I do it? -- in
the purist JBI world.

Thanks,

Jeff

Re: Servicemix and the JBI lifecycle

Posted by Jeff Peterson <j....@gmail.com>.
Hi Gert,

Thanks for the response.

Im using Servicemix 3.3.  I supplemented all of my logging statements
with System.err.println's.

When I shutdown servicemix now (CTRL-C) I can now clearly see the
stop/shutdown lifecycle methods being called.  The odd thing is that I
see the output from System.err.println's but not from my logging
statements.

I am using the java.util.logging.Logger from the ComponentContext.  I
wonder if it has something to do with shutting down servicemix using
the the JVM shutdown hook.  Maybe JUL has some issue logging during
JVM shutdown.

Thanks,

Jeff

On Mon, Dec 29, 2008 at 1:01 AM, Gert Vanthienen
<ge...@skynet.be> wrote:
> Jeff,
>
> If I look at the output of DEBUG logging in ServiceMix, this works fine for
> all the standard JBI components we ship.  All of them are being
> stopped/shutdown properly on container shutdown.  I recall there was a
> problem with one of the earlier versions of ServiceMix, but the latest ones
> should be OK.  What version of ServiceMix are you using?  Could you verify
> logger configuration to make sure you are not filtering out these messages
> somewhere?
>
> Regards,
>
> Gert
>
> Jeff Peterson wrote:
>>
>> Hi,
>>
>> I am playing around with creating purist JBI components.  I have
>> noticed that what appears to be some odd behavior with respect to the
>> bootstrap lifecycle and component lifecycle.  I've created very basic
>> implementations of the Bootstrap, Component, ComponentLifeCycle, and
>> ServiceUnitManager interfaces.  I placed logging statements in each
>> one of the lifecycle methods (init, doInstall, doUninstall, start,
>> stop, shutdown, etc).
>>
>> When I place my component zip file in the hotdeploy directory I see
>> all the startup related logging messages, as expected.  What I don't
>> see is any stop/shutdown related logging messages when I stop
>> servicemix (CTRL-C).  Is this normal?  If I drop a new version of my
>> component in the hotdeploy directory, I see servicemix attempting to
>> deploy the new version, but never stopping/shutting down the old
>> version.  Is this expected behavior?  In fact, the only time I see any
>> stop/shutdown messages is when I remove the component from the
>> hotdeploy directory while servicemix is running.
>>
>> If I wanted to write a component that grabbed some resource on startup
>> and needed to free it or clean it up on stop, how would I do it? -- in
>> the purist JBI world.
>>
>> Thanks,
>>
>> Jeff
>>
>>
>
>

Re: Servicemix and the JBI lifecycle

Posted by Gert Vanthienen <ge...@skynet.be>.
Jeff,

If I look at the output of DEBUG logging in ServiceMix, this works fine 
for all the standard JBI components we ship.  All of them are being 
stopped/shutdown properly on container shutdown.  I recall there was a 
problem with one of the earlier versions of ServiceMix, but the latest 
ones should be OK.  What version of ServiceMix are you using?  Could you 
verify logger configuration to make sure you are not filtering out these 
messages somewhere?

Regards,

Gert

Jeff Peterson wrote:
> Hi,
>
> I am playing around with creating purist JBI components.  I have
> noticed that what appears to be some odd behavior with respect to the
> bootstrap lifecycle and component lifecycle.  I've created very basic
> implementations of the Bootstrap, Component, ComponentLifeCycle, and
> ServiceUnitManager interfaces.  I placed logging statements in each
> one of the lifecycle methods (init, doInstall, doUninstall, start,
> stop, shutdown, etc).
>
> When I place my component zip file in the hotdeploy directory I see
> all the startup related logging messages, as expected.  What I don't
> see is any stop/shutdown related logging messages when I stop
> servicemix (CTRL-C).  Is this normal?  If I drop a new version of my
> component in the hotdeploy directory, I see servicemix attempting to
> deploy the new version, but never stopping/shutting down the old
> version.  Is this expected behavior?  In fact, the only time I see any
> stop/shutdown messages is when I remove the component from the
> hotdeploy directory while servicemix is running.
>
> If I wanted to write a component that grabbed some resource on startup
> and needed to free it or clean it up on stop, how would I do it? -- in
> the purist JBI world.
>
> Thanks,
>
> Jeff
>
>