以编程方式重新加载Java JAR,而无需重新启动ColdFusion [英] Programmatic reloading of Java JARs without restarting ColdFusion
问题描述
从ColdFusion 10开始,可以包括来自自定义位置的JAR 。
From ColdFusion 10 onward it is possible to include JARs from a custom location.
加载自定义Java库(或.java文件) )与以下类似的代码已添加到Application.cfc
To load custom Java libraries (or .java files) code similar to the following is added to Application.cfc
this.javaSettings = {LoadPaths = [".\java_lib\",".\java\myjar.jar"],
loadColdFusionClassPath = true, reloadOnChange = false}
或为获取更改(默认为60秒刷新时间),添加了以下内容
Or to pickup changes (with a default 60 second refresh time) the following is added
this.javaSettings = {LoadPaths = [".\java_lib\",".\java\myjar.jar"],
loadColdFusionClassPath = true, reloadOnChange = true}
问题
对于开发而言,第二种选择是好的(可能刷新时间要短得多) )。对于生产而言,第一个选择是理想的选择,但是每次需要更改任何Java代码时都必须重新启动服务器。
Question
For development the second option is good (probably with a much lower refresh time). For production the first option would be ideal, but restarting the server every time we need to change any java code is not acceptable. Is there any way to trigger a reload of java classes (preferably programmatic) without restarting the server when reloadOnChange = false
is set?
推荐答案
我建议改用它:
https://github.com/markmandel/JavaLoader
这篇关于以编程方式重新加载Java JAR,而无需重新启动ColdFusion的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!