openplans/OpenTripPlanner — pull request #1286 by laurentg (2013-11-04 18:06:44+00:00)
Title: Stop background threads after webapp stop/reload.

When OTP is used within application containers such as Tomcat or Jetty, if the application is stopped or auto-reloaded, the various background updater threads are not stopped. This pull request attempt to solve this by registering @PreDestroy hooks to:
1) shutdown real-time threads (we use the existing GraphService::evictAll() which is supposed to do that)
2) shutdown background scan thread in the GraphServiceAutoDiscovery service
3) shutdown geotools threads that rely on client code to call them (WeakCollectionCleaner, DeferredAuthorityFactory)

Note: The big diff in GraphServiceFileImpl::evict() is only code auto-format.