• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question on Message-Driven Bean Lifecycle Callback Interceptor Methods

 
Ranch Hand
Posts: 634
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

EJB 3.1 Specification



5.4.5 Message-Driven Bean Lifecycle Callback Interceptor Methods

The following lifecycle event callbacks are supported for message-driven beans. Callback methods may be defined directly on the bean class or on a separate interceptor class

1. PostConstruct
2. PreDestroy



Question :What does line "Callback methods may be defined directly on the bean class or on a separate interceptor class" means here ?
 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can have an interceptor binding on top of the PostConstruct method, or in the Interceptor class itself

Method signature:
  • In Target class: void <METHOD>()
  • In Interceptor class void <METHOD>(InvocationContext)


  • in Target class

    in Interceptor class

    Regards,
    Frits
     
    Mohit G Gupta
    Ranch Hand
    Posts: 634
    Eclipse IDE Chrome Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi Frits,

    Thanks for the reply.
    However,I am still not understanding your statement as my query was regarding "callback methods (PostConstruct,PreDestroy) defined on Bean class or Interceptor class" and your answers says about" Interceptor Bindings on PostConstruct method, or in the Interceptor class itself"

    Please advise.
     
    Frits Walraven
    Creator of Enthuware JWS+ V6
    Posts: 3411
    320
    Android Eclipse IDE Chrome
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Oh yes, you are right they are talking about the lifecycle methods. Well here are the examples:

    in the Session bean class:

    or in the interceptor class (PostConstruct is not called from the EchoBeanRemote class but from its Interceptor)

    Regards,
    Frits
     
    Mohit G Gupta
    Ranch Hand
    Posts: 634
    Eclipse IDE Chrome Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks Frits
    reply
      Bookmark Topic Watch Topic
    • New Topic