felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lessonz <lessonz.leg...@gmail.com>
Subject Re: [iPOJO] ServiceController
Date Wed, 24 Apr 2013 17:08:46 GMT
I should also add if I use:

    @ServiceController
    private boolean valid;

it appears to work.



On Wed, Apr 24, 2013 at 10:52 AM, lessonz <lessonz.legion@gmail.com> wrote:

> 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.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message