spring_reference/IX. ‘How-to’ guides/72.6. Reload Java classes w...

6 lines
619 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

### 72.6. 在不重启容器的情况下重新加载Java类
现代IDEsEclipse, IDEA等都支持字节码的热交换所以如果你做了一个没有影响类或方法签名的改变它会利索地重新加载并没有任何影响。
[Spring Loaded](https://github.com/spring-projects/spring-loaded)在这方面走的更远它能够重新加载方法签名改变的类定义。如果对它进行一些自定义配置可以强制ApplicationContext刷新自己但没有通用的机制来确保这对一个运行中的应用总是安全的所以它可能只是一个开发时间的技巧