This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "OSGi" – news ·newspapers ·books ·scholar ·JSTOR(September 2023) (Learn how and when to remove this message) |
| OSGi | |
|---|---|
![]() OSGi Alliance logo | |
| Year started | 1999 |
| Latest version | 8.0 October 2020 (2020-10)[1] |
| Organization | OSGi Alliance |
| Domain | Java |
| License | OSGi Specification License, Version 2.0 |
| Website | www |
OSGi is an open specification andopen source project under theEclipse Foundation.[2]
It is a continuation of the work done by theOSGi Alliance (formerly known as theOpen Services Gateway initiative), which was anopen standards organization forsoftware founded in March 1999. The foundation originally specified and maintained theOSGistandard. The alliance transferred its work to theEclipse Foundation at the end of 2020.[3]
TheOSGi specification describes a modular system and aservice platform for theJava programming language that implements a complete and dynamiccomponent model, something that does not exist in standalone Java orVM environments. It has aservice-oriented architecture based on micro services each implemented as an extended Java class file archive (JAR (file format)).
OSGi is built around aservice-oriented architecture.Applications or components, come in the form ofbundles fordeployment, can be remotely installed, started, stopped, updated, and uninstalled without requiring areboot. Management ofJava packages/classes is specified in great detail. Application life cycle management is implemented via APIs that enable remotedownloading of management policies. The service registry enables bundles to detect the addition of new services or the removal of services, and adapt accordingly.
The OSGi specifications have evolved beyond the original focus of service gateways, and are now used in applications ranging frommobile phones to the open-sourceEclipse IDE. Other application areas includeautomobiles,industrial automation,building automation,PDAs,grid computing,entertainment,fleet management andapplication servers.
In October 2020, the OSGi Alliance announced the transition of the standardization effort to the Eclipse Foundation, subsequent to which it would shut down.[4] All artifacts have been transferred to the Eclipse Foundation, where an “OSGi Working Group" continues to maintain and evolve the specification.
The OSGi specification is developed by the members in an open process and made available to the public free of charge under the OSGi Specification License.[5] The OSGi Alliance has acompliance program that is open to members only. As of November 2010, there are seven certified OSGi frameworkimplementations.[6] A separate page lists both certified and non-certifiedOSGi Specification Implementations, which include OSGi frameworks and other OSGi specifications.
This sectiondoes notcite anysources. Please helpimprove this section byadding citations to reliable sources. Unsourced material may be challenged andremoved.(September 2023) (Learn how and when to remove this message) |

OSGi is a Java framework for developing and deploying modular software programs and libraries. Each bundle is a tightly coupled, dynamically loadable collection of classes, jars, and configuration files that explicitly declare their external dependencies (if any).
The framework is conceptually divided into the following areas:

A bundle is a group of Java classes and additional resources equipped with a detailed manifestMANIFEST.MF file on all its contents, as well as additional services needed to give the included group of Java classes more sophisticated behaviors, to the extent of deeming the entire aggregate a component.
Below is an example of a typicalMANIFEST.MF file with OSGi Headers:
Bundle-Name:Hello WorldBundle-SymbolicName:org.wikipedia.helloworldBundle-Description:A Hello World bundleBundle-ManifestVersion:2Bundle-Version:1.0.0Bundle-Activator:org.wikipedia.ActivatorExport-Package:org.wikipedia.helloworld;version="1.0.0"Import-Package:org.osgi.framework;version="1.3.0"
The meaning of the contents in the example is as follows:[7]
This sectiondoes notcite anysources. Please helpimprove this section byadding citations to reliable sources. Unsourced material may be challenged andremoved.(September 2023) (Learn how and when to remove this message) |

A Life Cycle layer adds bundles that can be dynamically installed, started, stopped, updated and uninstalled. Bundles rely on the module layer for class loading but add an API to manage the modules in run time. The life cycle layer introduces dynamics that are normally not part of an application. Extensive dependency mechanisms are used to assure the correct operation of the environment. Life cycle operations are fully protected with the security architecture.
| Bundle State | Description |
|---|---|
| INSTALLED | The bundle has been successfully installed. |
| RESOLVED | All Java classes that the bundle needs are available. This state indicates that the bundle is either ready to be started or has stopped. |
| STARTING | The bundle is being started, theBundleActivator.start method has been called but the start method has not yet returned. When the bundle has an activation policy, the bundle will remain in the STARTING state until the bundle is activated according to its activation policy. |
| ACTIVE | The bundle has been successfully activated and is running; its Bundle Activator start method has been called and returned. |
| STOPPING | The bundle is being stopped. TheBundleActivator.stop method has been called but the stop method has not yet returned. |
| UNINSTALLED | The bundle has been uninstalled. It cannot move into another state. |
Below is an example of a typical Java class implementing theBundleActivator interface:
packageorg.wikipedia;importorg.osgi.framework.BundleActivator;importorg.osgi.framework.BundleContext;publicclassActivatorimplementsBundleActivator{privateBundleContextcontext;@Overridepublicvoidstart(BundleContextcontext)throwsException{System.out.println("Starting: Hello World");this.context=context;}@Overridepublicvoidstop(BundleContextcontext)throwsException{System.out.println("Stopping: Goodbye Cruel World");this.context=null;}}
The OSGi Alliance has specified many services. Services are specified by aJava interface. Bundles can implement this interface and register the service with the Service Registry. Clients of the service can find it in the registry, or react to it when it appears or disappears.
The table below shows a description of OSGi System Services:[8]
| System Services | Description |
|---|---|
| Logging | Thelogging of information, warnings, debug information or errors is handled through the Log Service. It receives log entries and then dispatches these entries to other bundles that subscribed to this information. |
| Configuration Admin | This service allows an operator to set and get the configuration information of deployed bundles. |
| Device Access | Facilitates the coordination of automatic detection and attachment of existing devices. This is used for Plug and Play scenarios. |
| User Admin | This service uses a database with user information (private and public) for authentication and authorization purposes. |
| IO Connector | The IO Connector Service implements theCDC/CLDCjavax.microedition.io package as a service. This service allows bundles to provide new and alternative protocol schemes. |
| Preferences | Offers an alternative, more OSGi-friendly mechanism to using Java's defaultProperties for storing preferences. |
| Component Runtime | The dynamic nature of services—they can come and go at any time—makes writing software harder. The Component Runtime specification can simplify handling these dynamic aspects by providing an XML based declaration of the dependencies. |
| Deployment Admin | Standardizes access to some of the responsibilities of the management agent. |
| Event Admin | Provides an inter-bundle communication mechanism based on a publish-and-subscribe model. |
| Application Admin | Simplifies the management of an environment with many different types of applications that are simultaneously available. |
The table below shows a description of OSGi Protocol Services:
| Protocol Services | Description |
|---|---|
| HTTP Service | Allows information to be sent and received from OSGi usingHTTP. |
| UPnP Device Service | Specifies how OSGi bundles can be developed to interoperate withUniversal Plug and Play (UPnP) devices. |
| DMT Admin | Defines an API for managing a device using concepts from theOpen Mobile Alliance (OMA) device management specifications. |
The table below shows a description of OSGi Miscellaneous Services:
| Miscellaneous Services | Description |
|---|---|
| Wire Admin | Allows the connection between a Producer service and a Consumer service. |
| XML Parser | The XML Parser service allows a bundle to locate a parser with desired properties and compatibility withJAXP. |
| Measurement and State | The Measurement and State service allows and simplifies the correct handling of measurements in an OSGi service platform. |
The OSGi Alliance was founded byEricsson,IBM,Motorola,Sun Microsystems and others in March 1999. Before incorporating as a nonprofit corporation, it was called the Connected Alliance.
Among its members are (as of February 2015[update]) more than 35 companies from quite different business areas, for exampleAdobe Systems,Deutsche Telekom,Hitachi,IBM,Liferay, Makewave,NEC,NTT,Oracle,Orange SA,ProSyst,Salesforce,Siemens,Software AG andTIBCO Software.[9]
The Alliance has a board of directors that provides the organization's overall governance. OSGi officers have various roles and responsibilities in supporting the alliance. Technical work is conducted within Expert Groups (EGs) chartered by the board of directors, and non-technical work is conducted in various working groups and committees. The technical work conducted within Expert Groups include developing specifications, reference implementations, and compliance tests. These Expert Groups have produced five major releases of the OSGi specifications (As of 2012[update]).
Dedicated Expert Groups exist for the enterprise, mobile, vehicle and the core platform areas.
The Enterprise Expert Group (EEG) is the newest EG and is addressing Enterprise / Server-side applications.In November 2007 the Residential Expert Group (REG) started to work on specifications to remotely manage residential/home-gateways.In October 2003,Nokia,Motorola,IBM,ProSyst and other OSGi members formed a Mobile Expert Group (MEG) that will specify aMIDP-based service platform for the next generation of smart mobile phones, addressing some of the needs thatCLDC cannot manage – other thanCDC. MEG became part of OSGi as with R4.
This sectiondoes notcite anysources. Please helpimprove this section byadding citations to reliable sources. Unsourced material may be challenged andremoved.(September 2023) (Learn how and when to remove this message) |
This sectiondoes notcite anysources. Please helpimprove this section byadding citations to reliable sources. Unsourced material may be challenged andremoved.(September 2023) (Learn how and when to remove this message) |
| Name | License |
|---|---|
| Apache Felix | Open source |
| Apache Karaf | Open source |
| Concierge OSGi | Open source |
| Equinox OSGi | Open source |
| Eclipse Gemini | Open Source |
| Knopflerfish | Open Source |
{{cite web}}:|last= has generic name (help)