Announcement Announcement Module
Collapse
No announcement yet.
Is this enforced? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is this enforced?

    Does Spring enforce this(in bold)? Copied below is an excerpt from the javadoc.

    org.springframework.aop
    Interface AfterReturningAdvice
    All Superinterfaces:
    Advice

    --------------------------------------------------------------------------------

    public interface AfterReturningAdvice
    extends Advice
    After returning advice is invoked only on normal method return, not if an exception is thrown. Such advice can see the return value, but cannot change it.



    Author:
    Rod Johnson

  • #2
    Does Spring enforce this(in bold)?
    Well it's a true statement. It's not so much a matter of enforcing it, but rather a limitation of this type of advice.

    Comment


    • #3
      limitation ! why? Plz explain.

      katentim,

      I mean, you would write the advice, you can change what you get as the return object; you aren't limited in doing that.

      Is it a strong suggestion, that one should'nt change it? I think, I am getting it wrong.

      Comment


      • #4
        you can change what you get as the return object; you aren't limited in doing that
        You can modify the object pointed to by returnValue, but not the returnValue itself. This is different to around advice where you could actually instantiate a new object and return that.

        Comment

        Working...
        X