In my blog at
I put forth the idea that the @PostConstruct and @PreDestroy
annotations, currently defined in EJB 3, be moved into the new Common
I have received word that this will be happening in the next couple of
Let's review the purpose of these annotations.
- Designates a method to receive a callback during creation of a
- session bean or message driven bean instance.
- Designates a method to receive a callback before a session bean or
- message driven instance is destroyed.
However, when they move over to JSR-250, they would be generalized to
say "container managed object".
Require JSF implementations running in a JSR-250 compliant container to
1. call any public no argument managed bean methods annotated with
@PostConstruct be called after the object is instantiated, and after
any injection is performed, but before the bean is placed into the
2. call any public no argument managed bean methods annotated with
@PreDestroy be called when the scope in which the bean has been
placed is ending.
My blog provided an implementation, currently checked into Sun's JSF
implementation codebase, but a production implementation would use TLD
listeners declared in the jsf_core taglib instead of the way I did it in
the blog. The point is that the user doesn't have to take any action
other than sticking the annotation on the method.