felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "issac@torito.org" <is...@torito.org>
Subject Re: iPOJO Field @Property
Date Thu, 27 Jan 2011 13:07:49 GMT
Its the iPOJO normal/known behaviour.
In order to set or initialize a default value, you must doit in the property
anotation.
   @Property(name = "statusName", value = "SOMETHING", mandatory = true)
   private String statusName;

why? I don't know, I think is a code manipulation problem.

2011/1/27 Carlos Quiroz <cquiroz@gemini.edu>

> Hi
>
> I'm using iPOJO and I want to also integrate with ConfigAdmin but I have
> found an issue that I'm not sure if it is by design or bugs
>
> I' having a bundle that defines a component (Not a service) and has a
> couple of configuration properties defined as fields:
> I'm also using the Felix ConfigAdmin and Felix FileInstall service setting
> the properties in a configuration file as simple properties
>
> The class look like:
>
> @Component(name = "GIAPI_STATUS_SERVICE", managedservice =
> "edu.gemini.aspen.giapi.statusservice.StatusService")
> @Instantiate(name="GIAPI_STATUS_SERVICE")
> public class StatusService {
>    @Property
>    private String statusName;
>
>    @Property
>    private String serviceName;
> ...
>
> @Updated
> public void updates() ...
>
> @Validated
> public void updates() ...
>
> Now, I expect that since the values are stored in the configuration they
> will be made available at @Updated but. If the fields are initialized in
> code like
>    @Property(name = "statusName", value = "INVALID", mandatory = true)
>    private String statusName = "SOMETHING";
>
> Then at @Updated statusName has the value "SOMETHING" rather than the one
> in the config file
>
> If I don't initialize then it works
>
> Any ideas?
> Carlos
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


-- 
Issac Noé García Garza

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