Hi Michael,

it's been quite a while since I've been playing around with karaf and
vert.x from principle it should still work though.
Maybe you find some help here:
https://github.com/ANierbeck/Karaf-Vertx/tree/master

I also used the spi-fly bundle to have some SPI stuff working.
https://github.com/ANierbeck/Karaf-Vertx/blob/master/Vertx-Feature/src/main/feature/feature.xml

maybe it will point you into the right direction, it's not with the latest
version.

regards, Achim


Am Di., 26. März 2024 um 12:46 Uhr schrieb Michael Elbaz <
[email protected]>:

> 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 <[email protected]> <[email protected]>:
>
> 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...:-) )
>
>
>
>

-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Reply via email to