mathieuancelin / weld-osgi

This project aims to provide an OSGi integration for Weld. This project is no longer updated, see https://github.com/weld/core for updates
https://github.com/weld/core
12 stars 10 forks source link

Use CGLib instead of Proxy framework #50

Closed paulbakker closed 13 years ago

paulbakker commented 13 years ago

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.

mathieuancelin commented 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).