OSGi-Based Framework Development Summary (RPM)

Source: Internet
Author: User
Tags root directory
Study OSGi also for some time, the total feeling of online related information is too little (reference value, because most are copies of the same article), so far to OSGi is a certain understanding, I took this time to find the information and personal experience summed up and share, for the open source to do a little humble power .

1.Classic Framework: design-time dependent

OSGi Framework: run-time dependent

2.OSGi handles the principle of single responsibility, service-oriented component model design, force-oriented interface programming, support hot-swappable .

OSGi provides a powerful, tightly-regulated class-loading model that provides each module with its own classloader providing a dynamic collaboration Model (service registration), module isolation, version loading, and attribute filtering. Even if the bundle has been stop, its export packages is still available.

Bundle ClassLoader: Business class loading within the control module

System ClassLoader: Controlling the life cycle of bundles

SOCM: Service-oriented component model

3.Two design directions for the OSGi framework:

(1). Embed the Web container in an OSGI environment;

(2). Publish OSGi as a war in a separate Web container.

4.Bundle life cycle (LifeCycle):

Install, start, update, stop, uninstall. (actually a bundle is a jar with a meta-file)

5.two ways to listen for OSGi:

(1). Bundelcontext: Self-active monitoring of the change of events;

(2). DS (declarative Service): Active invocation when the service is dynamically changing.

The resource does not actively invoke the container to implement its own lifecycle management, which is what we want, so DS is preferable.

6.Bundle Generation Tool:

Bnd.jar can generate bundles that conform to R4 based on the virtual path of the traditional project, below is bluydavy about the tool:

Http://www.blogjava.net/BlueDavy/archive/2007/07/27/132809.html

7.Web interface for bundles: TPF (scaffolding)

When the TPF bundle is started, it takes over the other application bundle lifecycles of Equniox control and can listen to the remote TPF, which is a eclipse-equniox-based plug-in framework:

Http://www.blogjava.net/BlueDavy/archive/2006/08/18/64440.html

8.Bundle's Default Web root directory: Module-inf

such as: module-inf/web-inf/page/index.jsp

Spring-osgi Default profile path: meta-inf/spring, the default configuration file under this folder will be loaded, of course, you can change the path;

9.Equniox the class package with the beginning of Java to the parent ClassLoader to load, which means that there is no need to provide packages in the system that begin with export Java.

10. I do not want to put another person's code to be pasted again, the following list of OSGi reference examples and information I collected:

(1). Spring DM Server Development Example (Japanese)

(2) Spring MVC-OSGI Web Development Example

(3) OSGi China official website

(4) SPRING-OSGI 1.0 M3 Chinese Manual

(5) Spring-osgi 1.1.2 Download

(6) Bluedavy's Technical Blog

(7) Blogging in the world of mobile internet

(8) Phrancol ' s Blog

(9) Luo Ming's Blog

(Ten) Yangbutao-blogjava

(11) Opencore: Web applications that develop a pure plug-in architecture based on OSGi

More attention: http://www.osgi.com.cn/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.