• 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
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Multiple @AroundInvokes

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Ranchers,
I've just been testing some error cases for EJB trying out the different rules to see how it breaks, when and if it breaks. Today I tested the condition in 12.3 of the core spec to do with the number of @AroundInvoke methods in an interceptor. The spec says:

AroundInvoke methods may be defined on superclasses of the bean class or interceptor classes.
However, only one AroundInvoke method may be present on a given class.



I decided to see what happens if I define two around invoke methods in an interceptor class to see if I get an Exception, or whether the bean just doesn't deploy at all. What I found is that no errors occur, and at least one @AroundInvoke method in that interceptor is called, but the one that runs seems to be indeterminate.

Im using Glassfish 2.1 container and the interceptor class is given below (im declaring this interceptor to be called from a stateless bean not shown below):



Has anyone tried anything similar in a different container perhaps? The spec isn't clear on what happens if you define two, it just says you shouldn't do it.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This thread may help.
 
You save more money with a clothesline than dozens of light bulb purchases. Tiny ad:
ScroogeXHTML - a fast and small RTF to HTML5 and XHTML converter library
https://coderanch.com/t/742149/ScroogeXHTML-RTF-HTML-XHTML-converter
reply
    Bookmark Topic Watch Topic
  • New Topic