dev@glassfish.java.net

Re: help listening for config changes

From: Jerome Dochez <jerome.dochez_at_oracle.com>
Date: Fri, 06 Aug 2010 06:17:28 -0700

On 8/5/10 1:38 PM, Bobby Bissett wrote:
> Howdy,
>
> I have a class that implements import
> org.jvnet.hk2.config.ConfigListener, but I'm not seeing the
> changed(PropertyChangeEvent[] events) method ever called when I do it
> see it called in other classes. Is there some other requirement
> besides implementing that interface that this class needs to meet?
> Does it need to be annotated with org.jvnet.hk2.annotations.Service
> for instance?
yes and it needs to be injected with the instance you want to listen to.
> I don't think I want this class to be a service.
then you should register your listener manually :

Dom.unwrap(configObject).addListener(listener);

>
> Thanks,
> Bobby
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>