Hi, I did some research, but didn¹t find a way to register a generic service. I would like to do sth like this
context.registerService(Map<K,V>.class, service, properties), I.e. context.registerService(Map<Integer,String>.class, new HashMap<Integer,String>(), null) The injection should then only work if the registered and the injected K and V are the same. Assuming I only have one service of type Map registered, @Reference public void setMapService(Map<Integer,String> mymap) { This.map = my map; } Would succeed. The following would fail as V (registered) != V(referenced service) @Reference public void setMapService(Map<Integer,Integer> mymap) { this.map = mymap; } As a workaround, I could define K and V as service properties and filter for them, but that¹s not very elegant and very error prone Any feedback would be appreciated Frank _______________________________________________ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev