Description
ejb3.1 spec 4.3.5
If the session bean implements the SessionBean interface, the PreDestroy annotation can only be
applied to the ejbRemove method; the PostActivate annotation can only be applied to the
ejbActivate method; the PrePassivate annotation can only be applied to the ejbPassivate
method. Similar requirements apply to use of deployment descriptor metadata as an alternative to the
use of annotations.
But for following cases, there are two PreDestroy methods. Both of them should be valid.
class A {
@PreDestroy
public void xxxxx()
class B extends A implements SessionBean {
@PreDestroy
public void ejbRemove(){
}
}