I am referring to RFC 204 [1].  Which allows framework extensions to
provide a bundle activator which is run as part of framework
initialization.  This allows hooks to get registered before the framework
is started.

Tom

[1] https://github.com/osgi/design/tree/master/rfcs/rfc0204





From:   Cristiano Gavião <[email protected]>
To:     OSGi Developer Mail List <[email protected]>,
Date:   01/13/2014 09:17 AM
Subject:        Re: [osgi-dev] FindHook and EventListenerHook would work well
            if registered with DS?
Sent by:        [email protected]



Hello Tom,

Ah, now I fully understood what was happen in my tests here. many thanks
for the explanation.

about the R6 spec you referred, it is the RFC 198 - System Bundle and
Framework Hooks ?

best regards,

Cristiano


2014/1/13 Thomas Watson <[email protected]>
  No matter how you get your service hooks registered there is always a
  timing issue to contend with.  Any bundles that interact with the service
  registry before your hooks are registered will see the services you may
  be trying to hide.  Out of necessity service hooks are low level and need
  to be registered with the system as early as possible.  Using DS or any
  other extender to get your service hooks registered places just one more
  dependency from your hook implementation which means more things need to
  get started before your service comes on line.  This risks leaking the
  service you want to hide.

  The recommended approach is to register your service hooks using the the
  BundleContext directly from a bundle activator and set the start-level of
  your bundle to the lowest possible start-level before all other bundles
  get started.  In the future R6 core spec you may even consider using a
  framework extension so your hooks are in place before the framework is
  even started.

  Tom



  Inactive hide details for Cristiano Gavião ---01/12/2014 01:50:43
  PM---Hello OSGi experts, I would like to use FindHook and EveCristiano
  Gavião ---01/12/2014 01:50:43 PM---Hello OSGi experts, I would like to
  use FindHook and EventListenerHook to restrict service

  From: Cristiano Gavião <[email protected]>
  To: OSGi Developer Mail List <[email protected]>,
  Date: 01/12/2014 01:50 PM
  Subject: [osgi-dev] FindHook and EventListenerHook would work well if
  registered with DS?
  Sent by: [email protected]



  Hello OSGi experts,

  I would like to use FindHook and EventListenerHook to restrict service
  wiring for some packages.

  I know they can be registered using DS as any other service.

  But my doubt is, if I use DS to register the FindHook and
  EventListenerHook I still be able to interfere in the way services are
  wired or will be too late?

  btw, when DS will not be a good choice and I'll need to go to
  BundleActivator ?

  thanks a lot for any tip,

  regards,

  Cristiano
  _______________________________________________
  OSGi Developer Mail List
  [email protected]
  https://mail.osgi.org/mailman/listinfo/osgi-dev



  _______________________________________________
  OSGi Developer Mail List
  [email protected]
  https://mail.osgi.org/mailman/listinfo/osgi-dev



--
"Tudo vale a pena se a alma não é pequena..."
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

<<inline: graycol.gif>>

_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to