2007/4/14, Peter Hendry <peter.hendry_at_capeclear.com>:
> I was wondering why so many classes in the RI are "final"? Obviously
> this prevents them being extended. Classes like WSServlet and
> WSServletDelegate where both of these seem like ideal places to add
> functionality. WSServlet is defined in web.xml so is easily changed
> through configuration, and because WSServlet relies on getting an
> instance of WSServletDelegate which is set by the listener, it means a
> new listener cannot set a different class for WSServletDelegate and so
> it could not use WSServlet if it did wish to change WSServletDelegate
> through extension.
I think the primary thinking behind this is that it helps our team
members understand what are supposed to be extensible and what are
not. The other thinking behind this is that we want to retain the
freedom to change those as we find necessary.
Finding the right balance is difficult, and we need constant
adjustments. I haven't looked at the particular places you cited, so I
can't speak for whether marking them final was adequate or not.
Could you elaborate a bit more on what you were trying to do and why
you are interested in WSServletDelegate?
> Is this to prevent extension of the RI other than through the SPI
> points? If so then I would suggest that it presupposes that there are
> adequate SPI points and that they are well enough defined to expose any
> new functionality.
Generally speaking, we'd like people to only use the SPI (the stuff
defined in com.sun.xml.ws.api.) What we expose through that package is
driven by inputs like this, so an additional input would be very
helpful.
--
Kohsuke Kawaguchi