??
An introduction to OSGi:
http://www.developerfusion.com/article/84923/an-introduction-to-osgi/
OSGi Modularity - Tutorial:
http://www.vogella.com/tutorials/OSGi/article.html
Apache Felix Framework Usage Documentation:
http://felix.apache.org/documentation/subprojects/apache-felix-framework/apache-felix-framework-usage-documentation.html
A bundle is the OSGi term for a component for the OSGi framework
OSGi and Class Loader:
https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.0/html/Managing_OSGi_Dependencies/files/BCL-ClassLoader.html
Remote services(aka, Dosgi - distributed osgi):
http://blog.akquinet.de/2009/09/14/dynamokos-dealing-with-dynamism-in-osgi-distributed-web-applications/
eclipse 下 osgi 項目的創建與 deploy:
https://blogs.oracle.com/arungupta/entry/totd_126_creating_an_osgi
Introduction to the Apache Felix DependencyManager – part two
http://arnhem.luminis.eu/introduction-apache-felix-dependencymanager-part-2/
常見 OSGI MANIFEST.MF configs:
OSGi Specification, 6.0:
http://www.osgi.org/download/r6/osgi.core-6.0.0.pdf
The difference between a jar and a bundle:
http://konigsberg.blogspot.com/2009/04/difference-between-jar-and-bundle.html
Discovering the future of Java
http://javadepend.wordpress.com/2012/10/31/discovering-the-future-of-java/
SpringSource to move dmServer to Eclipse – OSGi not ready for mainstream?
http://www.theserverside.com/discussions/thread.tss?thread_id=59183
An introduction to OSGi:
http://www.developerfusion.com/article/84923/an-introduction-to-osgi/
OSGi Modularity - Tutorial:
http://www.vogella.com/tutorials/OSGi/article.html
引用
使用 eclipse 的 export -> "deployable plugins and fragments" 導出 bundle jar 到 Felix 目錄下,該 jar 會被放到一個叫 plugins 的目錄下,而不是默認的 bundle 目錄下。這兩個目錄,或者說在 osgi 環境下 bundle 與 plugin 有區別嗎?答案是沒有區別,只是 felix 將一個 osgi 服務叫做 bundle,而 eclipse 通常稱其為 plugin 而已:
bundle = Deployable service = plugin,一般就是個jar包。
All these restrictions are enforced via a specific OSGi classloader. Each bundle has its own classloader . Access to restricted classes is not possible.
引用
1.2. Bundle vs. plug-in
In Eclipse the smallest unit of modularization is a plug-in. The terms plug-in and bundle are (almost) interchangeable. An Eclipse plug-in is also an OSGi bundle and vice versa.
所以在 osgi 的語境下我們認為:
In Eclipse the smallest unit of modularization is a plug-in. The terms plug-in and bundle are (almost) interchangeable. An Eclipse plug-in is also an OSGi bundle and vice versa.
bundle = Deployable service = plugin,一般就是個jar包。
All these restrictions are enforced via a specific OSGi classloader. Each bundle has its own classloader . Access to restricted classes is not possible.
Apache Felix Framework Usage Documentation:
http://felix.apache.org/documentation/subprojects/apache-felix-framework/apache-felix-framework-usage-documentation.html
引用
A bundle is the OSGi term for a component for the OSGi framework
OSGi and Class Loader:
https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.0/html/Managing_OSGi_Dependencies/files/BCL-ClassLoader.html
引用
In the context of OSGi, where a typical application depends on multiple class loaders (one for each bundle), it is important to understand that the fully-qualified class name—for example, org.foo.Hello—is not sufficient to identify a loaded class uniquely. In general, a loaded class is uniquely identified by combining the classloader identity with the fully-qualified class name.
Remote services(aka, Dosgi - distributed osgi):
http://blog.akquinet.de/2009/09/14/dynamokos-dealing-with-dynamism-in-osgi-distributed-web-applications/
eclipse 下 osgi 項目的創建與 deploy:
https://blogs.oracle.com/arungupta/entry/totd_126_creating_an_osgi
Introduction to the Apache Felix DependencyManager – part two
http://arnhem.luminis.eu/introduction-apache-felix-dependencymanager-part-2/
常見 OSGI MANIFEST.MF configs:
引用
Import-Package:the packages that it needs to run
Export-Package:the packages that it may export for other bundles to use
Bundle-RequiredExecutionEnvironment:the execution environment that it requires
Export-Package:the packages that it may export for other bundles to use
Bundle-RequiredExecutionEnvironment:the execution environment that it requires
引用
Chapter 5. Bundles and Application Contexts
The unit of deployment (and modularity) in OSGi is the bundle (see section 3.2 of the OSGi Service Platform Core Specification). A bundle known to the OSGi runtime is in one of three steady states: installed, resolved, or active. Bundles may export services (objects) to the OSGi service registry, and by so doing make these services available for other bundles to discover and to use. Bundles may also export Java packages, enabling other bundles to import the exported types.
In Spring the primary unit of modularity is an application context, which contains some number of beans (objects managed by the Spring application context). Application contexts can be configured in a hierarchy such that a child application context can see beans defined in a parent, but not vice-versa. The Spring concepts of exporters and factory beans are used to export references to beans to clients outside of the application context, and to inject references to services that are defined outside of the application context .
There is a natural affinity between an OSGi bundle and a Spring application context. Using Spring Dynamic Modules, an active bundle may contain a Spring application context, responsible for the instantiation, configuration, assembly, and decoration of the objects (beans) within the bundle. Some of these beans may optionally be exported as OSGi services and thus made available to other bundles, beans within the bundle may also be transparently injected with references to OSGi services.
After a refreshPackages operation, packages exported by older versions of updated bundles, or packages exported by uninstalled bundles, are no longer available.
When a Spring-powered bundle is stopped, the application context created for it is automatically destroyed.
If a Spring-powered bundle that has been stopped is subsequently re-started, a new application context will be created for it.
The Spring extender recognizes a bundle as "Spring-powered" and will create an associated application context when the bundle is started and one or both of the following conditions is true:
The bundle path contains a folder META-INF/spring with one or more files in that folder with a '.xml' extension.
META-INF/MANIFEST.MF contains a manifest header Spring-Context.
The unit of deployment (and modularity) in OSGi is the bundle (see section 3.2 of the OSGi Service Platform Core Specification). A bundle known to the OSGi runtime is in one of three steady states: installed, resolved, or active. Bundles may export services (objects) to the OSGi service registry, and by so doing make these services available for other bundles to discover and to use. Bundles may also export Java packages, enabling other bundles to import the exported types.
In Spring the primary unit of modularity is an application context, which contains some number of beans (objects managed by the Spring application context). Application contexts can be configured in a hierarchy such that a child application context can see beans defined in a parent, but not vice-versa. The Spring concepts of exporters and factory beans are used to export references to beans to clients outside of the application context, and to inject references to services that are defined outside of the application context .
There is a natural affinity between an OSGi bundle and a Spring application context. Using Spring Dynamic Modules, an active bundle may contain a Spring application context, responsible for the instantiation, configuration, assembly, and decoration of the objects (beans) within the bundle. Some of these beans may optionally be exported as OSGi services and thus made available to other bundles, beans within the bundle may also be transparently injected with references to OSGi services.
After a refreshPackages operation, packages exported by older versions of updated bundles, or packages exported by uninstalled bundles, are no longer available.
When a Spring-powered bundle is stopped, the application context created for it is automatically destroyed.
If a Spring-powered bundle that has been stopped is subsequently re-started, a new application context will be created for it.
The Spring extender recognizes a bundle as "Spring-powered" and will create an associated application context when the bundle is started and one or both of the following conditions is true:
The bundle path contains a folder META-INF/spring with one or more files in that folder with a '.xml' extension.
META-INF/MANIFEST.MF contains a manifest header Spring-Context.
OSGi Specification, 6.0:
http://www.osgi.org/download/r6/osgi.core-6.0.0.pdf
The difference between a jar and a bundle:
http://konigsberg.blogspot.com/2009/04/difference-between-jar-and-bundle.html
Discovering the future of Java
http://javadepend.wordpress.com/2012/10/31/discovering-the-future-of-java/
SpringSource to move dmServer to Eclipse – OSGi not ready for mainstream?
http://www.theserverside.com/discussions/thread.tss?thread_id=59183
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
