Is there a reason you can't check the current config value when the listener has been notified about something, and only act on it when enabled?
On 04.07.2014, at 16:35, James Nord (jnord) <[email protected]> wrote: > Hi all, > > How do you *dynamically* register and unregister a listener in a > non-deprecated way? > > e.g. > I want to attach a run listener only if some configuration has been set on a > plugin (and obviously it needs removing as well as adding if the options > changes!) > > RunListener.register() seems the obvious candidate but this is deprecated > with no viable alternative listed when you want to add a listener at runtime. > > Is the answer it's not deprecated for this use case - or have I missed some > other API? > > (bizarrely enough unregister() is not deprecated) > > Regards, > > /James > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
