Comment #92 on issue 62 by [email protected]: Lifecycle support
http://code.google.com/p/google-guice/issues/detail?id=62
Bob,
I'm not suggesting that Closeable replace @PreDestroy. I'm saying: don't
make us implement @PreDestroy for Closeable. Guice should provide this
reasonable default behavior.
What's the harm in auto-closing Closeable instances once their enclosing
scope is destroyed? There is no harm in doing so because the specification
explicitly states "If the stream is already closed then invoking this
method has no effect."
Common use-case: Closing database connections (if necessary) to prevent
leaks.
--
You received this message because you are subscribed to the Google Groups
"google-guice-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-guice-dev?hl=en.