Hi Felix,

On Wed, Sep 17, 2008 at 10:09 AM, Felix Meschberger <[EMAIL PROTECTED]> wrote:
> Bertrand Delacretaz schrieb:
>>... In some cases, jcrinstall needs to uninstall bundles right after its
>> activate() method is called, for example when finding out that a
>> bundle that it installed is gone from the repository.
>
> Whose "activate()" method ? Do you mean, right after starting a bundle,
> it should immediately be uninstalled again ?

No, that's right after the jcrinstall's activate() method is called.
Jcrinstall starts a thread which immediately starts uninstalling other
bundles, if they are not found in the repository anymore.

>>... IIUC there's a conflict between the Felix SCR Component Actor trying
>> to do stuff with bundles, and jcrinstall doing the same.
>
> Actually the "conflict" is between the components being started and the
> bundle being stopped at the same time. This is a seldom but possible
> situation in any life OSGi system....

Ok, confirms my suspicion. If that happens, the best might be to retry
the uninstall call a bit later?

> ...If you try to remove the bundle, during the activating of the JCRInstall
> bundle (or immediately after that), you might in the system startup
> situation. In this case, I suggest you do the following: Register a
> FrameworkListener and only consider installation tasks after the
> FrameworkEvent.STARTED event has been received...

I'll try that, thanks for the suggestion.

> ...You can find out, whether the framework is starting up (and a
> FrameworkListener is needed) by checking the state of the system bundle
> (bundle 0): The system bundle only changes its state to started if the
> framework has completed startup....

Ok, will try (https://issues.apache.org/jira/browse/SLING-660)

-Bertrand

Reply via email to