Programmatic reloading of Java JARs without restarting ColdFusion

霸气de小男生 提交于 2019-12-23 20:12:49

问题


Background

From ColdFusion 10 onward it is possible to include JARs from a custom location.

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}

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}

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?


回答1:


I would suggest using this instead:

https://github.com/markmandel/JavaLoader



来源:https://stackoverflow.com/questions/29600251/programmatic-reloading-of-java-jars-without-restarting-coldfusion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!