After Advice example

Let's see the use of @After annotation:

    //After transfer service 
    @After ("execution(* com.packt.patterninspring.chapter6.
bankapp.service.TransferService.transfer(..))") public void trackTransactionAttempt(){ System.out.println("bank has attempted a transaction"); }

Use @After annotation called regardless of whether an exception has been thrown by the target or not.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset