Using Jetty 6.1.22 Filter.destroy
was called during shutdown. The spec just defines
Called by the web container to indicate to a filter that it is being taken out of service.
You should test it without IntelliJ, in a "real" environment, with a stand-alone tomcat
or jetty
.
Anyway, just to be safe, you could clean up both in Filter.destroy
and ServletContextListener.contextDestroyed
.
In that case synchronize your filter clean up. And make sure, if you clean up twice, that the 2nd run does not fail with an exception etc.