tomcat antiResourceLocking antiJARLocking 的作用和用法

(编辑:jimmy 日期: 2024/9/24 浏览:2)

我们先来看看这个 antiResourceLocking 到底是干什么的!
If true, Tomcat will prevent any file locking. This will significantly impact startup time of applications, but allows full webapp hot deploy and undeploy on platforms or configurations where file locking can occur. If not specified, the default value is false.
Please note that setting this to true has some side effects, including the disabling of JSP reloading in a running server: see Bugzilla 37668.
Please note that setting this flag to true in applications that are outside the appBase for the Host (the webapps directory by default) will cause the application to be deleted on Tomcat shutdown. You probably don't want to do this, so think twice before setting antiResourceLocking=true on a webapp that's outside the appBase for its Host.
我大致翻译一下:
如果这个参数为true,那么将组织任何文件锁。这将明显的影响应用的启动时间,但允许webapps,可能发生锁的平台和配置下,支持完整的热部署和热卸载。如果不配置,默认值是false;
如果设置为true,有一些副作用,包括屏蔽了JSP文件在运行服务器上的重新加载。
如果设置为true,且部署在Host的AppBase目录外面(默认是webapps),在Tomcat关闭的时候将导致应用被删除。
最主要的就翻译到这里了。实际上,如果为false,因为存在锁,在你重新发布的时候,可能出现部分代码无法更新。因为原始文件可能因为被锁住了,不能删除。
当然,如果为false,那么部署的目录就是和包名相同了。如果是false,则会每次都放到一个临时目录下面,一个temp目录。这也是这个配置引发的一个副作用。
另外的一个类似的配置 antiJARLocking 是防止jar类库被锁定而无法删除这个作用的。
一句话新闻
一文看懂荣耀MagicBook Pro 16
荣耀猎人回归!七大亮点看懂不只是轻薄本,更是游戏本的MagicBook Pro 16.
人们对于笔记本电脑有一个固有印象:要么轻薄但性能一般,要么性能强劲但笨重臃肿。然而,今年荣耀新推出的MagicBook Pro 16刷新了人们的认知——发布会上,荣耀宣布猎人游戏本正式回归,称其继承了荣耀 HUNTER 基因,并自信地为其打出“轻薄本,更是游戏本”的口号。
众所周知,寻求轻薄本的用户普遍更看重便携性、外观造型、静谧性和打字办公等用机体验,而寻求游戏本的用户则普遍更看重硬件配置、性能释放等硬核指标。把两个看似难以相干的产品融合到一起,我们不禁对它产生了强烈的好奇:作为代表荣耀猎人游戏本的跨界新物种,它究竟做了哪些平衡以兼顾不同人群的各类需求呢?