OSGi: Difference between revisions
Line 16: | Line 16: | ||
== OSGi Framework Scope == |
== OSGi Framework Scope == |
||
[[Image:Osgi.svg|thumb|Right|250px|Classification: OSGi & System-Layering]] |
[[Image:Osgi.svg|thumb|Right|250px|Classification: OSGi & System-Layering]] |
||
The Framework implements a complete and dynamic [[component model]], something that |
The Framework implements a complete and dynamic [[component model]], something that does not exist in standalone Java/VM environments. [[Application software|Applications]] or components (coming in the form of [[bundle]]s for [[software deployment|deployment]]) can be remotely installed, started, stopped, updated and uninstalled without requiring a [[Reboot (computer)|reboot]]; management of [[Java package]]s/[[class (computer science)|class]]es is specified in great detail. [[Application Lifecycle Management|Life cycle management]] is done via APIs which 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 original focus was on service gateways but the applicability turned out to be much wider. The OSGi specifications are now used in applications ranging from [[mobile phone]]s to the open source [[Eclipse (software)|Eclipse IDE]]. Other application areas include [[automobile]]s, [[industrial automation]], [[building automation]], [[Personal Digital Assistant|PDA]]s, [[grid computing]], [[entertainment]] (e.g. [http://www.linuxdevices.com/articles/AT9382400943.html iPronto]), [[fleet management]] and [[application server]]s. |
The original focus was on service gateways but the applicability turned out to be much wider. The OSGi specifications are now used in applications ranging from [[mobile phone]]s to the open source [[Eclipse (software)|Eclipse IDE]]. Other application areas include [[automobile]]s, [[industrial automation]], [[building automation]], [[Personal Digital Assistant|PDA]]s, [[grid computing]], [[entertainment]] (e.g. [http://www.linuxdevices.com/articles/AT9382400943.html iPronto]), [[fleet management]] and [[application server]]s. |
Revision as of 17:51, 24 April 2009
Developer(s) | OSGi Alliance |
---|---|
Stable release | 4.1
/ May 2007 |
Operating system | Java |
Type | standards organization |
License | OSGi Specification License |
Website | http://www.osgi.org |
The OSGi Alliance (formerly known as the Open Services Gateway initiative, now an obsolete name) is an open standards organization founded in March 1999. The Alliance and its members have specified a Java-based service platform that can be remotely managed. The core part of the specifications is a framework that defines an application life cycle management model, a service registry, an Execution environment and Modules. Based on this framework, a large number of OSGi Layers, APIs, and Services have been defined.
OSGi Framework Scope
The Framework 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. Life cycle management is done via APIs which 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 original focus was on service gateways but the applicability turned out to be much wider. The OSGi specifications 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 (e.g. iPronto), 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 [1]. The OSGi Alliance has a compliance program that is open to members only. As of September 2008, the list of certified OSGi implementations contains five entries.
Architecture
Frameworks that implement the OSGi standard provide an environment for the modularization of applications into smaller bundles. 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 objects(POJO).
- Services Registry - The API for management services (ServiceRegistration, ServiceTracker and ServiceReference).
- Life-Cycle - The API for life cycle management (install, start, stop, update, and uninstall 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 an example of typical MANIFEST.MF
file with OSGi Headers:
Bundle-Name: Hello World Bundle-SymbolicName: org.wikipedia.helloworld Bundle-Description: A Hello World bundle Bundle-ManifestVersion: 2 Bundle-Version: 1.0.0 Bundle-Activator: org.wikipedia.Activator Export-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 [2]:
- 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: This little known header 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 what Java packages contained in a bundle will be made available to the outside world.
- Import-Package: Indicates what Java packages will be required from the outside world, in order to fulfill the dependencies needed in a bundle.
Life-Cycle
This section needs expansion. You can help by adding to it. (March 2009) |
Services
This section needs expansion. You can help by adding to it. (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 | Offers an alternative, more OSGi-friendly mechanism to using Java’s default java.util.Properties for storing preference |
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 interbundle 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 formation to be sent and received from OSGi using HTTP, the Web’s protocol. |
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:
Protocol 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, Oracle, 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 May 2007[update]) more than 35 companies from quite different business areas, for example IONA Technologies, Ericsson, Deutsche Telekom, IBM, Makewave (formerly Gatespace Telematics), Motorola, Nokia, NTT, Oracle, ProSyst, Red Hat, Samsung Electronics, Siemens, SpringSource, and Telefonica.
The Alliance has a Board of Directors which 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, working together, have produced four major releases of the OSGi specifications (as of 2007).
There are dedicated Expert Groups 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.
Community
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.
Also in 2003 Eclipse selected OSGi as the underlying runtime for the plug-in architecture used for the Eclipse Rich Client Platform and the IDE platform. Eclipse itself includes sophisticated tooling for developing OSGi bundles and there are a number of other Eclipse plug-ins aimed at supporting OSGi behaviour (e.g. both ProSyst and Knopflerfish have Eclipse plug-ins available specifically for OSGi developers).
There is a vibrant free software community revolving around the OSGi. Some widely-used open source implementations are Equinox OSGi, Apache Felix, Knopflerfish OSGi project as well as the mBedded Server Equinox Edition. Regarding tooling, build system support and testing, the OPS4J Pax projects provide a lot of useful components and expertise.
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)
New in OSGi Release 4
The new features of OSGi R4 in brief are as follows:
- New modularization capabilities providing enhanced encapsulation of networked services that can share a single VM.
- Modularized class sharing and hiding of implementation details.
- Methods for handling multiple versions of the same classes so old and new applications can execute within the same VM.
- Localization of OSGi bundle manifests enabling service deployment anywhere.
- Enhancements in security and policies: The new Conditional Permission Admin service provides an elegant and simple way to manage networked services securely. It also supports dynamic policies that can depend on external (custom) conditions. Combined with R4 support for digital signatures, this provides a central security solution to large deployments of products using the OSGi Service Platform.
- A Declarative Services specification that addresses memory footprint issues that can prevent small embedded devices from using a service oriented architecture to support multiple applications. Additionally, it significantly simplifies the service-oriented programming model by declaratively handling the dynamics of services.
- Compatibility with Release 3, requiring no changes for existing OSGi bundles, applications, or services.
OSGi Tutorial
Guidance and Information Exchange
- Frequently Asked Questions
- OSGi Developer Mail List
- OSGi Open Forum and Discussion Central
- Eclipse Equinox Article Index - Articles on an open source OSGi implementation
- ProSyst - Access to supported Open Source and Commercial OSGi implementations as well as to 100+ inhouse OSGi developers, seminars, trainings, consulting and custom development services
- aQute: OSGi Info - Information about OSGi and access to seminars
- OSGi Users' Forums - China, Japan, Korea, France, Spain, Sweden, Belgium, Germany and soon : Italy
Related RFCs and Java Specifications
- RFC-2608 (Service Location Protocol)
- Sun JINI (Java Intelligent Network Infrastructure)
- 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 Technology Standards
- MHP / OCAP
- Universal Plug and Play (UPnP)
- Universal Powerline Association
- HomePlug
- ITU-T G.hn
- LonWorks
- CORBA
- CEBus
- EHS (KNX) / CECED CHAIN
- X10
- Java Management Extensions
Projects Using OSGi
- Websphere - IBM Websphere JEE Application Server
- JBoss - Redhat's JBoss Application Server
- Weblogic - Oracle Weblogic Application Server
- SpringSource - Spring Source DM Server
- Carbon - open source SOA platform - modular ESB, Service Hosting, Data Services, Governance and Business Process runtime
- Datanucleus - open source data services and persistence platform in service oriented architectures
- OpenEJB - open source OSGi-enabled EJB 3.0 container that can be run both in standalone or embedded mode
- EasyBeans - open source EJB 3 container
- Eclipse - open source IDE and rich client platform
- Nuxeo - open source ECM Service Platform
- JOnAS 5 - open source Java EE 5 application server
- JPOX - open source object-relational mapper
- Newton - open source distributed OSGi/SCA runtime
- Business Intelligence and Reporting Tools (BIRT) Project - Open source reporting engine
- Apache Sling - OSGi-based applications layer for JCR content repositories.
- GlassFish (v3) - application server for J2EE
- Project Fuji in Open ESB v3 - Light weight and modular ESB core runtime.
- SIP Communicator - open source Java VoIP and multi-protocol instant messenger
- SpringSource dm Server - A module-based Java application server built on Spring, Tomcat and OSGi-based technologies.
- ServiceMix 4 - An open source ESB with an OSGi core. It also includes JBI support.
- FUSE ESB 4 - a productized and supported release of ServiceMix 4.
- GX WebManager Community Edition - An Enterprise Web Content Management System based on OSGi, spring and JCR
- netifera - open source network security framework
- Atlassian Plugin Framework 2
- Dosgi - distributed OSGi through Web Services project
References
- ^ OSGi Specification License
- ^ Creating OSGi bundles by Costin Leau
Books
- Walls, Craig (July 2009), Modular Java with OSGi and Spring (1st ed.), Pragmatic Bookshelf, p. 250, ISBN 9781934356401
- Hall, Richard S (September 2009), OSGi in Action (1st ed.), Manning Publications, p. 375, ISBN 1933988916
{{citation}}
: Unknown parameter|coauthors=
ignored (|author=
suggested) (help) - Bartlett, Neil (2009-01-10), OSGi In Practice (PDF) (DRAFT ed.), p. 229
- McAffer, Jeff; Vanderlei, Paul; Archer, Simon (September 7, 2009), Equinox and OSGi: The Power Behind Eclipse (1st ed.), Addison-Wesley Professional, p. 480, ISBN 0321585712
- Mak, Gary (2009), Pro SpringSource dm Server, Apress, p. 250, ISBN 1430216409
- Rubio, Daniel (2009-02-12), Pro Spring Dynamic Modules for OSGi Service Platforms (First ed.), Apress, p. 392, ISBN 1430216123
- The OSGi Alliance (2003), OSGi Service Platform, Release 3, IOS Press, p. 604, ISBN 1586033115
- OSGi Service Platform, Core Specification, Release 4, Version 4.1, OSGi Alliance., 2007, p. 228, ISBN 9789079350018
- OSGi Service Platform, Service Compendium, Release 4, Version 4.1, OSGi Alliance., 2007, p. 594, ISBN 9789079350025
- OSGi Service Platform, Mobile Specification, Release 4, Version 4, OSGi Alliance., 2007, p. 426, ISBN 9789079350032
- Kirk Chen, Li Gong. (2001), Programming Open Service Gateways with Java Embedded Server(TM) Technology, Prentice Hall PTR, p. 480, ISBN 0201711028
Webinar
- OSGi Best Practices by OSGi Fellows Hargrave and Kriens at JavaOne 2007
- Transactions and Clustering with OSGi with Apache ServiceMix PMC Chair Guillaume Nodet
- Converting (Large) Applications to OSGi by Peter Kriens and BJ Hargrave at JavaOne 2008
- OSGi, the good the bad the ugly
See also
External links
- OSGi Technology
- OSGi web site
- OSGi Alliance Developer Site
- OSGi Open Forum and Discussion Central
- The Eclipse 3.0 platform: Adopting OSGi technology
- ApacheCon EU 2006 presentation about OSGi best practices by Marcel Offermans.
- Nuxeo Runtime Documentation -- Nuxeo, open source Enterprise Content Management (ECM) solution built on OSGi technology
- Interview with Kriens and Hargrave (Podcast)
- An Introduction to OSGi on the Server Side by Daniel Rubio
- SOA World Article:What's happening with OSGi and why you should care by David Chappell and Khanderao Kand
- Makewave.com OSGi middleware technology company