I don't think there really is a generic way to do what you want. You
can try to put all bundles in one startlevel and your monitor bundle
in a later one (which might get you what you want) - otherwise, all I
can think of is to create a service that has dependencies on all the
services you are waiting for (obviously, that would be the not generic
way to do it).

regards,

Karl

p.s.: your example fails because the framework is already activated
when you register the listener. You need to check the state of the
system bundle too if you want to avoid the race condition.

On Mon, Jun 7, 2010 at 1:18 PM, Reto Bachmann-Gmuer
<[email protected]> wrote:
> Hmm, listing to FrameworkEvent.STARTED is what I tried.
>
> protected void activate(ComponentContext componentContext) {
>        logger.info("BootMonitor initialized");
>        final BundleContext bundleContext =
> componentContext.getBundleContext();
>        bundleContext.addFrameworkListener(this);
> }
> @Override
>    public void frameworkEvent(FrameworkEvent fe) {
>        if (fe.getType() == FrameworkEvent.STARTED) {
>            logger.info
> ("**********************************************************************");
>            logger.info("The instance is now operational.");
>        } else {
>            logger.info("Framework-event:"+fe.getType());
>        }
>    }
>
> unfortunately I don't seem t ohget any framework events, I thought taht DS
> stuff might be started after the franework started.
>
>
> Cheers,
> reto
>
> On Mon, Jun 7, 2010 at 1:03 PM, Rob Walker <[email protected]> wrote:
>
>> One option which we use is to listen for FrameworkEvent.STARTED.
>>
>> We used to listen to individual bundle started events and count them down,
>> but it was simpler in the end to just listen for the final framework started
>> event
>>
>> Regards
>>
>> -- Rob
>>
>>
>> On 07/06/2010 12:58 PM, Reto Bachmann-Gmuer wrote:
>>
>>> Hello
>>>
>>> I would like to log a message (or make a splash creen disappear) when all
>>> bundles are started and all their services (using declarative services)
>>> acive. How do I best do this?
>>>
>>> Cheers,
>>> re6to
>>>
>>>
>>>
>>
>> --
>>
>>
>> Ascert - Taking systems to the Edge
>> [email protected]
>> +44 (0)20 7488 3470
>> www.ascert.com
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>



-- 
Karl Pauls
[email protected]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to