AroundInvoke methods have the following signature. ...
Object <METHOD>(InvocationContext) throws Exception
Originally posted by Kai Witte:
Do I understand it correctly that an @AroundInvoke method must declare to throw Exception (EJB 3.0 Proposed Final Draft, 11.3)? That's bad for obvious reasons: It forces clients of that method to catch Exception, which would also affect RuntimeExceptions. The phrasing is a bit unfortunate:
The declared exception is not part of the signature in terms of the JLS or the VMS.
It is also bad that InvocationContext#proceed throws Exception: It forces clients of that method to catch Exception, which would also affect RuntimeExceptions.
Tony Morris
Java Q&A (FAQ, Trivia)
SCJP 1.4, SCWCD, SCBCD 1.3
Originally posted by Mike Keith:
On the one hand you are agreeing that throwing Exception is the much better approach
Originally posted by Mike Keith:
I don't know which "fundamental principle" you are referring to
Originally posted by Tony Morris:
I think it is generally accepted that declaring to throw java.lang.Exception is poor practice and that any justification is flawed.
Originally posted by Sudd Ghosh:
"I think it is generally accepted that declaring to throw java.lang.Exception is poor practice and that any justification is flawed."
I don't agree with this.
Tony Morris
Java Q&A (FAQ, Trivia)
Now I am super curious what sports would be like if we allowed drugs and tiny ads.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|