Hi Felix users,
I wonder if anyone knows why the Felix @Reference annotations are valid on 
fields, but not methods, whereas the opposite is true for the OSGi standard 
@Reference annotation. 
I would very much like to have a service bound, which I don’t keep a reference 
to in the rest of my class (so that I can guarantee that code in the rest of 
the class doesn’t depend directly on the reference). For example:

int value;
private void bindValueGetter(ValueGetter s){
        value = s.getValue();
}

With the annotation on the field, I am forced to have a reference to the 
ValueGetter, which might mislead programmers into using it - without the 
reference there I can just keep the cached values when the service arrives the 
first time and not have to document, etc that it might be null.

Thanks, Dan.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to