Testing OSGi components

本文介绍了OSGi联盟及其服务平台的基本概念。OSGi是一种模块化框架,允许开发者将应用程序分解为可远程管理和更新的小型组件(称为bundles)。文章还详细解释了bundles的生命周期状态,包括安装、解析、启动、活动、停止及卸载。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The term OSGi usually refers to two things - 

1. the OSGi alliance

2. the OSGi service platform


The first one- the OSGi alliance is an organization of companies started in late March 1999. The initial companies involved in the alliance included Sun Microsystems, Ericsson, IBM and others. The idea was to create a standards organization for defining specifications for a Java-based service platform, which can be remotely managed. This platform would consist of multiple modules ( in the OSGi terms are called bundles) which can be installed, started, stopped, updated and uninstalled remotely and dynamically. The dynamically denotes those operations can be achieved without a reboot, at runtime.


The specifications, this alliance deals with is the OSGi service platform to define a component and service model. All of the implementations of the OSGi framework need to provide environment for the applications to run in. The applications are modulated into smaller components called bundle. A bundle is the smallest unit of modularization in OSGi - a collection of classes, resources and configuration files, in which the bundle declares its dependencies. The key mission of a bundle is to declare and use services. The OSGi service platform provides a context where all the running services are registered. This bundle context gets injected into every bundle during its startup.


lifecycle of a given OSGi service contain:

installed: the bundle has been installed to the OSGi container

resolved: all the package requirements are fulfilled and the bundle is ready to be started

starting: the bundle has been started and is still in the process of starting

active: the bundle has started

stopping: the bundle has been initiated to stop and is still in this process. After this the bundle will be in the state resolved

uninstalled: the bundle has been removed from the OSGi container


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值