felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall" <he...@ungoverned.org>
Subject Re: persistent state of bundle is changed to ACTIVE before bundle is activated
Date Mon, 08 Sep 2008 16:08:20 GMT
Sahoo wrote:
> Richard S. Hall wrote:
>> Sahoo wrote:
>>> In "private void _startBundle(FelixBundle bundle, boolean record)" 
>>> method in Felix.java, I see that a bundle's persistent state is 
>>> changed to ACTIVE before the bundle is actually activated. Is this 
>>> not likely to cause problems when there is any exception during 
>>> actual activation of the bundle?
>> What kind of problem do you anticipate?
> Since the code first sets the persistent state to ACTIVE and then does 
> a lot of work including invoking the activator, there is a good chance 
> of some exception happening after the state is changed but before 
> start() returns. In such a case, the code does not reset the 
> persistent state. Is this OK?

I don't think the code ever resets the persistent state. To do that, you 
must call Bundle.stop(). An exception does not reset the persistent 
state, it only impacts the run-time state, which is set back to RESOLVED.

-> richard
> Thanks,
> Sahoo

View raw message