此内容没有您所选择的语言版本。

Chapter 7. Deploying an OSGi Bundle


Abstract

Apache Karaf provides two different approaches for deploying a single OSGi bundle: hot deployment or manual deployment. If you need to deploy a collection of related bundles, on the other hand, it is recommended that you deploy them together as a feature, rather than singly (see Chapter 8, Deploying Features).

7.1. Hot Deployment

Hot deploy directory

JBoss Fuse monitors JAR files in the InstallDir/deploy directory and hot deploys everything in this directory. Each time a JAR file is copied to this directory, it is installed in the runtime and also started. You can subsequently update or delete the JARs, and the changes are handled automatically.
For example, if you have just built the bundle, ProjectDir/target/foo-1.0-SNAPSHOT.jar, you can deploy this bundle by copying it to the InstallDir/deploy directory as follows (assuming you are working on a UNIX platform):
% cp ProjectDir/target/foo-1.0-SNAPSHOT.jar InstallDir/deploy

Hot undeploying a bundle

To undeploy a bundle from the hot deploy directory, simply delete the bundle file from the InstallDir/deploy directory while the Apache Karaf container is running.
Important
The hot undeploy mechanism does not work while the container is shut down. If you shut down the Karaf container, delete the bundle file from deploy/, and then restart the Karaf container, the bundle will not be undeployed after you restart the container (you can, however, undeploy the bundle manually using the osgi:uninstall console command).
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.