Osgi: the foundation of eclipse

Source: Internet
Author: User

Osgi: the foundation of eclipse


Osgi provides a set of standard component-oriented specifications for network services. network services are the basis of Service Oriented Architecture. by using the osgi platform, you can easily manage the lifecycle of software components. These components can be deployed on any device on the network, and can be dynamically installed, loaded, upgraded, and uninstalled, you do not need to terminate or restart the device. the components here refer to libraries or applications, and they can dynamically use other libraries and programs.

In fact, osgi is a lightweight framework designed to address the limitations (CPU, memory, bandwidth, etc.) of home networks or embedded devices. but now osgi far exceeds its original functions. osgi has been applied to mobile communication, automotive, telecom, embedded devices, PC desktops, servers, and many other fields. thanks to its open and simple style, it attracts more and more famous companies to join in, making osgi more and more open.

I don't know the application of osgi in other fields. I just want to use eclipse, so I only have some familiarity and knowledge about osgi applications in PC Desktop. like osgi, eclipse is also an open platform. It is based on the osgi service platform. The architecture of eclipse on osgi integrates other applications and components, enable different components to run on a Java Virtual Machine (JVM), so that they can work together and consume less memory and CPU time, in addition, all lifecycle activities of platform management components can be said to be under control.

In osgi, each specific component must inherit from bundle. Bundle is an interface that defines operations such as installation, upgrade, uninstallation, start, and stop. in eclipse, plug-ins (the component mentioned above) are not inherited from bundle, but inherited from another important interface bundleactivator. the latter only has two interface functions-start and stop. it can be seen from its name that it is actually a class that controls bundle. there are a lot of such applications in eclipse. One Class is responsible for providing interfaces to meet different needs, and another class is responsible for operating this class. for example, iworkbench, workbenchadvisor, iworkbenchwindow, and workbenchwindowadvisor can prevent customers from directly dealing with core classes and reduce their burden.

In eclipse, components exist in the form of plugin. Almost every component must have a class implementation (inheritance) plugin class (with exceptions ), generally, plugin is used to control service loading and uninstallation, because plugin inherits from bundleactivor. in addition to bundle and bundleactivor, osgi also provides bundleevent and bunddlelistner interfaces. these are relatively simple.

Another important interface is bundlecontext, which provides the context required by a bundle. A bundle corresponds to a bundlecontext. When the bundle is stopped, it is destroyed. bundlecontext provides the servicefactory interface for registration. Bundle can register some service factory interfaces, so that other bundle can achieve the purpose of expansion through these interfaces. in eclipse, the corresponding concepts are "iextensionpoint" and "iextension )". the interaction between bundle is very important. With this technology, you can divide a large project into multiple bundle and build blocks.

Eclipse 3.0 does not replace the original plug-in mechanism with osgi. It is only compatible with the standard: it provides users with a series of APIS for access. In this process, some changes must be made (such as plugin registry and loading mechanism) to be fully compatible with osgi standards. The original plug-in core only supports static expansion. That is to say, to change an existing plug, you must restart the core, that is, exit eclipse and restart.

Many people have asked why eclipse should be compatible with osgi specifications instead of other ones?

Before eclipse was donated, eclipse was developed by Oti to develop an embedded Java software development platform. On the Internet, many connections still direct to Visual Age Micro Edition (vame). This is also one reason why SWT is conceived and they want to use SWT in the user interface of embedded devices. This relationship explains why osgi specifications were selected at the time.

Another reason is that there are no other specifications except osgi. Osgi specifications are widely supported in lightweight service architecture applications. In addition, osgi is supported by many well-known companies in the telecom industry and some well-known companies in other industries. They need to use osgi to compete with Sun's j2s.
 

Related Article

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.