扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
OSGI 规范包括了构建开放的可交付网络服务的各方面,OSGI规范又包括了以下子规范:
◆ Framework规范(OSGI核心,提供一个安全的可管理的Java Framework来部署可扩展的Java服务。)
◆ Package Admin Service规范(来管理不同的Bundle之间的引用关系。当Bundle更新或者反安装时判断是否有其他的服务正在使用当前的Bundle)
◆ Start Level规范(定义了启动和停止一个OSGi Service Platform时,不同的Bundles的启动或者停止的先后顺序)
◆ Permission Admin Service规范(Bundle是否许可执行另外的Bundle的代码)
◆ URL Handlers Service规范(怎样注册URL Schema,如何将java.io.InputStream对象转换为特定的Java对象)
◆Log Service规范
◆Configuration Admin Service规范
◆Device Access Specification
◆User Admin Service Specification
◆IO Connector Service Specification
◆Http Service Specification
◆Preference Service Specification
◆Wire Admin Service Specification
◆XML Parser Service Specification
◆Metatype Specification
◆Service Tracker Specification
◆Measurment and State Specification
◆Position Specification
◆Execution Environment Specfication
OSGI Framework
Framework是OSGI Service Platform规范的核心组成部分。它提供了一个通用的、安全可管理的Java framework。通过这个Framework可以支持一种叫做bundles的Service application的部署和扩展。
OSGI兼容设备可以下载并且安装OSGI bundles,也可一当他们不再需要的时候删除。bundles安装后会注册一定数量的Services,并被由同一个Framework下的其他bundles使用。
在一个动态扩展的的 OSGI环境中,Framework管理bundles的安装和更新。同时也管理bundles和Services之间的依赖关系。
Framework提供给bundle开发者必须的资源来在Java平台上开发,为开发的bundles提供了代码动态加载的功能, 也使得开发者开发、部署一个大规模的Services变的很容易。
其次,Framework为Java bundle开发者提供了简明一致的编程模型。简化了开发部署的复杂性。这个编程模型允许开发者将自己的接口规范绑定到OSGI环境中的Service。The selection of a specific implementation, optimized for a specific need or from a specific vendor, can thus be deferred to run-time.
一个一致的编程模型帮助开发者可以应付一些可估计的危急错误。Framework将会运行在不同的硬件环境上,但一致的接口确保软件组建可以运行在一致的服务接口上。
The Bundle Object
对于每一个安装在OSGI Service Platform的bundle都有一个与之关联的bundle object。一个bundle对象用来管理bundle的生命周期。这项工作通常由Management Agent来做。
Bundle State
bundle有以下状态;
INSTALLED – The bundle has been successfully installed. Native code clauses must have been validated.
RESOLVED – All Java classes that the bundle needs are available. This state indicates that the bundle is either ready to be started or has stopped.
STARTING – The bundle is being started, and the BundleActivato r. start method has been called and has not yet returned.
STOPPING – The bundle is being stopped, and the BundleActivato r. stop method has been called and has not yet returned.
ACTIVE – The bundle has successfully started and is running.
UNINSTALLED – The bundle has been uninstalled. It cannot move into another state.
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1579885
婵犵數濮烽。浠嬪焵椤掆偓閸熷潡鍩€椤掆偓缂嶅﹪骞冨Ο璇茬窞闁归偊鍓涢悾娲⒑闂堟单鍫ュ疾濠婂嫭鍙忔繝濠傜墛閸嬨劍銇勯弽銊с€掗柟钘夊暣閺岀喖鎮滈埡鍌涚彋閻庤娲樺畝绋跨暦閸洖鐓涢柛灞剧矋濞堟悂姊绘担绛嬪殐闁搞劋鍗冲畷銏ゅ冀椤愩儱小闂佹寧绋戠€氼參宕伴崱妯镐簻闁靛牆鎳庢慨顒€鈹戦埥鍡椾簼婵犮垺锚铻炴俊銈呮噺閸嬪倹绻涢崱妯诲碍閻庢艾顦甸弻宥堫檨闁告挾鍠庨锝夘敆娓氬﹦鐭楁繛鎾村焹閸嬫捇鏌e☉娆愬磳闁哄本绋戦埞鎴﹀川椤曞懏鈻婄紓鍌欑劍椤ㄥ懘鎯岄崒鐐靛祦閹兼番鍔岄悞鍨亜閹烘垵顏╅悗姘槹閵囧嫰寮介妸褎鍣ョ紓浣筋嚙濡繈寮婚悢纰辨晣鐟滃秹鎮橀懠顒傜<閺夊牄鍔庣粻鐐烘煛鐏炶姤鍠橀柡浣瑰姍瀹曠喖顢橀悩铏钒闂備浇宕垫慨鎶芥⒔瀹ュ鍨傞柦妯猴級閿濆绀嬫い鏍ㄧ☉濞堟粓姊虹涵鍛【妞ゎ偅娲熼崺鈧い鎺嗗亾闁挎洩濡囧Σ鎰板籍閸繄顓洪梺缁樺姇瀵剙螖閸涱喚鍘搁梺鍓插亽閸嬪嫰鎮橀敃鍌涚厱閻庯綆鍋嗘晶顒傜磼閸屾稑绗ч柟鐟板閹煎湱鎲撮崟闈涙櫏闂傚倷绀侀幖顐も偓姘卞厴瀹曞綊鏌嗗鍛紱閻庡箍鍎遍ˇ浼村磿瀹ュ鐓曢柡鍥ュ妼婢ь垰霉閻樿秮顏堟箒闂佹寧绻傚Λ妤呭煝閺囥垺鐓冪憸婊堝礈濮樿泛钃熼柕濞у嫷鍋ㄩ梺缁樺姇椤曨參鍩㈤弴銏″€甸柨婵嗗€瑰▍鍥ㄣ亜韫囨稐鎲鹃柡灞炬礋瀹曢亶顢橀悢濂変紦