is it possible to get notified inside the bean (mdb in this case) that its deployment procedure has just finished?
Asked
Active
Viewed 230 times
2
-
May I ask you one thing: what do you want to do? – Pascal Thivent Oct 06 '09 at 19:48
-
sure. i'm trying to write a MDB being activated by quartz. looks easy, but I need to fetch its activation config from "master" node via JMS message. basically, what I wanted to do was to ask "master" for configuration each time MDB deploys on given "slave" node. – Michal Oct 06 '09 at 20:59
2 Answers
1
I'm pretty sure once the constructor is complete it's considered to be "deployed."
Okay, to address the downvote, from the Jave EE API documentation, you have two lifecycle methods available to you:
void ejbRemove()
A container invokes this method before it ends the life of the message-driven object.
void setMessageDrivenContext(MessageDrivenContext ctx)
Set the associated message-driven context.
Unfortunately, that's it.

Chris K
- 11,996
- 7
- 37
- 65
1
I would say that when setMessageDrivenContext
is called, that's your bean deployed - you know that the container has a context and has assigned it to your MDB.
The problem with your design is that MDBs are passive components, they're not supposed to do anything until a message gets delivered to them.

skaffman
- 398,947
- 96
- 818
- 769