I'm trying to use the @ServiceController annotation to handle registering a
service. In this case I need to use it because I have a field the service
really should have an @Requires relationship with, but I cannot use that
annotation because I also need to provide a setter. So, that setter uses
the @Bind annotation and sets the service controller field to true. This
method is being called as gogo's instance command shows the value of the
@Bind field as resolved. Unfortunately, gogo's instance command also shows
the service is unregistered and controller value as false.

I am using:

    @ServiceController
    private boolean valid = false;

but have also tried:

    @ServiceController(value = false)
    private boolean valid;

Neither changes the outcome. The service remains unregistered and its
controller value false.

I have successfully used the @ServiceController annotation elsewhere, but
not within a @Bind annotated method. Is that the issue? Is the method
sandboxed somehow? Is there a better way to achieve my objective of
preventing registration of my service until after a field has been bound?

Cheers.

Reply via email to