Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript 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
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Possible mistake in the "...Summary of EJB Certifications for EJB Certification" by Frits Walraven

 
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All and dear Frits,

Fist, I like to thanks you for the study notes, they are well done and concise.

Second, I think I locate something that my look like a mistake. In my document version on page 4-42 you have a note that states:


Note: you cannot have an Interceptor on a Timeout method



IMHO and according with the Oracle specification for Interceptors (available http://docs.oracle.com/javaee/6/tutorial/doc/gkedm.html ) you can have interceptors for timeout methods.


Interceptors for EJB timer service timeout methods may be defined using the @AroundTimeout annotation on methods in the target class or in an interceptor class. Only one @AroundTimeout method per class is allowed.



Is this a mistake in your study notes or do I misinterpret something ?


Thanks in advance & best Regards,
Mihai
 
Creator of Enthuware JWS+ V6
Posts: 3395
312
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mihai,

I am sorry that I couldn't reply earlier as I am on my summer holidays now, far from home

like to thanks you for the study notes, they are well done and concise.


Thanks!

IMHO and according with the Oracle specification for Interceptors (available http://docs.oracle.com/javaee/6/tutorial/doc/gkedm.html ) you can have interceptors for timeout methods.


Yes, that is correct. Chapter 4.2 (in my notes) is about interceptors on EJB timer timeout methods.

What I meant with the note you cannot have an Interceptor on a Timeout method, is that you cannot combine the @Interceptors and @Timeout annotations to define an Interceptor on a timer timeout method, you will have to use the @AroundTimeout annotation. In other words this won't work:


It should be:

Regards,
Frits
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry for the delayed answer, you know holidays.

Just to be sure that I understand your statement right.
You say that @Interceptors annotation can not be used the same method annotated with @Timeout.
This is correct, the reason can be the fist sentence from the Interceptors chapter from the specifications (chapter 12).


Interceptors are used to interpose on business method invocations and lifecycle events that occur on an enterprise bean instance.



As long as a timeout is not a business method then the upper stamen is correct.

Am I right ?


Thanks in advance,
Mihai
 
Frits Walraven
Creator of Enthuware JWS+ V6
Posts: 3395
312
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Interceptors are used to interpose on business method invocations and lifecycle events that occur on an enterprise bean instance.


Well actually this sentence in the ejb spec is not entirely correct. Apart from intercepting business methods and lifecycle methods you can also intercept timeout methods (by using the @AroundTimeout annotation).

Just browse through the Interceptors v1.1 Specification and you will see the three different EJB related interceptors.

Regards,
Frits
 
I RELEASE YOU! (for now .... ) Feel free to peruse this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic