jsr369-experts@servlet-spec.java.net

[jsr369-experts] Re: SERVLET_SPEC-142: ACTION: Use Java SE 8 default methods for listeners

From: Mark Thomas <markt_at_apache.org>
Date: Tue, 6 Oct 2015 08:56:16 +0100

On 05/10/2015 23:22, Edward Burns wrote:
>>>>>> On Fri, 02 Oct 2015 16:57:44 -0700, Shing Wai Chan <shing.wai.chan_at_oracle.com> said:
>
> SWC> In servlet users email alias, there is a discussion of default methods
> SWC> for listeners.
> SWC> The jira issue is SERVLET_SPEC-142: Use Java SE 8 default methods for
> SWC> listeners.
>
> SWC> Here are my investigations:
> SWC> 1. We can add no-op default methods to all of the methods in
> SWC> javax.servlet:
> SWC> ServletContextAttributeListener, ServletContextListener,
> SWC> ServletRequestAttributeListener, ServletRequestListener
> SWC> javax.servlet.http:
> SWC> HttpSessionActivationListener, HttpSessionAttributeListener,
> SWC> HttpSessionBindingListener, HttpSessionListener
>
> This is a great suggestion. +1.
>
> SWC> 2. We will "not" add no-op default method to
> SWC> javax.servlet.http.HttpSessionIdListener
> SWC> as there is only "one" method there.
>
> Good point.
>
> SWC> 3. We do not add no-op default methods to javax.servlet.WriteListener,
> SWC> ReadListener
> SWC> as all those methods are important.
> SWC> Developers need to take a look whether they need to override them.
> SWC> In fact, similar interface in JDK 8,
> SWC> java.nio.channels.CompletionHandler, does not have default methods.
>
> It is indeed best to force those to be carefully considered.
>
> SWC> 4. For javax.servlet.AsyncListener, we don't want default #onComplete as
> SWC> we may need to clean up resources there.
> SWC> Similarly, in #onError and #onTimeout.
> SWC> Should we leave AsyncListener without default methods for now?
>
> Yes, that's fine.
>
> ACTION: We're trying to close down and take a snapshot of the work in
> progress for in an EDR for JavaOne, so please weigh in on this
> by 17:00 PDT Tuesday 6 October 2015. Silence is consent on this one.

+1. Looks good to me.

Mark