I would like to override a method in an object that\'s handed to me by a factory that I have little control over.
My specific problem is that I want to override the
You can't really change an object on the fly in java.
You could have something which do what you want by wrapping your Foo into another similar objet which will delegate every call to Foo and at the same log everything you want. (see Proxy)
But if you want to do logging, maybe aspect is a better choice. (see AspectJ)