Closed paulbakker closed 13 years ago
Hey Paul. I'm not sure I understand well what you're saying.
You want by doing something like :
@Inject @OSGiService Service service;
to be able to call methods from MyServiceImpl.java (if the actual service implementation is MyServiceImpl of course) ? or something like :
@Inject @OSGiService(lookup=Service.class) MyServiceImpl service;
@Inject @OSGiService(lookup=Service.class) MyOtherServiceImpl service2;
I'm not sure it's very OSGi-ish to do something like that because in OSGi the implementation of service can be hidden, so the client bundle won't be able to use this class.
Currently, the exposed services through OSGi service registry are Weld proxies, the same you'll use in a plain old Java EE app (actually these proxies are extensions of concrete bean classes).
After injecting a service it should be possible to see methods that are not in the interface type. This is useful if multiple services are injected by marker interface. The proxy framework only exposes interfaces, with CGLib you can extends concrete classes.