• 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

Get notified when an EJB 3.x is registered within EJB container.

 
Bartender
Posts: 1357
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

is there a standard way to get notified when an EJB 3.x is registered within an EJB container ? I looked at lifecycle methods but they're all related to creation, passivation and similar other events...
At the moment, the only workaround I found is to use a static initializer but I feel that's more a trick than a real good idea..



I even though to inject a resource that does the same work, or to scan JNDI registry for registered EJBs objects.

Thanks for your suggestion.
 
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
No there is no standard way in the EJB-specifications.

Are you looking for Java_Management_Extensions kind of notifications?
 
Claude Moore
Bartender
Posts: 1357
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Frits, thanks for your answer. No, actually I don't have in mind anything similar to JMX..I have a little number of EJB 3.x deployed in a WAR archive and I want to expose some of their methods as RESTfull web services.. I'd like to write an extension of Application class which is notified when an Ejb is installed and exposes their interfaces...



Where is populated when an EJB is deployed.

I was able to play with this approach with OSGi, using Activator... I was hoping that something similar were available even in a Java EE container, but unluckily... I was wrong.
 
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
Ok, I am not sure what you exactly want though.

If all EJB's are in the war, why can't you just expose them? (I know, for instance, that Jersey is bootstrapped when the Servlet container initializes. This will expose the services immediately)
 
Claude Moore
Bartender
Posts: 1357
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using websphere and as far as I know it doesn't register REST annotated classes automatically on bootstrap... But I will investigate further in that direction.
reply
    Bookmark Topic Watch Topic
  • New Topic