|
From: Colin S. <col...@ex...> - 2004-01-27 14:10:39
|
(resent, the initial email from last night seems to have gone into a black hole; probably it will show up in a day or two). I've checked in a new interface called BeanFactoryLocator. It replaces the existing BeanFactoryLoader interface, with the old concrete implementations XmlBeanFactoryLoader and XmlBeanFactoryApplicationContextLoader now implementing BeanFactoryLocator, and renamed to SimpleJndiBeanFactoryLocator and JndiBeanFactoryLocator, respectively. The latter is the default used by the EJB support classes. As well, there are two new classes implementing BeanFactoryLocator, called SingletonBeanFactoryLocator and DefaultBeanFactoryLocator. These implement a 'keyed-singleton' bean factory access mechanism. The latter class simply uses an ApplicationContext internally instead of the former's BeanFactory. Essentialy, the classes use a BeanFactory or ApplicationContext definition (which becomes a singleton, keyed by the name of the definition file(s)) to load one or more BeanFactories or ApplicationContexts, and return them to the caller. I am by no means a big fan of using singleton's, but they have some uses in glue code some times. As such, I have heavily plastered the JavaDocs with warnings not to use these classes in most circumstances. Given that we are so close to RC1, if somebody doesn't like any of the class names, method names, packages, implementation, etc., please speak up. Also, these changes break compatibility with any old code overriding the default BeanFactoryLoader in the ejb support classes. I thought it was worth it to do this in order to consolidate two fairly similar interfaces. Changing to use the new code should be fairly trivial for anybody affected. Regards, Colin |