|
From: <jue...@we...> - 2003-07-11 14:36:15
|
Hi Ivan, Component lifecycles have already been discussed at some time, but the = current support is rather minimal as there hasn't been much need for = more sophisticated one yet. Currently, we offer 3 kinds of initialization callbacks: - "InitializingBean": just an "afterPropertiesSet()" callback after = populating the bean properties;=20 - "BeanFactoryAware": a "setBeanFactory(BeanFactory)" callback to supply = the containing factory to the bean instance; - "ApplicationContextAware": a = "setApplicationContext(ApplicationContext)" callback to supply the = containing context to the bean instance. The latter is only available within a Spring application context, = offering not just bean factory capabilities but also pluggable message = sources, resource retrieval (adapted per environment, e.g. file / = classpath / web context), etc. There's also a convenient = "ApplicationObjectSupport" base class that implements it, providing an = "initApplicationContext()" callback. InitializingBean is often used for simple initialization that depends on = multiple bean properties, without making the bean aware of anything = else. BeanFactoryAware is rarely necessary, as most bean references can = be supplied via respective bean properties anyway. = ApplicationContextAware provides the bean with full capabilities of a = Spring application context, e.g. for retrieving custom config files. Introducing a service lifecycle interface (with start/stop callbacks) = and reconfiguration capabilities should be straightforward. You are very = welcome to join us and work on this! Rod and me will be happy to provide = you with details on the current bean factory and application context = concepts :-) Regards, Juergen -----Original Message----- From: Ivan Ristic [mailto:iv...@we...] Sent: Friday, July 11, 2003 2:01 PM To: spr...@li... Subject: [Springframework-developer] JavaBeans lifecycle considerations? I read the container documentation at=20 http://www.springframework.org/docs/lightweight_container.html with great interest. I really like the "natural" JavaBeans approach. Are there any mechanisms in the container framework to handle component lifecycle? Such as start (possibly to run on its own thread), stop, dispose? There is one sentence in the document where you talk how Spring will support reconfiguration in the future. Are there any concrete plans for this or are other developers (such as myself 0:) invited to join and suggest ideas? I have some ideas and I would rather implement them as part of an existing framework than create yet-another-framework that no one except me will use. --=20 ModSecurity (http://www.modsecurity.org) [ Open source IDS for Web applications ] ------------------------------------------------------- This SF.Net email sponsored by: Parasoft Error proof Web apps, automate testing & more. Download & eval WebKing and get a free book. www.parasoft.com/bulletproofapps1 _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |