Forums Register Login

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

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
No there is no standard way in the EJB-specifications.

Are you looking for Java_Management_Extensions kind of notifications?
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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)
+Pie Number of slices to send: Send
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.
Without subsidies, chem-ag food costs four times more than organic. Or this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 736 times.
Similar Threads
@EJB
DI with @Resource adnotation understanding
Usage of EntityManagerFactory
Question regarding a session bean's life cycle ...
EJBCore_Spec errata?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 08:18:32.