Re: [jsr-314-open] [2.0RevA-C071] none scoped beansand@PostConstruct
I thought a bit more about this, and while I still think @PostConstruct
should be called for none scoped bean, I think we should document
@PreDestroy better as we won't have many way to call the annotated method
for none scoped bean. Of course, the managed bean engine could be made very
intelligent and know in what context the none scoped bean is getting used.
If injected into another bean, it could add the none scoped bean in an
hidden map in the same scope to detect destruction, but if the none scoped
bean is used directly, which is rare but possible, then I cannot think of
any way to enforce @PreDestroy.
Show replies by date