On 9/10/14 2:25 PM, Paul Sandoz wrote:
FWIW i think you could do:
removeIf(e -> listener == e);
Ah ah. Interesting!
Idiomatically callback methods are often prefixed with on:
onConfigurationLoaded.
Thanks! Exactly what I was looking for :-)
I'll wait for more comments before updating the webrev, but
I like your suggestion. I should have remembered the idiom - it's
been too long since I have code my last 'onMouseClicked()' :-)
My inclination is this should be an interface if at all possible. The
permission check on construction seems odd to me but i don't understand the
security requirements here. It's very tempting to suggest not defining any new
interface and reuse Runnable, since as you indicate below this is not expected
to be common functionality and there is likely to be a single instance
registered.
I'd actually prefer not to use Runnable here if it could
be avoided...
-- daniel
Paul.
Also I like it that you need to have the LoggingPermission("Control")
to subclass ConfigurationListener.
In practice - I believe that there aren't that many application
which need this functionality - and I also believe that for those
that need it then there will be a single ConfigurationListener
that will be registered only once, and therefore having an
abstract class for ConfigurationListener shouldn't be that much of
a hassle for them.