启动osgi框架
java -jar org.eclipse.osgi_3.5.0.v20090520.jar - console
安装bundle
install bundurl
eg:
install reference:file:javax.xml_1.3.4.v200902170245.jar
Bundl生命周期(状态)
bundle的状态分为六种
installed:bundle已经成功的安装了,本地资源成功加载。
resolved:bundle中所需要的类都已经可用了,依赖关系满足,resolved状态表明
bundle已经准备好了用于启动或者说bundle已经被停止了。
starting:bundle正在启动中,BundleActivator的start方法已经被调用,不过还没有返回
active:bundle已经启动,并在运行中。
stopping:bundle正在停止中,BundleActivator的stop方法已经被调用,不过还没有返回。
UNINSTALLED:bundle已经被卸载了。bundle被卸载并且无法进入其他状态。
Bundle接口定义了getState()方法来返回Bundle的状态
osgi常用控制台命令:
ss
start id
stop id
install
uninstall