felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bengt Rodehav (JIRA)" <j...@apache.org>
Subject [jira] Commented: (FELIX-2636) Cannot control the validity of an iPOJO instance using a configuration property
Date Fri, 08 Oct 2010 07:42:30 GMT

    [ https://issues.apache.org/jira/browse/FELIX-2636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12919186#action_12919186

Bengt Rodehav commented on FELIX-2636:

I've tried the latest trunk now. Seems to be 1.7.0-SNAPSHOT and not 1.8.0-SNAPSHOT which this
JIRA indicates.

It works! Great job Clement. I still have a couple of questions though:


I presently use the following code:

@Property(name = "connect.enabled", mandatory = true)
private boolean mValid = true;

Do I really have to initialise the mValid field? If yes, should I initialise it to true or

My reasoning is like this: Since this is a mandatory property, the instance will not be valid
until it gets a value from configuration manager. Thus I shouldn't have to initialise it at
all. Is this reasoning correct?


I use file install to control my configuration. Thus I can change the configuration (the "connect.enabled"
property) from either file install or directly in configuration manager (using the Webconsole
or my own GUI). Which takes precedence on startup?

My tests indicate that what I specify in file install will be used even when configuration
manager's cache differ from this value. Is this by accident or is this the way it will always
work? I think I can live with either way as long as it's deterministic.


When do you think this fix will be available in an iPOJO release. I would like to get it into
production as soon as possible since we've had incidents in production regarding this issue.

> Cannot control the validity of an iPOJO instance using a configuration property
> -------------------------------------------------------------------------------
>                 Key: FELIX-2636
>                 URL: https://issues.apache.org/jira/browse/FELIX-2636
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.4.0
>            Reporter: Bengt Rodehav
>            Assignee: Clement Escoffier
>             Fix For: iPOJO-1.8.0
> Controlling the validity of an iPOJO instance as follows doesn't work:
> @Controller
> @Property(name = "connect.enabled", mandatory = true)
> private boolean mValid = false;
> When initialising mValid to false (as above), the iPOJO instance becomes invalid even
though the configuration property (connect.enabled in this case) is true.
> On the other hand, if the following code is used...
> @Controller
> @Property(name = "connect.enabled", mandatory = true)
> private boolean mValid = true;
> ...then the instance becomes valid even though the configuration property is false.
> I use Karaf 1.6.0 with file installer 3.0.2 in the scenario above. The problem only occurs
when starting Karaf. Subsequent changes of the configuration property will change the validity
of the instance correctly. The problem does not show when using iPOJO 1.6.0 but it's still
important to make sure that the above described scenario is supported by iPOJO.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message