dev@glassfish.java.net

Re: [v3] Config change listening - implementing ConfigListener and registering a VetoableChangeListener

From: Jerome Dochez <Jerome.Dochez_at_Sun.COM>
Date: Tue, 26 Aug 2008 11:20:30 -0700

On Aug 26, 2008, at 10:42 AM, Tim Quinn wrote:

> Hi, Jerome.
>
> 1. I understood very well in principle what you said in today's
> engineering meeting about registering as a vetoable change listener
> (as distinguished from implementing ConfigListener). As for the
> details, you said something about casting the config object as "our
> implementation" in order to register a vetoable listener.
> What are the details of that? Is there an example I can look at,
> because I have done some things in my change method that should be
> done in a VetoableChangeListener.
>
> If I have
>
> @Inject
> DasConfig dasConfig;
>
> how do I register my VetoableChangeListener to detect and possibly
> reject changes?
>
good question

VetoableChangeListener bean = (VetoableChangeListener)
ConfigSupport.getImpl(dasConfig);
bean.addListener(... my vetoable change listener instance...)

remember to remove yourself if needed.

The only issue is that I have not turned on support for this yet (!)
since nobody needed it. If you need it I can do it tomorrow.

> Sorry if this is obvious.
>
> 2. The change method declared on the ConfigListener interface
> returns an UnprocessedChangeEvents object. If a module cannot
> process a config change, should it throw an exception of some
> particular type, or should it create and populate and return an
> UnprocessedChangeEvents object?
>
the latter.
> Thanks.
>
> - Tim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>