Here's an example:
<bean id="mycomposedsingleton">
<property name="simplesingleton"><ref bean="mysimplesingleton" /></property>
</bean>
<bean id="mysimplesingleton">
</bean>
Now when you reload 'mysimplesingleton', the instance within in
'mycomposedsingleton' will NOT be updated, so it will a) continue to
use the old code, and b) have different instance state than the new
instace of 'mysimplesingleton'.
If you really want the ability to reload singletons, you need to at
the very least reload the graph of related beans (not just the
singleton). That's only going to help you with ColdSpring-managed
dependencies though. So really, you need to reinitialize the whole
application to ensure consistency.
Now if you want to get creative, and you're not using AOP, you can
approach this another way. Get the instance of the bean from the
beanFactory, instantiate (with createObject) your new replacement
bean, and then copy all the methods from the latter to the former. As
I said, this will NOT work with AOP (unless you have't change any
method signatures), and it also won't let you make changes to the
stuff in the variables scope (so you have to be really careful about
backwards compatibility in that sense. But it'll work.
cheers,
barneyb
> --
> You received this message because you are subscribed to the Google Groups "ColdSpring-Users" group.
> To post to this group, send email to coldspri...@googlegroups.com.
> To unsubscribe from this group, send email to coldspring-use...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/coldspring-users?hl=en.
>
>
--
Barney Boisvert
bboi...@gmail.com
http://www.barneyb.com/