The spec says that CDI container removes a SFSB when the scope's context is about to be destroyed. How does it exactly remove the EJB? It does not seem to be calling the method annotated with @Remove.
@Stateful
public class CustomerDAOImpl implements CustomerDAO {
@PreDestroy
public void onDestroy() {
//This is getting called as expected
}
@Remove
public void deleteMyBean() {
//This is not getting called!
}
}
So, CDI is technically doing what the spec says. The question is how is it managing to ask the EJB container to remove the instance? Thanks.