I am using ssb to keep state between different invocation.
When the client use the ssb properly, the bean reach to its final state, and the client explicitly remove the ssb. the bean has some cleaning procedure on its ejbRemove().
on some errors the client never returns to the ssb, and the bean is passivated and finally removed implicitly by the container itself.
I need to do some cleaning work, before I actually remove the bean.
can I listen to the removal action of the container?
is there a JBoss specific solution? or maybe more generic approach?
Remove should be invoked on your bean.
However, there are circumstances where this might not
happen, read the spec.