OSGi Technology
2
Outline
• What is OSGi Technology
• Introduction
– Alliance
– Specifications
– Key Benefits
– OSGi Terminology
• OSGi Framework
• Service & Bundle
• Use Cases
• OSGi Implementation
3
What is OSGi Technology
• It’s a module system for the Java platform
• It’s dynamic
• It’s service-oriented
• A specification of the OSGi Alliance, a non-
profit organization
4
Outline
• What is OSGi Technology
• Introduction
– Alliance
– Specifications
– Key Benefits
– OSGi Terminology
• OSGi Framework
• Service & Bundle
• Use Cases
• OSGi Implementation
5
Alliance
• “Open Service Gateway Institute”
• The Alliance has been founded by Sun
Microsystems, IBM, Ericsson and others in
March 1999.
• Among its members are (as of 2008) more
than 35 companies from quite different
business areas, for example Hitachi, Mitsubishi
Electric Corporation, Motorola, NEC, Nokia,
Oracle, ProSyst Software, Red Hat, Siemens
Enterprise Communications, Software AG,
SpringSource…
6
Specifications
• 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
7
Specifications
• OSGi framework
• Standard service definitions
– Log Service
– Http Service
– Device Service
– Package Administration Service
– Permission Administration Service
– Configuration Administration Service
– Preferences Service
– User Administration Service
8
Specifications
Key Benefits
• Platform Independence
• Application Independence
• Multiple Service Support
• Service Collaboration Support
• Multiple Network Technology Support
• Security
• Simplicity
14
Key Benefits
• Avoids Java Archive (JAR) file hell
• Reuse code "out of the box"
• Simplifies multi-team projects
• Enables smaller systems
• Manages deployments local or remotely
• Extensive tool support
• No lock in, many providers of core technology
including many open source
• Very high adoption rate
15
OSGi Terminology
• Services gateway
• Framework
• Service
• Bundle
16
Outline
• What is OSGi Technology
• Introduction
– Alliance
– Specifications
– Key Benefits
– OSGi Terminology
• OSGi Framework
• Service & Bundle
• Use Cases
• OSGi Implementation
17
OSGi Framework
• Services gateway
• Generic application framework
• Lightweight framework
– Simple component model
– Service registry
– Support for deployment
18
OSGi Framework
20
OSGi Framework
• The Framework is divided in a number of
layers: Execution Environment, Modules, Life
Cycle Management and Service Registry.
Additionally, there is a security system that is
deeply intertwined with all the layers.
23
OSGi Framework
24
Outline
• What is OSGi Technology
• Introduction
– Alliance
– Specifications
– Key Benefits
– OSGi Terminology
• OSGi Framework
• Service & Bundle
• Use Cases
• OSGi Implementation
25
Service & Bundle
• Services
– Provide applications
• Bundles (JAR file)
– Provide (export) and reuse (import) services via
the framework
– Identify Java packages (classes)
– Implement specified interface (services)
– Register services with the Service Registry
26
Bundle Life Cycle
27
28
29
30
Outline
• What is OSGi Technology
• Introduction
– Alliance
– Specifications
– Key Benefits
– OSGi Terminology
• OSGi Framework
• Service & Bundle
• Use Cases
• OSGi Implementation
31
Typical Use Cases
• Internet Access
• Personal Communications
• Home Automation
• Home Security
• Home Health Care Monitoring
• Entertainment
• Information management
• Telematics (Automotive)
32
Typical Use Cases
33
Typical Use Cases
35
Outline
• What is OSGi Technology
• Introduction
– Alliance
– Specifications
– Key Benefits
– OSGi Terminology
• OSGi Framework
• Service & Bundle
• Use Cases
• OSGi Implementation
36
Framework Implementation
• IBM Lotus Expeditor
• ProSyst Software
• Knopflerfish OSGi
– Makewave (formerly Gatespace Telematics)
• Equinox OSGi (Eclipse project)
• Objectweb Oscar
– Apache Felix
Knopflerfish Installation (1)
• Software Environment
– JRE 1.6.0_10
– Window XP
• Download jar file
– http://www.knopflerfish.org/download.html
– Current release OSGi R4 - Knopflerfish 2.0.5
– Download knopflerfish_osgi_<version>.jar
Knopflerfish Installation (2)
• Execute knopflerfish_osgi_<version>.jar
– double-clicking on the distribution file
– or by the command: java -jar knopflerfish_osgi_<version>.jar
Startup Knopflerfish
• Change the directory to the installation directory and start Knopflerfish
– double-clicking on framework.jar
– or by the command: java -jar framework.jar
Eclipse – Develop OSGi Bundle
• Software Environment
– Eclipse 3.1-3.4
http://www.eclipse.org/downloads
– Knopflerfish plug-in for Eclipse
http://www.knopflerfish.org/eclipse_plugin.html
• Programming Tutorial
– Knopflerfish tutorial
http://www.knopflerfish.org/tutorials.html
– Oscar Tutorial
http://oscar-osgi.sourceforge.net/tutorial/

Os gi l

  • 1.
  • 2.
    2 Outline • What isOSGi Technology • Introduction – Alliance – Specifications – Key Benefits – OSGi Terminology • OSGi Framework • Service & Bundle • Use Cases • OSGi Implementation
  • 3.
    3 What is OSGiTechnology • It’s a module system for the Java platform • It’s dynamic • It’s service-oriented • A specification of the OSGi Alliance, a non- profit organization
  • 4.
    4 Outline • What isOSGi Technology • Introduction – Alliance – Specifications – Key Benefits – OSGi Terminology • OSGi Framework • Service & Bundle • Use Cases • OSGi Implementation
  • 5.
    5 Alliance • “Open ServiceGateway Institute” • The Alliance has been founded by Sun Microsystems, IBM, Ericsson and others in March 1999. • Among its members are (as of 2008) more than 35 companies from quite different business areas, for example Hitachi, Mitsubishi Electric Corporation, Motorola, NEC, Nokia, Oracle, ProSyst Software, Red Hat, Siemens Enterprise Communications, Software AG, SpringSource…
  • 6.
    6 Specifications • OSGi Release1 (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
  • 7.
    7 Specifications • OSGi framework •Standard service definitions – Log Service – Http Service – Device Service – Package Administration Service – Permission Administration Service – Configuration Administration Service – Preferences Service – User Administration Service
  • 8.
  • 9.
    Key Benefits • PlatformIndependence • Application Independence • Multiple Service Support • Service Collaboration Support • Multiple Network Technology Support • Security • Simplicity
  • 10.
    14 Key Benefits • AvoidsJava Archive (JAR) file hell • Reuse code "out of the box" • Simplifies multi-team projects • Enables smaller systems • Manages deployments local or remotely • Extensive tool support • No lock in, many providers of core technology including many open source • Very high adoption rate
  • 11.
    15 OSGi Terminology • Servicesgateway • Framework • Service • Bundle
  • 12.
    16 Outline • What isOSGi Technology • Introduction – Alliance – Specifications – Key Benefits – OSGi Terminology • OSGi Framework • Service & Bundle • Use Cases • OSGi Implementation
  • 13.
    17 OSGi Framework • Servicesgateway • Generic application framework • Lightweight framework – Simple component model – Service registry – Support for deployment
  • 14.
  • 15.
    20 OSGi Framework • TheFramework is divided in a number of layers: Execution Environment, Modules, Life Cycle Management and Service Registry. Additionally, there is a security system that is deeply intertwined with all the layers.
  • 16.
  • 17.
    24 Outline • What isOSGi Technology • Introduction – Alliance – Specifications – Key Benefits – OSGi Terminology • OSGi Framework • Service & Bundle • Use Cases • OSGi Implementation
  • 18.
    25 Service & Bundle •Services – Provide applications • Bundles (JAR file) – Provide (export) and reuse (import) services via the framework – Identify Java packages (classes) – Implement specified interface (services) – Register services with the Service Registry
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
    30 Outline • What isOSGi Technology • Introduction – Alliance – Specifications – Key Benefits – OSGi Terminology • OSGi Framework • Service & Bundle • Use Cases • OSGi Implementation
  • 24.
    31 Typical Use Cases •Internet Access • Personal Communications • Home Automation • Home Security • Home Health Care Monitoring • Entertainment • Information management • Telematics (Automotive)
  • 25.
  • 26.
  • 27.
    35 Outline • What isOSGi Technology • Introduction – Alliance – Specifications – Key Benefits – OSGi Terminology • OSGi Framework • Service & Bundle • Use Cases • OSGi Implementation
  • 28.
    36 Framework Implementation • IBMLotus Expeditor • ProSyst Software • Knopflerfish OSGi – Makewave (formerly Gatespace Telematics) • Equinox OSGi (Eclipse project) • Objectweb Oscar – Apache Felix
  • 29.
    Knopflerfish Installation (1) •Software Environment – JRE 1.6.0_10 – Window XP • Download jar file – http://www.knopflerfish.org/download.html – Current release OSGi R4 - Knopflerfish 2.0.5 – Download knopflerfish_osgi_<version>.jar
  • 30.
    Knopflerfish Installation (2) •Execute knopflerfish_osgi_<version>.jar – double-clicking on the distribution file – or by the command: java -jar knopflerfish_osgi_<version>.jar
  • 31.
    Startup Knopflerfish • Changethe directory to the installation directory and start Knopflerfish – double-clicking on framework.jar – or by the command: java -jar framework.jar
  • 32.
    Eclipse – DevelopOSGi Bundle • Software Environment – Eclipse 3.1-3.4 http://www.eclipse.org/downloads – Knopflerfish plug-in for Eclipse http://www.knopflerfish.org/eclipse_plugin.html • Programming Tutorial – Knopflerfish tutorial http://www.knopflerfish.org/tutorials.html – Oscar Tutorial http://oscar-osgi.sourceforge.net/tutorial/