Java Reference
In-Depth Information
The source code is changed halfway through the loop to stop the bleeding. If Congress
should then spring [ 7 ] into action and award a massive government bailout, it can be
changed back. [ 8 ]
7 Ouch. Yes, a bad pun, but an irresistible one.
8 Or not.
The ability to change the implementation of a bean inside a running system is powerful,
but obviously risky. Spring only makes it available to beans from dynamic languages like
Groovy.
A real use case for refreshable beans
As much fun as the banking application illustrated in this section is, few companies will al-
low you to deploy source code into production and then edit it while the system is running.
So when would you actually use this capability?
Some problems only occur when a system is under load. Think of a refreshable bean as an
adaptable probe that can be inserted into a Spring-based system by a server-side developer
in a controlled fashion. You have the freedom to do more than just change a log level or
some other property (which you could in principle do with JMX, the Java Management Ex-
tensions). You can change what the probe is doing in real time and diagnose what's actually
going on.
 
 
Search WWH ::




Custom Search