Konstantin Kolinko <knst.koli...@gmail.com> wrote:
>1) Calling PreDestroy methods if destroy() method fails. > >I think that PreDestroy methods should be called even if destroy() >fails. >For Filters it was fixed by r1428645 . For Servlets this is yet to be >fixed. > >I think this has to be fixed, similar to r1428645. +1. >2) Calling PreDestroy methods if init() method fails. > >The specs say that >- if @PostConstruct methods fail then nothing is called afterwards, and >- if init() fails then destroy() is not called. > >I wonder whether failure of init() precludes @PreDestroy methods from >being called. The current implementation is that they are not called. > >I feel some concern as JSR250 and Servlet API are different APIs, and >in view of r1429173 which fixed a similar issue with cache in >SecurityUtil. There is a distinct lack of clarity in the specs for this one. I'd leave it as is for now but open a Jira issue for the servlet spec to ask for clarification. >3) Besides annotations there are web.xml elements "<pre-destroy>" and >"<post-construct>". > >I do not see any proper documentation for them in the Servlet spec >(besides being mentioned in the fragment merging rules in ch.8.2.3). >Quick googling found this example from Jetty wiki: > >http://wiki.eclipse.org/Jetty/Feature/Annotations#Lifecycle_callbacks:_PostConstruct_PreDestroy > >They are also mentioned in JavaEE 6 Platform Specification (ch. >EE.5.2.5), which mentions that they are equivalent to annotations. > >A question is that searching by the tag names I do not see any code in >Tomcat that handles them. Nor me and I don't recall implementing anything for them either. This one needs a Bugzilla issue. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org