The OSGi Alliance, formerly known as the Open Services Gateway initiative, is an open standards organization founded in March 1999 that originally specified and continues to maintain the OSGi standard.
The OSGi specification describes a modular system and a service platform for the Java programming language that implements a complete and dynamic component model, something that does not exist in standalone Java/VM environments. Applications or components, coming in the form of bundles for deployment, can be remotely installed, started, stopped, updated, and uninstalled without requiring a reboot; management of Java packages/classes is specified in great detail. Application life cycle management is implemented via APIs that allow for remote downloading of management policies. The service registry allows 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 from mobile phones to the open-source Eclipse IDE. Other application areas include automobiles, industrial automation, building automation, PDAs, grid computing, entertainment, fleet management and application servers.
Specification process
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.[2] The OSGi Alliance has a compliance program that is open to members only. As of November 2010, there are seven certified OSGi framework implementations.[3] A separate page lists both certified and non-certified OSGi Specification Implementations, which include OSGi frameworks and other OSGi specifications.
Architecture
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:
Bundles
Bundles are normal JAR components with extra manifest headers.
Services
The services layer connects bundles in a dynamic way by offering a publish-find-bind model for plain old Java interfaces (POJIs) or plain old Java objects (POJOs).
Services Registry
The application programming interface for management services (ServiceRegistration, ServiceTracker and ServiceReference).
Life-Cycle
The application programming interface for life cycle management (install, start, stop, update, and uninstall) for bundles.
Modules
The layer that defines encapsulation and declaration of dependencies (how a bundle can import and export code).
Security
The layer that handles the security aspects by limiting bundle functionality to pre-defined capabilities.
Execution Environment
Defines what methods and classes are available in a specific platform. There is no fixed list of execution environments, since it is subject to change as the Java Community Process creates new versions and editions of Java. However, the following set is currently supported by most OSGi implementations:
CDC-1.0/Foundation-1.0
CDC-1.1/Foundation-1.1
OSGi/Minimum-1.0
OSGi/Minimum-1.1
JRE-1.1
From J2SE-1.2 up to J2SE-1.6
Bundles
A bundle is a group of Java classes and additional resources equipped with a detailed manifest MANIFEST.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 typical MANIFEST.MF file with OSGi Headers:
The meaning of the contents in the example is as follows:[4]
Bundle-Name: Defines a human-readable name for this bundle, Simply assigns a short name to the bundle.
Bundle-SymbolicName: The only required header, this entry specifies a unique identifier for a bundle, based on the reverse domain name convention (used also by the java packages).
Bundle-Description: A description of the bundle's functionality.
Bundle-ManifestVersion: Indicates the OSGi specification to use for reading this bundle.
Bundle-Version: Designates a version number to the bundle.
Bundle-Activator: Indicates the class name to be invoked once a bundle is activated.
Export-Package: Expresses which Java packages contained in a bundle will be made available to the outside world.
Import-Package: Indicates which Java packages will be required from the outside world to fulfill the dependencies needed in a bundle.
Life-cycle
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, the BundleActivator.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. The BundleActivator.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 the BundleActivator interface:
Services
{{Expand section|date=March 2009}}
Standard services
The OSGi Alliance has specified many services. Services are specified by a Java 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:
System Services
Description
Logging
The logging 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 the CDC/CLDC javax.microedition.io package as a service. This service allows bundles to provide new and alternative protocol schemes.
Preferences
java/util|Properties}} 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 using HTTP.
UPnP Device Service
Specifies how OSGi bundles can be developed to interoperate with Universal Plug and Play (UPnP) devices.
DMT Admin
Defines an API for managing a device using concepts from the Open 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 with JAXP.
Measurement and State
The Measurement and State service allows and simplifies the correct handling of measurements in an OSGi service platform.
Organization
The OSGi Alliance was founded by Ericsson, 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|2015|alt=as of February 2015}}) more than 35 companies from quite different business areas, for example Adobe Systems, Deutsche Telekom, Hitachi, IBM, Liferay, Makewave (formerly Gatespace Telematics), NEC, NTT, Oracle, Orange S.A., ProSyst, Salesforce.com, Siemens, Software AG and TIBCO Software.[5]
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}}).
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 a MIDP-based service platform for the next generation of smart mobile phones, addressing some of the needs that CLDC cannot manage - other than CDC. MEG became part of OSGi as with R4.
Specification versions
OSGi Release 1 (R1): May 2000
OSGi Release 2 (R2): October 2001
OSGi Release 3 (R3): March 2003
OSGi Release 4 (R4): October 2005 / September 2006
Core Specification (R4 Core): October 2005
Mobile Specification (R4 Mobile / JSR-232): September 2006
OSGi Release 4.1 (R4.1): May 2007 (AKA JSR-291)
OSGi Release 4.2 (R4.2): September 2009
Enterprise Specification (R4.2): March 2010
OSGi Release 4.3 (R4.3): April 2011
Core: April 2011
Compendium and Residential: May 2012
OSGi Release 5 (R5): June 2012
Core and Enterprise: June 2012
OSGi Release 6 (R6): June 2015
Core: June 2015
OSGi Release 7 (R7): April 2018
Core and Compendium: April 2018
Related RFCs and Java specifications
RFC 2608 (Service Location Protocol)
Sun Jini
Sun JCP JSR-8 (Open Services Gateway Specification)
Sun JCP JSR-232 (Mobile Operational Management)
Sun JCP JSR-246 (Device Management API)
Sun JCP JSR-249 (Mobile Service Architecture for CDC)
Sun JCP JSR-277 (Java Module System)
Sun JCP JSR-291 (Dynamic Component Support for Java SE - AKA OSGi 4.1)
Sun JCP JSR-294 (Improved Modularity Support in the Java Programming Language)
Related standards
MHP / OCAP
Universal Plug and Play (UPnP)
DPWS
ITU-T G.hn
LonWorks
CORBA
CEBus
EHS (KNX) / CECED CHAIN
Java Management Extensions
Projects using OSGi
Adobe Experience Manager - A comprehensive content management solution for building websites, mobile apps and forms.
Apache Aries - Blueprint Container implementations and extensions of application-focused specifications defined by OSGi Enterprise Expert Group.
Apache Sling - OSGi-based applications layer for JCR content repositories
Atlassian Confluence and JIRA - the plug-in architecture for this enterprise wiki and issue tracker uses OSGi
Business Intelligence and Reporting Tools (BIRT) Project - Open source reporting engine
Cytoscape - an open source bioinformatics software platform (as of version 3.0)
DataNucleus - open source data services and persistence platform in service-oriented architectures
Dotcms - open source Web Content Management
EasyBeans - open source EJB 3 container
Eclipse - open source IDE and rich client platform
Eclipse Smart Home - open source framework for building automation
iDempiere - is an OSGi implementation of the open source ERP Branch GlobalQSS Adempiere361 originally started by Low Heng Sin.[6]
Eclipse Virgo - open source microkernel-based server constructed of OSGi bundles and supporting OSGi applications
GlassFish (v3) - application server for Java EE
Fuse ESB - a productized and supported release of ServiceMix 4.
ServiceMix - Apache ServiceMix is a flexible, open-source integration container that unifies the features and functionality of following components: Apache ActiveMQ, Apache Camel, CXF, and Apache Karaf into a powerful runtime platform. You can use servicemix to build your own integrations solutions and it provides a complete, enterprise ready ESB exclusively powered by OSGi.
GX WebManager Community Edition - An Enterprise Web Content Management System based on OSGi, spring and JCR
Kura - Eclipse IOT open source project for M2M applications
IntelliJ - Java IDE and rich client platform with free community edition
JBoss - Red Hat's JBoss Application Server
JOnAS 5 - open source Java EE 5 application server
JOSSO 2 - Atricore's open source standards-based Identity and Access Management Platform
Liferay - a free and open source enterprise portal platform
Lucee 5 - open source CFML Web Application Server
NetBeans - open source IDE and rich client platform
Nuxeo - open source ECM Service Platform
Open Daylight Project - Project with the goal of accelerating the adoption of software-defined networking
OpenEJB - open source OSGi-enabled EJB 3.0 container that can be run both in standalone or embedded mode
openHAB - open source home automation software
OpenWorm - open source software simulation of C. elegans, via the dedicated Geppetto modular platform
Akana - API Gateway, Portal and Analytics server from Akana (formerly SOA Software)
SpringSource dm Server - open source microkernel-based server constructed of OSGi bundles and supporting OSGi applications
Weblogic - Oracle Weblogic Application Server
WebSphere - IBM Websphere JEE Application Server
WebMethods - SoftwareAG WebMethods
WSO2 Carbon - Base platform for WSO2’s enterprise-grade Open source middleware stack.
| first1 = Holly | last1 = Cummins | first2 = Tim | last2 = Ward | date = March 28, 2013 | title = Enterprise OSGi in Action | edition = 1st | publisher = Manning Publications | pages = 376 | isbn = 978-1617290138 | url = }}
{{citation
| first1 = Alexandre de Castro | last1 = Alves | date = July 28, 2011 | title = OSGi in Depth | edition = 1st | publisher = Manning Publications | pages = 325 | isbn = 1-935182-17-X | url = }}
{{citation
| first1 = Jeff | last1 = McAffer | first2 = Paul | last2 = VanderLei | first3 = Simon | last3 = Archer | date = February 24, 2010 | title = OSGi and Equinox: Creating Highly Modular Java Systems | edition = 1st | publisher = Addison-Wesley Professional | pages = 460 | isbn = 0-321-58571-2 | url = http://www.informit.com/store/product.aspx?isbn=0321612353 }}
{{citation
| first1 = Walid | last1 = Joseph Gédéon | date = November 5, 2010 | title = OSGi and Apache Felix 3.0 Beginner's Guide | edition = 1st | publisher = Packt Publishing | pages = 336 | isbn = 1-84951-138-1 | url = https://www.packtpub.com/osgi-and-apache-felix-30-beginners-guide/book }}
{{citation
| first1 = Craig | last1 = Walls | date = July 2009 | title = Modular Java with OSGi and Spring | edition = 1st | publisher = Pragmatic Bookshelf | pages = 250 | isbn = 978-1-934356-40-1 | url = http://pragprog.com/titles/cwosg/modular-java }}
{{citation
| first1 = Richard S | last1 = Hall | first2 = Karl | last2 = Pauls | first3 = Stuart | last3 = McCulloch | date = September 2009 | title = OSGi in Action | edition = 1st | publisher = Manning Publications | pages = 375 | isbn = 1-933988-91-6 | url = }}
{{citation
| first1 = Alexandre de Castro | last1 = Alves | date = March 2009 | title = OSGi Application Frameworks | edition = 1st | publisher = Manning Publications | pages = 325 | isbn = 978-1-935182-17-7 | url = }}
{{citation
| first = Neil | last = Bartlett | title = OSGi In Practice | date = 2009-01-10 | edition = DRAFT | volume = | series = | publisher = | pages = 229 | page = | id = | isbn = | doi = | oclc = | url = http://s3.amazonaws.com/neilbartlett.name/osgibook_preview_20090110.pdf | accessdate = }}
{{citation
| first1 = Jeff | last1 = McAffer | first2 = Paul | last2 = VanderLei | first3 = Simon | last3 = Archer | date = September 7, 2009 | title = Equinox and OSGi: The Power Behind Eclipse | edition = 1st | publisher = Addison-Wesley Professional | pages = 480 | isbn = 0-321-58571-2 | url = http://www.informit.com/store/product.aspx?isbn=0321609425 }}
{{citation
| first1 = Gary | last1 = Mak | year = 2009 | title = Pro SpringSource dm Server | publisher = Apress | pages = 250 | isbn = 1-4302-1640-9 | url = http://www.apress.com/book/view/9781430216407 }}
{{citation
| first1 = Daniel | last1 = Rubio | date = 2009-02-12 | edition = First | title = Pro Spring Dynamic Modules for OSGi Service Platforms | publisher = Apress | pages = 392 | isbn = 1-4302-1612-3 | url = http://www.apress.com/book/view/1430216123 }}
{{citation
| year = 2003 | title = OSGi Service Platform, Release 3 | publisher = IOS Press | pages = 604 | isbn = 1-58603-311-5 | author = The OSGi Alliance }}
{{citation
| year = 2007 | title = OSGi Service Platform, Core Specification, Release 4, Version 4.1 | publisher = OSGi Alliance. | pages = 228 | isbn = 978-90-79350-01-8 }}
{{citation
| year = 2009 | title = OSGi Service Platform, Core Specification, Release 4, Version 4.2 | publisher = OSGi Alliance. | pages = 332 | isbn = 978-90-79350-04-9 }}
{{citation
| year = 2007 | title = OSGi Service Platform, Service Compendium, Release 4, Version 4.1 | publisher = OSGi Alliance. | pages = 594 | isbn = 978-90-79350-02-5 }}
{{citation
| year = 2007 | title = OSGi Service Platform, Mobile Specification, Release 4, Version 4 | publisher = OSGi Alliance. | pages = 426 | isbn = 978-90-79350-03-2 }}
{{citation
| year = 2001 | title = Programming Open Service Gateways with Java Embedded Server(TM) Technology | publisher = Prentice Hall PTR | pages = 480 | isbn = 0-201-71102-8 | author = Kirk Chen, Li Gong. }}
{{citation
| year = 2010 | title = Building an OSGI Declarative Service with Maven using Netbeans | publisher = | pages = | isbn = | author = Kayode Odeyemi | url = http://sinati.com/blog/2010/glassfish/building-osgi-declarative-service-maven-using-netbeans }}
{{citation
| year = 2011 | title = OSGi 4.3 Technical Update: What's new? | publisher = The Eclipse Foundation | pages = | isbn = | author = BJ Hargrave (IBM) | url = http://www.eclipsecon.org/2011/sessions/?page=sessions&id=2279 }}{{refend}}
External links
{{Commons category|OSGi}}
{{Official website|http://www.osgi.org/}}
Oredev 2008 - Architecture - OSGi Now and Tomorrow
Chinese OSGi Community
Frequently Asked Questions
OSGi Developer Mail List
OSGi Open Forum and Discussion Central
Eclipse Equinox Article Index - Articles on an open source OSGi implementation
OSGi Users' Forums - Belgium, Brazil, China, France, Germany, Japan, Korea, Spain, Sweden, UK
6 : Standards organizations in the United States|Articles with example Java code|Free software programmed in Java (programming language)|1999 establishments in the United States|Embedded systems|Organizations based in California