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

Dynamism helper for service handling #73

Closed mathieuancelin closed 13 years ago

mathieuancelin commented 13 years ago

It should be useful to provide a way to manipulate services without having to take care of dynamism (ie. service isn't present). I propose something like that :


@Inject Service<MyService> service;

for (MyService s : service.first()) {
    // code here is executed 0 or 1 time.
}

and


@Inject @OSGiService MyService service;

for (MyService s : safe(service)) {
    // code here is executed 0 or 1 time.
}

WDYT ?

mathieuancelin commented 13 years ago

Hum the second part seems very difficult to achieve