Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.2.0-SNAPSHOT, 1.2.1-SNAPSHOT
-
None
Description
I'm opening this jira as a convenient place to put code samples in support of discussion on the dev list
Based on my experience implementing dependency injection and lifecyle methods in the geronimo app client container and the geronimo-jetty integration, and inspired by the openejb3 code for this purpose, I'd like to propose that MyFaces consider using an interface similar to this for object creation and shutdown:
public interface LifecycleProvider {
/**
- Create an object of the class with the supplied name, inject dependencies as appropriate,
- and call a postContruct method as appropriate.
* - @param className name of the class of the desired object
- @return a fully constructed, dependency-injected, and initialized object.
*/
Object newInstance(String className);
/**
- Take whatever steps are needed to shut down the object, including calling a preDestroy method.
* - @param o object to shut down.
*/
void destroyInstance(Object o);
}
It's easy to write an adapter between this and the AnnotationProcessor interface currently implemented.
Attachments
Attachments
Issue Links
- is related to
-
MYFACES-1246 JSR-252 Issue #119: implementations running in a JSR-250 container have their managed bean methods annotated with @PostConstruct be called after the object is instantiated, and after injection is performed, but before the bean is placed into scope.
- Closed