Osgi learning notes

Source: Internet
Author: User

Osgi-open Service Gateway initiative is a public service platform.

Several features of osgi:

The first and most important point is that osgi-based applications can dynamically change the running status and behavior. I have participated in the development of J2EE enterprise-level projects. The application server uses IBM WebSphere and mainly develops some applications based on EJB 2.1. I was most impressed by the entire development experience by waiting, excluding a series of complicated interfaces required in EJB specifications, and deploying and testing applications alone, repeatedly starting the server wastes a lot of time. In the osgi framework, every bundle can be hot-swappable. Therefore, modifying a specific bundle does not affect all applications in the container. Most applications running can still work as usual. When you deploy the modified bundle again, the container has never been restarted. in the outside world, this process seems to have never happened. This dynamically changeable state feature is particularly important in some systems with strong timeliness, such as a timely sales system, when your server needs to update a component and restart it for several minutes, it will inevitably lead to loss of customers and loss of benefits, however, applications using the osgi architecture can minimize the loss. Spring
With its excellent features, the framework occupies the half-edge sky of enterprise application development. In version 2.5, it was announced that all jar packages support the osgi feature, the Sub-Project maintained by spring osgi is also specifically designed for spring and osgi integration. In earlier versions of spring, it was criticized that it could not dynamically change its running status, forced to stop the server, and then modify the configuration file. Combined with osgi, it will inevitably lead to the end of this state. Finally, the author believes that this feature also ensures sufficient flexibility and scalability of the system, and greatly saves the waiting time for developers.

Second, it is a stable and efficient system. Osgi is a microkernel system. The so-called microkernel refers to a few jar packages with only the core. Systems Based on the osgi framework can be combined. The advantages of the osgi framework prevent the bundle from affecting the global structure and cause the global system to crash due to local errors. Each bundle is started only when the service is called. Therefore, the performance is much higher than that of the general framework.

Third, high reusability. The osgi framework is highly reusable, and it is easy to build an interface-oriented program architecture. each bundle is an independent reusable unit. However, adopting the osgi framework for enterprise development requires both boldness and courage, because most of the current software companies have been accumulating for many years and will leave some reusable toolbox programs behind, the adoption of osgi architecture requires re-encapsulation of these legacy systems. More likely, the entire architecture needs to be dispersed and re-structured and arranged. This development cost cannot be said to be not high, but I think it is worthwhile, because from then on, enterprises can use the unique characteristics of osgi to easily filter out repeated knowledge. For new development, You can streamline reusable modules from the enterprise bundles library and customize new bundles to maximize the use of previous accumulation, such a process can even enhance the competitiveness of enterprises.

Six States of bundles:

Installed The installation is complete. The local resources are loaded successfully.
Resolved The dependency is satisfied, that is, the bundle is either ready to run or stopped.
Starting Bundle is being started
Stopping Bundle is being stopped
Active Bundle activated and running
Uninstalled Bundle has been uninstalled.

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.