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
Jetty支持完全热部署,但不内置热部署触发器。它允许动态增删上下文、Servlet及过滤器。具体实现取决于集成环境,如JBoss、Geronimo等。对于独立Jetty,可通过编写自定义代码来实现热部署。开发环境中,Jetty可在支持类重载的IDE中运行。
160

被折叠的 条评论
为什么被折叠?



