Hi,
iPOJO does not support setting an injected service dependency. So this is not
supported:
@Requires
private Service svc;
…
svc = new MyService()
…
The new sec value will be ignored.
However, you can use bind/unbind methods to set the service object you want to
use:
@Bind(filter="…")
public void bind(Service svc) {
this.svc = svc;
}
Your code can call the bind method to set the object to use. Be aware that the
svc field does not have the @Requires anymore and you need to handle the
synchronization yourself.
Regards,
Clement
On 23 mars 2013, at 00:41, lessonz <[email protected]> wrote:
> I have a field for which I'd like to use the @Requires annotation with a
> filter. That works just fine, but in a test environment I'd like to be able
> to use a setter to replace the service represented by this field at
> runtime. That is, the @Requires has been fulfilled, and I want to replace
> it by way of a setter. This new value doesn't match the filter. Is that the
> issue? Is there a way to do something like this?
>
> Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]