users@servlet-spec.java.net

[servlet-spec users] Re: Default methods for event listeners?

From: Mark Thomas <markt_at_apache.org>
Date: Wed, 23 Sep 2015 13:01:23 +0100

On 23/09/2015 12:33, arjan tijms wrote:
> Hi,
>
> The Servlet event listener interfaces, such as e.g.
> ServletRequestListener, or AsyncListener have multiple methods that
> implementations must implement.
>
> However, in many cases implementations are only interested in one
> event. E.g. I may be interested in requestInitialized, but I still
> have to provide an empty method for requestDestroyed.
>
> Using JDK 8 default methods this can be easily overcome; provide
> (empty) default methods for all interface methods and then
> applications only have to implement what they're interested in.
>
> Thoughts?

+1

Mark