|
From: Colin S. <col...@ex...> - 2003-11-12 15:05:42
|
In general, if I can think of a hole in Spring's current bean factory/context code, it's in the area of configuring and using bean factory/appContext trees. Juergen's code to create a bean factory/context from multiple xml files is very useful when you essentially want to have each layer in an application produce part of an overall appContext, but it breaks down if you need multiple web-apps up at the top, since in that scenario what you really need is a tree. Hence the ContextFactory interface and impl. I posted here some time in September. But I don't think that solution was terribly clean. I do think some code to address this need should be a base part of Spring... Rod Johnson wrote: >Mark, > >At the moment it's equivalent to each bean instance managing its own POJOs, >just as if you created them using the new operator. > >What I am considering is adding an additional parent bean factory that is a >singleton. This enables common objects to be shared. > >What might be even nicer would be 3 tiers: >1. shared across JVM >2. shared per EJB deployment >3. per EJB instance > >The only problem is that using a singleton at all in an EJB context is >somewhat fraught. E.g. it won't work across a cluster. > >Regards, >Rod > >----- Original Message ----- >From: "MacMahon, Mark" <M.M...@em...> >To: <spr...@li...> >Sent: Wednesday, November 12, 2003 11:51 AM >Subject: [Springframework-developer] AbstractEnterpriseBean+mutiple >beanfactory instances problem > > > > >>Hi All, >> >>I just have a quick question regarding the use of Spring from a >>Stateful/Stateless session bean. >> >>If Each implementation of Spring's AbstractEnterpriseBean loads its own >>BeanFactory, how can I guarantee that the beans loaded from the >> >> >BeanFactory > > >>are truly singleton? >> >>Shouldn't the XmlBeanFactoryLoader keep a static reference to the >>BeanFactory to ensure that it is loaded only once in a JVM and thus shared >>across all Session Bean instances in the instance pool? >>Am I missing something? >> >>Thanks in advance, >> >>Mark. >> >> >>____________________________________________________ >> >>emuse technologies >>U24 Trinity Enterprise Centre, Pearse Street, Dublin 2, Ireland. >>Tel: +353 (0)1 6717317 Fax: +353 (0)1 6717319 >>website: <http://www.emusetechnologies.com/> >>email: in...@em... <mailto:in...@em...> >>____________________________________________________ >> >>This message has been scanned for viruses using GroupShield for Exchange >>Server. >> >>CONFIDENTIALITY NOTICE - The information contained in this email message >> >> >is > > >>intended only for confidential use of the named recipient. If the reader >> >> >is > > >>not the intended recipient or the person responsible for delivering it to >>the recipient, you are hereby notified that you have received this >>communication in error and that any review, dissemination or copying of >> >> >this > > >>communication is strictly prohibited. If you have received this in error, >>please notify the sender immediately. >> >>The information, opinions and recommendations contained herein are and >> >> >must > > >>be construed solely as statements of opinion and not statements of fact. >> >> >No > > >>warranty, expressed or implied, as to the accuracy, timeliness, >>completeness, merchantability or fitness for any particular purpose of any >>such recommendation or information is given or made by emuse technologies >> >> >in > > >>any form or manner whatsoever. >> >> |