JSF Managed bean facility @PostDestroy method emulation
as far as I know is that EJB 3.0 provide @PostDestroy annotation meaning when your bean is about to be destroyed the method with @PostDestroy annotation will be called.
What I am doing is this
public class SomeClass{
private EntityManager em;
public void doSomethingOnEM(...){...}
...
}
I set the em via the Managed Bean Facility what it does it calls my Utility class that returns a new instance of EntityManager. Now I do not know how to call the close() method on the em. In EJB 3 I would add
@PostDestroy
public void cleanUp(){
em.close();
}
but I am puzzled how would I do this in plain JSF managed beans. Any ideas? Thanks.

