Is it possible to automatically clean up resources at the end of scope in Guice?
问题 Let's say I have a Closeable object injected through Guice using request scope: @Provides @RequestScoped public MyCloseableResource providesMyCloseableResource(){ return new MyCloseableResourceImpl(); } Is it possible to hook-up a clean-up method that would automatically call close() on my resource when the scope exists, without resorting to custom scope implementation? Looking at the custom scope implementation guide on the Guice wiki, it shows that scopes should be created and cleaned up