dev@grizzly.java.net

Re: ServletAdapter#addListener patch

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 06 Jul 2009 15:07:16 -0400

Salut,

I think the patch is missing a couple of listeners:

   * http://is.gd/1p4U9
   * http://is.gd/1p50j

That was our regression last time. Adding the missing one will make the
patch works IMO.

Thanks

-- Jeanfrancois




Igor Minar wrote:
> Hi folks,
>
> First of all thanks for the commit rights, I missed your thread on
> grizzly-dev and saw it only recently after JFA told me that I have the
> right already.
>
> Today I finally fixed something I started working on for 1.9.16 and
> unfortunately introduced a regression with my change.
>
> My ultimate goal was to clean up the way listeners are being added to an
> adapter and most importantly make it possible to pass in existing
> listener instances into an adapter.
>
> I'm attaching a patch that addresses these issues:
>
> https://grizzly.dev.java.net/issues/show_bug.cgi?id=618 Exceptions from
> constructors of servlet listeners are being quietly swallowed
> https://grizzly.dev.java.net/issues/show_bug.cgi?id=630 Typesafe api for
> ServletAdapter#addServletListener
> https://grizzly.dev.java.net/issues/show_bug.cgi?id=631 Allow instances
> of ServletContext*Listeners to be added to ServletAdapter
> https://grizzly.dev.java.net/issues/show_bug.cgi?id=666
> ServletAdapter.addServletListener does not accept HttpSessionListener
>
> All of these issues are interconnected, so that's why there is just one
> patch for it.
>
> I made two controversial changes that I'd like to point out and get your
> okay for:
> - if a listener is passed in by name or by class and it is not possible
> to load or initialize it, an IllegalArgumentException is thrown. This is
> to ensure that a misconfigured application fails to start rather than
> start and later on fail to work properly.
> - I deprecated ServletAdapter#addServletListener and replaced it with
> ServletAdapter#addListener (which is overloaded several times). This is
> due to the fact that using this method both servlet and http session
> listeners are being added, so the method was originally misnamed.
>
> I didn't want to commit all of this into the trunk in case you don't
> feel comfortable about this change making it into 1.9.17, but I'm
> hopeful that it can be part of 1.9.17 because my project would like to
> use the new typesafe api methods.
>
> All the existing tests are passing + I added 15 new tests just for
> listener loading.
>
> Let me know what you think and if I should go ahead a commit it to the
> trunk.
>
> cheers,
> Igor
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net