Jared's solution is definitely the right way to think of this, but I'd
personally override the 'afterCompletion' method in the AdviceFilter
superclass instead of 'cleanup'.

'cleanup' calls 'afterCompletion' in all cases, and will additionally
handle any extraneous/unexpected exceptions that might be thrown from
'afterCompletion'.  And there is no need to call super.foo.  In this
way I think it is a bit safer/more convenient to override
afterCompletion rather than cleanup.  This is just my preference
however.

Cheers,

Les

Reply via email to