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(structnew(),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
****************************************************
This email is sent for and on behalf of Halliwells LLP.
Halliwells LLP is a limited liability partnership registered in England and
Wales under registered number OC307980 whose registered office address is at St
James's Court Brown Street Manchester M2 2JF. A list of members is available
for inspection at the registered office. Any reference to a partner in relation
to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law
Society.
CONFIDENTIALITY
This email is intended only for the use of the addressee named above and may be
confidential or legally privileged. If you are not the addressee you must not
read it and must not use any information contained in nor copy it nor inform
any person other than Halliwells LLP or the addressee of its existence or
contents. If you have received this email in error please delete it and notify
Halliwells LLP IT Department on 0870 365 8008.
For more information about Halliwells LLP visit www.halliwells.com.