On Fri, Feb 12, 2010 at 3:56 PM, Sam Berlin <[email protected]> wrote:
> Is it possible to wrap the 'Connection' around some kind of
> 'ManagedConnection' that delegates to the actual Connection and
> restablishes the connection if it fails?  That way client code doesn't
> have to concern itself with the internals of how connection may
> arbitrarily fail -- ManagedConnection will do it itself.  The only
> thing that has access to a raw Connection is ManagedConnection, and
> everything else down the chain can pretend everything's fine.

Yeah, I think that's pretty much what Brian and I are saying. And the
same pattern applies for other things (like JNDI context) as well.
Also note the laziness here: you can have ManagedConnection (or
whatever) as part of your dependency tree without needing an actual
connection at that time. So not having a connection won't invalidate
the dependency tree.

Eelco

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" 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?hl=en.

Reply via email to