简体   繁体   English

如何在基于OSGI的Web应用程序中启动/停止捆绑软件

[英]How to start/stop bundles in OSGI based web application

Usually we start/stop bundles via OSGI console, but for web application, how to do that once it's deployed in a container ? 通常,我们通过OSGI控制台启动/停止捆绑包,但是对于Web应用程序,将其部署在容器中后该如何做?

Regards, 问候,

Setya Setya

Also not sure if I got you right, but anyway: 同样不确定我是否正确,但是无论如何:

I think it depends on how you deploy a OSGi web application. 我认为这取决于您如何部署OSGi Web应用程序。 The only way I already did was that I ran Tomcat within the OSGi context. 我已经做过的唯一方法是在OSGi上下文中运行Tomcat。 Then Tomcat scans for bundles with a ".war" ending, so its basically started as soon as it's deployed and you can control it normally via the OSGi console 然后Tomcat扫描以“ .war”结尾的捆绑软件,因此它基本上在部署后便立即启动,您可以通过OSGi控制台正常控制它

not sure If I got you right, but... 不确定我是否正确,但是...

Mostly applications are started just after deployment(war or eclipse)... you don't need to do anything. 通常,应用程序是在部署(战争或日食)后立即启动的……您无需执行任何操作。

but in case you want to you can do exactly the same thing you do to bundles... go to the web console of your chosen AS and start it there. 但是如果您愿意,可以做与捆绑完全相同的操作...转到所选AS的Web控制台并在此处启动它。

Depends what you're using - please update question with container/framework details. 取决于您使用的是什么-请使用容器/框架详细信息更新问题。

Otherwise, using Karaf you may simply SSH into the framework's shell and execute commands as normal. 否则,使用Karaf,您可以简单地通过SSH进入框架的外壳并按正常方式执行命令。

Another alternative would be to use WebConsole from Apache Felix - this gives you a lot of control wrt bundles (you can even upload to deploy), and also gives you an embedded shell. 另一个选择是使用来自Apache Felix的WebConsole-这为您提供了许多控制权捆绑包(您甚至可以上载以进行部署),还可以提供嵌入式外壳。 It's quite extensible , you can write plugins to create new tabs etc. (AFAIK this will run fine in any framework). 它的扩展性很强,您可以编写插件来创建新标签页等(AFAIK在任何框架中均可正常运行)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM