felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clement Escoffier <clement.escoff...@gmail.com>
Subject Re: iPOJO - restarting component on configuration change
Date Tue, 11 Jan 2011 13:41:25 GMT


On 11.01.11 10:16, "Bengt Rodehav" <bengt@rodehav.com> wrote:

>I created the following JIRA ticket:
>
>https://issues.apache.org/jira/browse/FELIX-2773

Thanks,

>
><https://issues.apache.org/jira/browse/FELIX-2773>I'll try experimenting
>with the life cycle controller and see if I can use that as a workaround.
>
>Are you thinking something like this:
>
>- Create an attribute that acts as life cycle controller. Initial value
>would be true.
>- When I detect that a critical property (one that requires restart) is
>updated, I set the life cycle controller to false. I guess I would do this
>in an @Updated method.
>
>When do I set the life cycle controller to true again?


Probably at the end of the @Updated if everything is fine.

Regards,

Clement

>
>/Bengt
>
>2011/1/11 Clement Escoffier <clement.escoffier@gmail.com>
>
>> Hi,
>>
>> On 10.01.11 14:59, "Bengt Rodehav" <bengt@rodehav.com> wrote:
>>
>> >I use iPOJO and configuration admin. When certain configuration
>>properties
>> >change, I want to "restart" my iPOJO instance. I e I want the instance
>>to
>> >become invalid and then valid again. Currently I do some
>>initialisation on
>> >the method marked as @Validate and some cleanup in the method marked
>> >as @Invalidate.
>> >
>> >It's very tricky to get this to work. When I start my application it
>>seems
>> >like both the @Validate and the @Updated methods are called which
>>causes
>> >problems. What is the recommended way to accomplish this?
>> >
>> >Ideally I would like to mark my iPOJO properties as requiring the
>>instance
>> >to "restart", e g
>> >
>> >*  @Property(name = "rootUrl", restart = "true")*
>> >
>> >*  private String mRootUrl;*
>>
>> Unfortunately this is not supported. It can be an interesting feature to
>> allow an instance to be invalidated/validated during the
>>reconfiguration.
>> Could you open a jira issue  ?
>>
>> In the meantime, you could try to use the lifecycle controller to force
>> the invalidation / revalidation.
>>
>> Regards,
>>
>> Clement
>>
>> >
>> >
>> >/Bengt
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message