Thanks Gokturk!

That was along the same line I was thinking, but somehow when I
added propagation=true to the Component annotation, the whole setup started
working as expected.

Its not documented anywhere though.

/TJ

On Thu, Aug 2, 2012 at 8:17 PM, Göktürk Gezer <[email protected]>wrote:

> Hi,
>
> iPOJO's updated method is called for iPOJO managed properties. Non-matching
> properties are propagated to services published by iPOJO instance as
> service properties.
>
> To catch all properties published by ConfigAdmin, you should rather try to
> register your own ManagedService interface in your component's
> initialization method with the same PID("my.config" in your case) and use
> that ManagedService.updated() method without @Updated annotation. So there
> will be two ManagedService for a PID in this case, one is the iPOJO's own
> registered ManagedService for binding published properties by ConfigAdmin
> to actual iPOJO Property declerations, and the other one will be your
> ManagedService.
>
> Regards,
> Gokturk
>
> On Thu, Aug 2, 2012 at 4:52 PM, Thomas Joseph <[email protected]>
> wrote:
>
> > Hello All,
> >
> > I am new to using iPOJO and wanted to solve a particular problem that I
> > have already done with native OSGi.
> >
> > I have a class like this
> >
> >
> > @Component(managedservice="my.config")
> > @Provides
> > @Instantiate
> > public class MyConfigImpl {
> > private final Logger log = LoggerFactory.getLogger(this.getClass());
> >  @Property(name="property1")
> > private String  property1;
> >  public String getProperty1() {
> > return  property1;
> > }
> >
> > @Updated
> > public void updated(final Dictionary properties) {
> >               // do something with all the properties recieved
> >         }
> > }
> >
> > All I want to do is that apart from getting the properties populated from
> > the OSGi config, I would like to get a callback on the updated method
> with
> > "all" the properties provided in the configuration and not just "
> > property1".
> >
> > How can I achieve this?
> >
> > Any help would be appreciated.
> >
> > --
> > Thanks and Regards,
> > /Thomas Joseph
> >
> >
> > ------------------------------------------------------------
> > Promote Open Source - Promote Liberty of Ideas and Software.
> > ------------------------------------------------------------
> >
>



-- 
-- 
Thanks and Regards,
/Thomas Joseph

LinkedIn: http://www.linkedin.com/in/ethomasjoseph
Twitter: http://twitter.com/ethomasjoseph
Blog: http://openthoughtworks.blogspot.com

------------------------------------------------------------
Promote Open Source - Promote Liberty of Ideas and Software.
------------------------------------------------------------

Reply via email to