Learn how the Eclipse plug-in uses OSGi

Source: Internet
Author: User

The relationship between Eclipse and OSGi, from Plugin.xml to MANIFEST.MF

The core of the Eclipse Integrated Development Environment (IDE) and Eclipse Rich Client Platform (RCP) applications is driven by the implementation of the Open Services Gateway Initiative (OSGI) specification. This article illustrates the relationship between Eclipse and OSGi by describing what Plug-ins are for the Eclipse platform and tracking the development of Plug-ins from Eclipse V2.1 to today's OSGi based implementations. It also explains the OSGi manifest.mf file option and the additions provided through Eclipse.

Most Java™ programming language developers understand Eclipse through the functionality of the IDE. The Eclipse IDE actually consists of a collection of interactive components called Plug-ins. These plug-ins form the foundation of the IDE, and they can also be used to create other desktop applications. The minimum set of plug-ins required to create an eclipse based application is called the Eclipse Rich Client Platform (RCP). However, the plug-in itself cannot be started. They need to be started and manipulated in an environment. Eclipse provides the environment with an implementation of the OSGi R4 specification.

Because Eclipse is essentially OSGi-driven, you must understand how the concept of the Eclipse plug-in relates to the OSGi framework. In this article, I'll explain this relationship in detail by describing what Plug-ins are for the Eclipse platform. It then describes the development of Plug-ins in the Eclipse V2.1 platform to today's OSGi based implementations. Finally, the MANIFEST.MF options that are provided by OSGi that are applied to the Eclipse plug-in are described in detail.

What is a plugin?

The Eclipse online Help defines a plug-in as:

A plug-in is a structured package of code and/or data that provides functionality for the system. Functionality can be provided in the form of a code base (a Java class with a common [application interface] API), a platform extension, or even a document. Plug-ins can define extension points, well-defined locations, and other plug-ins can add functionality in these locations. ”

One important point to note is that Plug-ins provide functionality in a structured way. They can provide services (such as logs) or functions that can be used in the user interface (UI), such as editors. Regardless of the functionality, all plug-ins are defined in the same structured fashion.

To the development of OSGi

As mentioned earlier, Eclipse uses OSGi as the basis for a plug-in system. But this is not always the case. Earlier versions of Eclipse were also designed as a collection of Plug-ins, and Eclipse included its own dedicated plug-in system to manage interactions. However, with the growth required by the Eclipse IDE, a stronger solution must be needed. The basic requirements of this new system include the ability to dynamically add new Plug-ins and stop existing plug-ins. After a lot of research, the Eclipse creator decided to replace the dedicated plug-in framework by implementing the OSGI Framework specification.

OSGi is the specification of a service platform. Eclipse provides one of the many available implementations of the specification and is used as a reference implementation for the latest OSGi R4 specification. OSGi is a java-based framework designed for systems that require long running times, dynamic updates, and minimal disruption to the running environment. Initially, OSGi was designed for home automation and home gateway devices. Recently, it has been spotted from mobile phones to cars.

At the core, OSGi is a component and service model, as shown in Figure 1. The OSGI specification defines a modular unit called a binding package. (in the following article, unless specifically specified, the Eclipse term plug-in and the OSGi term bundle are interchangeable, because all eclipse plug-ins are now OSGi bundles.) OSGi also provides a Java Virtual Machine (JVM)-level service registry that can be used to publish, discover, and bind to services.

Figure 1. Host operating system, Java and OSGi middle-tier interactions

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.