Can Jetty Hot Deploy?

Jetty is fully hot deployable, but does not have any native hot deployers. What this means is that Jetty contexts, servlets and filters may be added, stopped, started and reloaded dynamically, but that Jetty does not have any services that trigger these events.

The reason that Jetty does not have any native hot deployers is that the requirements for hot deployment vary greatly depending on the environment and developers. For example, which files and/or directories should be watched to trigger a hot deployment? The WAR, the unpacked WAR directory, the web.xml, the class files for the servlets or every class file loaded by the context?

Once the need for a hot deployment is detected, it is unclear what should be redeployed? Should just the servlets be reloaded? Should the context be stopped, totally reloaded and then restarted? Should the listeners be stopped so that load balancers don't send request while redeployment is happening?

There are answers to these questions, but they are very environment specific. Thus when Jetty is embedded in JBoss, it supports JBoss style hot deployment. Ditto for Geronimo and avalon. If you want hot deployment for a stand-alone Jetty, it is not difficult to write code to detect your own hotdeployment criteria and then to stop/start the jetty components that you know are affected.

For development mode, you can run Jetty as a normal application in any IDE that supports class reloading. Also there now is a i Jetty 6 plugin for maven2 users that will run a webapplication and automatically hot redploy if anything changes.

See also Reload Servlet..html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值