You're going to just kill it and leave it dead? Hardly thread-safe, is it?
Jaime Metcher -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] Behalf Of Barney Boisvert Sent: Saturday, 3 March 2007 2:44 AM To: [email protected] Subject: [coldspring-dev] Refreshing beans Easier would be to just have your reinit file do this: <cfset structDelete(application, "beanFactory", false) /> then the next time you run your app that block you posted will fire, detect that it needs to create the factory, and do it. No duplication of that creation code. cheers, barneyb On 3/2/07, Tom Chiverton <[EMAIL PROTECTED]> wrote: > On Thursday 01 Mar 2007, Barney Boisvert wrote: > > You can't cycle a single bean, because any other beans that it might > > have been injected into will suddenly have stale references with no > > good way to update them. But if you just create a new BeanFactory, > > it'll start from scratch and recreate all your beans, rewiring them > > *Ahh*. > What we'll probably have to do is go down the 'reinit' route, and have some > special file we can run that rebuilds the factory, even though it exists. > > I wrote all this gubbins a while OK, so pardon me while I think out loud. > > Our services all extend something that ultimately does: > <cflock name="beanFactoryCreateObjectLock" type="readonly" > throwontimeout="true" timeout="30"> > <cfif not IsDefined('application.beanFactory')> > <cflock scope="Application" type="exclusive" throwontimeout="true" > timeout="30"> > <cfset application.beanFactory = > createObject("component","coldspring.beans.DefaultXmlBeanFactory").init(stru ctnew(),defaultProperties)/> > <cfset > application.beanFactory.loadBeansFromXmlFile(expandPath('/beans.xml'),true)/ > > </cflock> > </cfif> > </cflock> > > All our reinit file would need to do is the same thing, but without the cfif ? > -- > Tom Chiverton > Helping to revolutionarily build principle-centered action-items > On: http://thefalken.livejournal.com > -- Barney Boisvert [EMAIL PROTECTED] http://www.barneyb.com/ Got Gmail? I have 100 invites.
