felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Bosschaert <david.bosscha...@gmail.com>
Subject Re: How to use a service immediately after its activation?
Date Wed, 19 Mar 2014 12:10:10 GMT
Yep, in order to use any of the OSGi hooks, they need to be installed
before you can rely on them, so if there are solutions that can be
done without hooks these should be preferred.

Cheers,

David

On 19 March 2014 04:36, Neil Bartlett <njbartlett@gmail.com> wrote:
> Bear in mind that the Service Hook approach is not a panacea: there is
> still no guarantee that the hook will be installed before other consumers.
> To provide this kind of guarantee you would have to resort to bundle start
> ordering.
>
> Regards,
> Neil
>
>
> On Wed, Mar 19, 2014 at 11:25 AM, Bertrand Delacretaz <
> bdelacretaz@apache.org> wrote:
>
>> Hi,
>>
>> On Tue, Mar 18, 2014 at 10:22 PM, Neil Bartlett <njbartlett@gmail.com>
>> wrote:
>> > ...Whatever you're trying to do in your special listener, wouldn't it be
>> > better done inside the same bundle as the service?...
>>
>> You're right, and this is similar to what Bruce suggests - the
>> bundle's initialization code can look for initializer services using a
>> whiteboard pattern, and call them before making the actual service
>> available.
>>
>> To answer Marcel's question about the use case, the app in question is
>> Sling-based and uses a content repository service. When upgrading the
>> app you might need to make some changes to the content before the new
>> version of the app starts working with the content repository. So yes,
>> making this part of the content repository service design makes
>> absolute sense.
>>
>> David B's hooks suggestion also looks interesting, as a generic way of
>> talking to services early in the setup phase.
>>
>> Thanks everybody for the pointers!
>>
>> -Bertrand
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message