First i do that:

 bundle:install -s mvn:org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle/1.3.7

<instructions>
    <Import-Package>*</Import-Package>
    <Require-Capability>
        osgi.extender; filter:="(osgi.extender=osgi.serviceloader.processor)",
        osgi.serviceloader; 
filter:="(osgi.serviceloader=io.vertx.ext.auth.HashingAlgorithm)";
        cardinality:=multiple,
    </Require-Capability>
</instructions>

but this is not working, but even if i register a DS service the java.util.ServiceLoader#load(java.lang.Class<S>) will be able to find this service ? (i think it was my first no success try) or maybe i don't understand you

Le 26/03/2024 à 12:39, Steinar Bang a écrit :
Michael Elbaz<michaelel...@outlook.fr>:
Thanks answering me but still not working i didn't even have a clue of
wich bundle need to be modified the one from wich the code is called i
suppose any other proposition ?
Well I don't know vertex-auth-common, but I think it is likely that it
has some sort of service registry, i.e. some class with a static method
or something that registers the services?

If so, then you can try a variant of my TwelveMonkeys trick, which is:
  1. Use SPI-fly to load the services for the hashers you want to use
  2. Create a DS component that gathers the services and registers them
     with vertex-auth-common's service registry

This will be a little more complex than ImageIO, since ImageIO is part
of the Java runtime, and vertex-auth-common (probably) isn't.

But it should work if vertex-auth-common is an OSGi bundle that exports
the package containing the service registry.

Then you can just use that registry where you need it and (hopefully)
the class should be found

(Note the "hopefully" part above...:-) )

Reply via email to