posted 20 years ago
Thanks, Keith, for your effort and time.
But I'm not talking about invoke ejbRemove through client, which will never happen in Message Bean, since it doesn't have any client, just like you said.
What I'm asking is what will happy if I code like this:
public void onMessage(javax.jms.Message.){
.
other business related code;
.
.
ejbRemove();
}
After I chatted with my colleague with this question, I think this is the answer:
On Spec Page 315:
"The ejbRemove notification signals that the instance is in the process of being removed by the container.In the ejbRemove method, the instance releases the resources that it is holding."
So Bean Provider implements ejbRemove() just for doing clean-up works, the actually removing the Message Bean instance is done by the Container outside of ejbRemove method. So calling ejbRemove in the onMessage will result in doing the clean-up work in the onMessage method, that's it, nothing else will happen.
SCEA, SCJD, SCWCD, SCBCD, SCJP<br />IBM WebSphere Portal certification