Note that there are some explanatory texts on larger screens.

plurals
  1. PODynamism of services when using Aries blueprint
    primarykey
    data
    text
    <p>I'm building a caching system in my OSGI application where my initial thought was, ok when a service is registered I want to apply caching to, I just proxy that service and register the proxy with a very high service ranking.</p> <p>This almost works, depending on in which order my bundles are started. If the consumer is started last everything works, and also if I stop the caching bundle the consumer is fallbacking to the original implementation <strong>BUT</strong> if I restart the caching bundle then the consumer doesn't get the proxy version of the service.</p> <p>To make a simple example for proving this I made a simple bundle which registeres a know service by hand with a much higher ranking (ie. not creating proxies etc.) and the problem still remains, when the higher ranked service gets started the consumer still uses the lower ranked service.</p> <p>Do the dynamism of blueprint only applies in certain circumstances? </p> <ol> <li>Initial wiring -> choose the highest ranked service</li> <li>When wired service disappear -> choose the highest ranked service</li> <li>When a new service appear -> don't do anything</li> </ol> <p>Is there any way to get the behavior of 1 and 2 also on the 3:d case?</p> <p>Or is there a better way to accomplish what I'm trying to do? Ie. with HookEvent or similar?</p> <p>Thanks</p> <p><strong>EDIT:</strong> I solved this particular problem by updating used bundles after proxy registration, that seems to update the service wirings.</p> <pre><code>Bundle[] usingBundles = reference.getUsingBundles(); for(.....) { b.update(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload