Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Interceptor - Excecution Order

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As per the specs the Invocation order is Default > Class > Method

What should be order if the super class has @AroundInvoke method, and when the subclass method is called ?



Which is correct when "amethod" is invoked and Why ?

Option 1 > test1 > test2

Option 2 > test2 > test1
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Shonak,

the correct answer is Option2 > test2 test1

when you inherit a class which has @AroundInvoke, it is intercepted first and then the subclass continues.
Option 1 is not a valid answer.

If you have not understood, click on this link :
http://docs.jboss.org/ejb3/app-server/tutorial/interceptor/interceptor.html
and see Inheritance Ordering.

Keep Programming.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic