SlideShare une entreprise Scribd logo
1  sur  53
OSGi platform

Yuriy Shapovalov
EPAM Systems
What is it?
“The Open Services Gateway initiative framework is a
module system and service platform for the Java programming
language that implements a complete and dynamic component model,
something that as of 2012 does not exist in standalone Java/VM
environments.” – Wikipedia

OSGi Platform
… module system …
“The Open Services Gateway initiative framework is a
module system and service platform for the Java programming
language that implements a complete and dynamic component model,
something that as of 2012 does not exist in standalone Java/VM
environments.” – Wikipedia

OSGi Platform
… service platform …
“The Open Services Gateway initiative framework is a
module system and service platform for the Java programming
language that implements a complete and dynamic component model,
something that as of 2012 does not exist in standalone Java/VM
environments.” – Wikipedia

OSGi Platform
… for Java programming language …
“The Open Services Gateway initiative framework is a
module system and service platform for the Java programming
language that implements a complete and dynamic component model,
something that as of 2012 does not exist in standalone Java/VM
environments.” – Wikipedia

OSGi Platform
…complete and dynamic component model …
“The Open Services Gateway initiative framework is a
module system and service platform for the Java programming
language that implements a complete and dynamic component
model, something that as of 2012 does not exist in standalone
Java/VM environments.” – Wikipedia

OSGi Platform
… does not exist in standalone Java/VM …
“The Open Services Gateway initiative framework is a
module system and service platform for the Java programming
language that implements a complete and dynamic component
model, something that as of 2012 does not exist in standalone
Java/VM environments.” – Wikipedia

OSGi Platform
OSGi history
o Initially was developed as an embedded platform for the “home
gateway”;
o and make it easier to deploy Java application on embedded devices

o OSGi Alliance was formed in 1999, and it has following mission:
• Maintaining and publishing OSGi specification
• Certifying implementations
• Organizing events.
o Specification target was: “Define Java-based service platform, full
dynamic component model”
• Because JVM does not support natively dynamic module system
– starting, stopping, updating application at runtime
• JAR dependencies management missing

OSGi Platform

8/42
The Dream
o Adaptive
B

C

D

E

F

G

H

I

o Flexible

o Contracts
o Robust
o Secure
o Evolution
o Distributed

OSGi Platform

9/42
The Dream
 Adaptive
o Flexible

A

B

C

D

E

F

G

H

I

o Contracts
o Robust
o Secure
o Evolution
o Distributed

OSGi Platform

10/42
The Dream
 Adaptive
o Flexible

A

B

C

D

E

F

G

H

I

o Contracts
o Robust
o Secure
o Evolution
o Distributed

OSGi Platform

11/42
The Dream
 Adaptive
 Flexible

A

Ba

Bb

C

o Contracts
o Robust

D

E

F

G

H

I

o Secure
o Evolution
o Distributed

OSGi Platform

12/42
The Dream
 Adaptive
 Flexible

A

Ba

Bb

C

o Contracts
o Robust

D

E

F

G

H

I

o Secure
o Evolution
o Distributed

OSGi Platform

13/42
The Dream
 Adaptive
 Flexible

A

Ba

Bb

C

 Contracts
o Robust

D

E

F

G

H

I

o Secure
o Evolution
o Distributed

OSGi Platform

14/42
The Dream
 Adaptive
 Flexible

A

Ba

Bb

C

 Contracts
o Robust

D

E

F

G

H

I

o Secure
o Evolution
o Distributed

OSGi Platform

15/42
The Dream
 Adaptive
 Flexible

A

Ba

Bb

C

 Contracts
 Robust

D

E

G

F

H

o Secure
o Evolution
o Distributed

OSGi Platform

16/42
The Dream
 Adaptive
 Flexible

A

Ba

Bb

C

 Contracts
 Robust

D

E

G

F

H

o Secure
o Evolution
o Distributed

OSGi Platform

17/42
The Dream
 Adaptive
 Flexible

A

Ba

Bb

C

 Contracts
 Robust

D

E

G

F

H

 Secure
o Evolution
o Distributed

OSGi Platform

18/42
The Dream
 Adaptive
 Flexible

A

Ba

Bb

C

 Contracts
 Robust

D

E

G

F

H

 Secure
o Evolution
o Distributed

OSGi Platform

19/42
The Dream
 Adaptive
 Flexible

A

Ba

Bb

C

 Contracts
 Robust

D

E

F

G

H

I v2.0

 Secure
o Evolution
o Distributed

OSGi Platform

20/42
The Dream
 Adaptive
 Flexible

A

Ba

Bb

C

 Contracts
 Robust

D

E

F

G

H

I v2.0

 Secure
 Evolution
o Distributed

OSGi Platform

21/42
The Dream
 Adaptive
 Flexible

A

Ba

Bb

C

 Contracts
 Robust

D

E

F

G

H

I v2.0

 Secure
 Evolution
o Distributed

OSGi Platform

22/42
The Dream
 Adaptive
 Flexible

A

Ba

Bb

 Contracts
 Robust

D

E

F

 Secure
 Evolution
 Distributed

G

OSGi Platform

I v2.0

23/42
What is an OSGi application

o Collection of bundles integrated via Service interfaces
o Bundles may be independently developed and deployed
o Bundles and their associated services may appear or
disappear at any time

o Resulting application follows a Service-Oriented
Component Model approach
o Combines Ideas from both component and service orientation

OSGi Platform

24/42
Architecture abstraction
o Application is a set of independent components,
collaborating between each other in a service orienting
way.
Application

A

C

D

B

E

OSGi Platform

F

25/42
Architecture abstraction
o Application implement reduced functionality, all
additional features implements as plug-ins

C

A

Application

B

D

E

OSGi Platform

F

26/42
Architecture abstraction
o or even…

Application

A

B

A

C

B

D

E

OSGi Platform

D

E

27/42
Next level of modularity

Subroutines

(50’s)

×
×
×
×

Focus on “what”, not “how”
Encapsulate the implementation details
Formalize the input data (arguments)
Formalize the output data (return values)
OSGi Platform

28/42
Next level of modularity
Input (arguments)

function

Output (return)

Then systems grew…

Functions

Subroutines

(50’s)

Spaghetti Code
OSGi Platform

29/42
Next level of modularity
Imported Functions

Module

Exported Functions

Then systems grew…

Modules

(70’s)

Functions

Subroutines

(50’s)

Sharing Proved Hard
OSGi Platform

30/42
Next level of modularity
Imported Members

Type

Exported Members

Then systems grew…

Classes/Objects (80’s)
Modules

(70’s)

Functions

Subroutines

(50’s)
OSGi Platform

31/42
Next level of modularity
Imported Types

Packages

(90’s)

Type

Exported Types

Then and multiplies
…… systems grew…
and distributed

Classes/Objects (80’s)
Modules

(70’s)

Functions

Subroutines

(50’s)
OSGi Platform

32/42
Next level of modularity
Small Java App …

OSGi Platform

33/42
Next level of modularity
Bundles
Packages

(00’s)

(90’s)

Classes/Objects (80’s)
Modules

Imported Packages

Bundle
(JAR file)

Exported Packages

(70’s)

Functions

Subroutines

(50’s)
OSGi Platform

34/42
Bundle
o A Bundle - is a module in OSGi terminology
o What is a bundle?
• Simply a JAR file plus module metadata
• Modules metadata is stored in META-INF/MANIFEST.MF
• Define what the module provides and require

o What does a bundle JAR contain?
• Java classes (i.e., standard JAR file content)
• Resources (e.g., configuration files, images, etc.)
• Native code
• Embedded JAR files
• Bundles have their own class path
OSGi Platform

35/42
OSGi architecture
Application composite
(Bundles)

OSGi Layer

Service

Bundle
Bundle

Bundle

Life Cycle

Bundle

Bundle

Module

Bundle

Bundle

Security
Java VM

OS / Hardware
OSGi Platform

36/42
Life cycle of bundles

INSTALLED

STARTING

RESOLVED

ACTIVE

UNINSTALLED

STOPPING

OSGi Platform

37/42
Services System
o Services are simple POJOs with a published service interface
o Coupling to the framework is isolated to the Activator and
collaborators
o Services may bind to other services through their published
interfaces
o The framework provides a standard Service Factory mechanism

track
publish

Bundle A

Bundle B

Service Registry
track
publish

Bundle C

Service
OSGi Platform

38/42
OSGi Bundle Manifest
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.foo.simplebundle
Bundle-Version: 1.0.0
Bundle-Activator: org.foo.Activator
Bundle-ClassPath: .,org/foo/embedded.jar
Bundle-NativeCode: libfoo.so; osname=Linux; processor=x86,
foo.dll; osname=Windows 7; processor=x86
Import-Package:o sgi.service.log; version="[1.0.0,1.1.0)";
resolution:="optional"
Export-Package: org.foo.service; version=1.1; vendor="org.foo:";
exclude:="*Impl", org.foo.service.bar; version=1.1; uses:="org.foo.service"

OSGi Platform

39/42
OSGi Bundle Manifest
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.foo.simplebundle
Bundle-Version: 1.0.0

Indicates semantic
Bundle-Activator: org.foo.Activator and syntax
Bundle-ClassPath: .,org/foo/embedded.jar
Bundle-NativeCode: libfoo.so; osname=Linux; processor=x86,
foo.dll; osname=Windows 7; processor=x86
Import-Package:o sgi.service.log; version="[1.0.0,1.1.0)";
resolution:="optional"
Export-Package: org.foo.service; version=1.1; vendor="org.foo:";
exclude:="*Impl", org.foo.service.bar; version=1.1; uses:="org.foo.service"

OSGi Platform

40/42
OSGi Bundle Manifest
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.foo.simplebundle
Bundle-Version: 1.0.0
Bundle-Activator: org.foo.Activator
Indicates semantic
Globally unique ID
and syntax
Bundle-ClassPath: .,org/foo/embedded.jar
Bundle-NativeCode: libfoo.so; osname=Linux; processor=x86,
foo.dll; osname=Windows 7; processor=x86
Import-Package:o sgi.service.log; version="[1.0.0,1.1.0)";
resolution:="optional"
Export-Package: org.foo.service; version=1.1; vendor="org.foo:";
exclude:="*Impl", org.foo.service.bar; version=1.1; uses:="org.foo.service"

OSGi Platform

41/42
OSGi Bundle Manifest
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.foo.simplebundle
Bundle-Version: 1.0.0
Bundle-Activator: org.foo.Activator
Bundle-ClassPath: .,org/foo/embedded.jar
Bundle-NativeCode: libfoo.so; osname=Linux; processor=x86,
Life cycle entry
foo.dll; osname=Windows 7; processor=x86
point
Import-Package:o sgi.service.log; version="[1.0.0,1.1.0)";
resolution:="optional"
Export-Package: org.foo.service; version=1.1; vendor="org.foo:";
exclude:="*Impl", org.foo.service.bar; version=1.1; uses:="org.foo.service"

OSGi Platform

42/42
OSGi Bundle Manifest
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.foo.simplebundle
Bundle-Version: 1.0.0
Bundle-Activator: org.foo.Activator
Bundle-ClassPath: .,org/foo/embedded.jar
Bundle-NativeCode: libfoo.so; osname=Linux; processor=x86,
foo.dll; osname=Windows 7; processor=x86
Internal bundle
Import-Package:o sgi.service.log; version="[1.0.0,1.1.0)";
class path
resolution:="optional"
Export-Package: org.foo.service; version=1.1; vendor="org.foo:";
exclude:="*Impl", org.foo.service.bar; version=1.1; uses:="org.foo.service"

OSGi Platform

43/42
OSGi Bundle Manifest
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.foo.simplebundle
Bundle-Version: 1.0.0

Native code
Bundle-Activator: org.foo.Activator dependencies
Bundle-ClassPath: .,org/foo/embedded.jar
Bundle-NativeCode: libfoo.so; osname=Linux; processor=x86,
foo.dll; osname=Windows 7; processor=x86
Import-Package:o sgi.service.log; version="[1.0.0,1.1.0)";
resolution:="optional"
Export-Package: org.foo.service; version=1.1; vendor="org.foo:";
exclude:="*Impl", org.foo.service.bar; version=1.1; uses:="org.foo.service"

OSGi Platform

44/42
OSGi Bundle Manifest
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.foo.simplebundle
Bundle-Version: 1.0.0
Bundle-Activator: org.foo.Activator
Optional
Bundle-ClassPath: .,org/foo/embedded.jar
dependency on a
package version
Bundle-NativeCode: libfoo.so; osname=Linux; processor=x86,
range
foo.dll; osname=Windows 7; processor=x86
Import-Package: osgi.service.log; version="[1.0.0,1.1.0)";
resolution:="optional"
Export-Package: org.foo.service; version=1.1; vendor="org.foo:";
exclude:="*Impl", org.foo.service.bar; version=1.1; uses:="org.foo.service"

OSGi Platform

45/42
OSGi Bundle Manifest
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.foo.simplebundle
Bundle-Version: 1.0.0
Bundle-Activator: org.foo.Activator
Bundle-ClassPath: .,org/foo/embedded.jar
Provided package with
Bundle-NativeCode: libfoo.so; osname=Linux; processor=x86,
foo.dll; osname=Windows 7;arbitrary attribute and
processor=x86
excluded classes
Import-Package:o sgi.service.log; version="[1.0.0,1.1.0)";
resolution:="optional"
Export-Package: org.foo.service; version=1.1; vendor="org.foo:";
exclude:="*Impl", org.foo.service.bar; version=1.1; uses:="org.foo.service"

OSGi Platform

46/42
OSGi Bundle Manifest
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.foo.simplebundle
Bundle-Version: 1.0.0
Bundle-Activator: org.foo.Activator
Bundle-ClassPath: .,org/foo/embedded.jar
Bundle-NativeCode: libfoo.so; osname=Linux; processor=x86,
Provided package with
foo.dll; osname=Windows 7; processor=x86
dependency on
Import-Package:o sgi.service.log; exported package
version="[1.0.0,1.1.0)";
resolution:="optional"
Export-Package: org.foo.service; version=1.1; vendor="org.foo:";
exclude:="*Impl", org.foo.service.bar; version=1.1; uses:="org.foo.service"

OSGi Platform

47/42
Declarative Services
o Declarative services provides a minimally intrusive way to:
• Define components that provide and use services
• Automate dependency resolution and maintenance
package foo.impl;
public class HelloImpl implements foo.HelloService {
LogService log;
protected void setLog(LogService l) {
log = l;
}
protected void unsetLog(LogService l) {
log = null;
}
public void sayHello(String s) {
log.log(LogService.LOG_INFO, "Hello " + s);
}
}
OSGi Platform

48/42
Declarative Services
o Declarative services component metadata:
<?xml version="1.0" encoding="UTF-8"?>
<component name="example.hello">
<implementation class="foo.impl.HelloImpl"/>
<service>
<provide interface="foo.HelloService"/>
</service>
<reference name="LOG"
interface="org.osgi.service.log.LogService"
bind="setLog"
unbind="unsetLog"
/>
</component>

OSGi Platform

49/42
OSGi implementations

o Specification it is good, but without implementation it
is a dead stuff
o The most popular open source implementation is:
• Equinox

• Apache Felix

• Knopflerfish
OSGi Platform

50/42
OSGi in Enterprise (as example)
o Why?
• Create modular and reusable software
• Create evolvable software
• Create line of products

o What?
•
•
•
•
•
•

Desktop Applications
Web Applications
Service Layers
Content Management Systems
Embedded and Mobile Applications
Cloud Applications
OSGi Platform

51/42
Conclusions
o Java needs improved modularity support
• Lagging behind .NET in this area for years
• The OSGi framework provides it now

o Importance and relevance of OSGi is growing
• Industry support for mobile applications
• Significant uptake in the enterprise space

OSGi Platform

52/42
Questions?

OSGi Platform

53/42

Contenu connexe

Tendances

HowTo Build an OSGI EJB3 Server
HowTo Build an OSGI EJB3 ServerHowTo Build an OSGI EJB3 Server
HowTo Build an OSGI EJB3 Serverekkehard gentz
 
Liferay DevCon 2014: Lliferay Platform - A new and exciting vision
Liferay DevCon 2014: Lliferay Platform - A new and exciting visionLiferay DevCon 2014: Lliferay Platform - A new and exciting vision
Liferay DevCon 2014: Lliferay Platform - A new and exciting visionJorge Ferrer
 
Creating Better Customer and Employee Experiences with Liferay Portal and Cra...
Creating Better Customer and Employee Experiences with Liferay Portal and Cra...Creating Better Customer and Employee Experiences with Liferay Portal and Cra...
Creating Better Customer and Employee Experiences with Liferay Portal and Cra...Crafter Software
 
Liferay portal – moving beyond content management
Liferay portal – moving beyond content managementLiferay portal – moving beyond content management
Liferay portal – moving beyond content managementAmbientia
 
Liferay Italy Symposium 2015 Liferay Mobile SDK and Liferay Screens
Liferay Italy Symposium 2015 Liferay Mobile SDK and Liferay ScreensLiferay Italy Symposium 2015 Liferay Mobile SDK and Liferay Screens
Liferay Italy Symposium 2015 Liferay Mobile SDK and Liferay ScreensDenis Signoretto
 
2014 Liferay Roadshow Ambientia Finland
2014  Liferay Roadshow Ambientia Finland2014  Liferay Roadshow Ambientia Finland
2014 Liferay Roadshow Ambientia FinlandRuud Kluivers
 
Liferay Developer Best Practices for a Successful Deployment
Liferay Developer Best Practices for a Successful DeploymentLiferay Developer Best Practices for a Successful Deployment
Liferay Developer Best Practices for a Successful Deploymentrivetlogic
 
2000: Making IT Happen with J2EE
2000: Making IT Happen with J2EE2000: Making IT Happen with J2EE
2000: Making IT Happen with J2EERussell Castagnaro
 
Moved to https://slidr.io/azzazzel/what-s-not-new-in-modular-java
Moved to https://slidr.io/azzazzel/what-s-not-new-in-modular-javaMoved to https://slidr.io/azzazzel/what-s-not-new-in-modular-java
Moved to https://slidr.io/azzazzel/what-s-not-new-in-modular-javaMilen Dyankov
 
Liferay Configuration and Customization
Liferay Configuration and CustomizationLiferay Configuration and Customization
Liferay Configuration and CustomizationThành Nguyễn
 
2013.devcon3 liferay and google authenticator integration rafik_harabi
2013.devcon3 liferay and google authenticator integration rafik_harabi2013.devcon3 liferay and google authenticator integration rafik_harabi
2013.devcon3 liferay and google authenticator integration rafik_harabiRafik HARABI
 
OSGi on Google Android using Apache Felix
OSGi on Google Android using Apache FelixOSGi on Google Android using Apache Felix
OSGi on Google Android using Apache FelixMarcel Offermans
 
Mavenizing your Liferay project
Mavenizing your Liferay projectMavenizing your Liferay project
Mavenizing your Liferay projectmimacom
 
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...Nuxeo
 

Tendances (20)

Liferay 7
Liferay 7Liferay 7
Liferay 7
 
Making a decision between Liferay and Drupal
Making a decision between Liferay and DrupalMaking a decision between Liferay and Drupal
Making a decision between Liferay and Drupal
 
HowTo Build an OSGI EJB3 Server
HowTo Build an OSGI EJB3 ServerHowTo Build an OSGI EJB3 Server
HowTo Build an OSGI EJB3 Server
 
Liferay DevCon 2014: Lliferay Platform - A new and exciting vision
Liferay DevCon 2014: Lliferay Platform - A new and exciting visionLiferay DevCon 2014: Lliferay Platform - A new and exciting vision
Liferay DevCon 2014: Lliferay Platform - A new and exciting vision
 
Creating Better Customer and Employee Experiences with Liferay Portal and Cra...
Creating Better Customer and Employee Experiences with Liferay Portal and Cra...Creating Better Customer and Employee Experiences with Liferay Portal and Cra...
Creating Better Customer and Employee Experiences with Liferay Portal and Cra...
 
Liferay with xebia
Liferay with xebiaLiferay with xebia
Liferay with xebia
 
Liferay portal – moving beyond content management
Liferay portal – moving beyond content managementLiferay portal – moving beyond content management
Liferay portal – moving beyond content management
 
Liferay Italy Symposium 2015 Liferay Mobile SDK and Liferay Screens
Liferay Italy Symposium 2015 Liferay Mobile SDK and Liferay ScreensLiferay Italy Symposium 2015 Liferay Mobile SDK and Liferay Screens
Liferay Italy Symposium 2015 Liferay Mobile SDK and Liferay Screens
 
2014 Liferay Roadshow Ambientia Finland
2014  Liferay Roadshow Ambientia Finland2014  Liferay Roadshow Ambientia Finland
2014 Liferay Roadshow Ambientia Finland
 
Liferay Developer Best Practices for a Successful Deployment
Liferay Developer Best Practices for a Successful DeploymentLiferay Developer Best Practices for a Successful Deployment
Liferay Developer Best Practices for a Successful Deployment
 
2000: Making IT Happen with J2EE
2000: Making IT Happen with J2EE2000: Making IT Happen with J2EE
2000: Making IT Happen with J2EE
 
Moved to https://slidr.io/azzazzel/what-s-not-new-in-modular-java
Moved to https://slidr.io/azzazzel/what-s-not-new-in-modular-javaMoved to https://slidr.io/azzazzel/what-s-not-new-in-modular-java
Moved to https://slidr.io/azzazzel/what-s-not-new-in-modular-java
 
Liferay Configuration and Customization
Liferay Configuration and CustomizationLiferay Configuration and Customization
Liferay Configuration and Customization
 
2013.devcon3 liferay and google authenticator integration rafik_harabi
2013.devcon3 liferay and google authenticator integration rafik_harabi2013.devcon3 liferay and google authenticator integration rafik_harabi
2013.devcon3 liferay and google authenticator integration rafik_harabi
 
Liferay on docker
Liferay on dockerLiferay on docker
Liferay on docker
 
OSGi on Google Android using Apache Felix
OSGi on Google Android using Apache FelixOSGi on Google Android using Apache Felix
OSGi on Google Android using Apache Felix
 
Mavenizing your Liferay project
Mavenizing your Liferay projectMavenizing your Liferay project
Mavenizing your Liferay project
 
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
Creating Large Scale Software Platforms with OSGi and an Extension Point Mode...
 
Pro syst about us
Pro syst   about usPro syst   about us
Pro syst about us
 
Beyond OSGi Software Architecture
Beyond OSGi Software ArchitectureBeyond OSGi Software Architecture
Beyond OSGi Software Architecture
 

Similaire à Osgi platform

OSGi user forum dc metro v1
OSGi user forum dc metro v1OSGi user forum dc metro v1
OSGi user forum dc metro v1pjhInovex
 
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...OpenBlend society
 
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...IndicThreads
 
Enabling modularization through OSGi and SpringDM
Enabling modularization through OSGi and SpringDMEnabling modularization through OSGi and SpringDM
Enabling modularization through OSGi and SpringDMmukulobject
 
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application DevelopmentOSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application DevelopmentSanjeeb Sahoo
 
Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)Martin Toshev
 
What is os gi and what does osgi
What is os gi and what does osgiWhat is os gi and what does osgi
What is os gi and what does osgiYunChang Lee
 
Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in PractiseDavid Bosschaert
 
Part 8 - Enforcing modularity of JasForge using OSGI and Futures Evolutions
Part 8 - Enforcing modularity of JasForge using OSGI and Futures EvolutionsPart 8 - Enforcing modularity of JasForge using OSGI and Futures Evolutions
Part 8 - Enforcing modularity of JasForge using OSGI and Futures EvolutionsJasmine Conseil
 
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Martin Toshev
 
Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...
Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...
Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...mfrancis
 
OSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 IndiaOSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 IndiaArun Gupta
 
OSGi DevCon 2009 Review
OSGi DevCon 2009 ReviewOSGi DevCon 2009 Review
OSGi DevCon 2009 Reviewnjbartlett
 
Java Modularity with OSGi
Java Modularity with OSGiJava Modularity with OSGi
Java Modularity with OSGiIlya Rybak
 

Similaire à Osgi platform (20)

OSGi user forum dc metro v1
OSGi user forum dc metro v1OSGi user forum dc metro v1
OSGi user forum dc metro v1
 
OSGi
OSGiOSGi
OSGi
 
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
 
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
 
Enabling modularization through OSGi and SpringDM
Enabling modularization through OSGi and SpringDMEnabling modularization through OSGi and SpringDM
Enabling modularization through OSGi and SpringDM
 
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application DevelopmentOSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
 
Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)
 
What is os gi and what does osgi
What is os gi and what does osgiWhat is os gi and what does osgi
What is os gi and what does osgi
 
Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in Practise
 
Part 8 - Enforcing modularity of JasForge using OSGI and Futures Evolutions
Part 8 - Enforcing modularity of JasForge using OSGI and Futures EvolutionsPart 8 - Enforcing modularity of JasForge using OSGI and Futures Evolutions
Part 8 - Enforcing modularity of JasForge using OSGI and Futures Evolutions
 
Modular Java
Modular JavaModular Java
Modular Java
 
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
 
Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...
Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...
Technical Specification Overview - OSGi World Congress 2002 Workshop Intro - ...
 
OSGi
OSGiOSGi
OSGi
 
OSGi tech session
OSGi tech sessionOSGi tech session
OSGi tech session
 
OSGi & Blueprint
OSGi & BlueprintOSGi & Blueprint
OSGi & Blueprint
 
OSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 IndiaOSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 India
 
GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010
 
OSGi DevCon 2009 Review
OSGi DevCon 2009 ReviewOSGi DevCon 2009 Review
OSGi DevCon 2009 Review
 
Java Modularity with OSGi
Java Modularity with OSGiJava Modularity with OSGi
Java Modularity with OSGi
 

Dernier

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Dernier (20)

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

Osgi platform

  • 2. What is it? “The Open Services Gateway initiative framework is a module system and service platform for the Java programming language that implements a complete and dynamic component model, something that as of 2012 does not exist in standalone Java/VM environments.” – Wikipedia OSGi Platform
  • 3. … module system … “The Open Services Gateway initiative framework is a module system and service platform for the Java programming language that implements a complete and dynamic component model, something that as of 2012 does not exist in standalone Java/VM environments.” – Wikipedia OSGi Platform
  • 4. … service platform … “The Open Services Gateway initiative framework is a module system and service platform for the Java programming language that implements a complete and dynamic component model, something that as of 2012 does not exist in standalone Java/VM environments.” – Wikipedia OSGi Platform
  • 5. … for Java programming language … “The Open Services Gateway initiative framework is a module system and service platform for the Java programming language that implements a complete and dynamic component model, something that as of 2012 does not exist in standalone Java/VM environments.” – Wikipedia OSGi Platform
  • 6. …complete and dynamic component model … “The Open Services Gateway initiative framework is a module system and service platform for the Java programming language that implements a complete and dynamic component model, something that as of 2012 does not exist in standalone Java/VM environments.” – Wikipedia OSGi Platform
  • 7. … does not exist in standalone Java/VM … “The Open Services Gateway initiative framework is a module system and service platform for the Java programming language that implements a complete and dynamic component model, something that as of 2012 does not exist in standalone Java/VM environments.” – Wikipedia OSGi Platform
  • 8. OSGi history o Initially was developed as an embedded platform for the “home gateway”; o and make it easier to deploy Java application on embedded devices o OSGi Alliance was formed in 1999, and it has following mission: • Maintaining and publishing OSGi specification • Certifying implementations • Organizing events. o Specification target was: “Define Java-based service platform, full dynamic component model” • Because JVM does not support natively dynamic module system – starting, stopping, updating application at runtime • JAR dependencies management missing OSGi Platform 8/42
  • 9. The Dream o Adaptive B C D E F G H I o Flexible o Contracts o Robust o Secure o Evolution o Distributed OSGi Platform 9/42
  • 10. The Dream  Adaptive o Flexible A B C D E F G H I o Contracts o Robust o Secure o Evolution o Distributed OSGi Platform 10/42
  • 11. The Dream  Adaptive o Flexible A B C D E F G H I o Contracts o Robust o Secure o Evolution o Distributed OSGi Platform 11/42
  • 12. The Dream  Adaptive  Flexible A Ba Bb C o Contracts o Robust D E F G H I o Secure o Evolution o Distributed OSGi Platform 12/42
  • 13. The Dream  Adaptive  Flexible A Ba Bb C o Contracts o Robust D E F G H I o Secure o Evolution o Distributed OSGi Platform 13/42
  • 14. The Dream  Adaptive  Flexible A Ba Bb C  Contracts o Robust D E F G H I o Secure o Evolution o Distributed OSGi Platform 14/42
  • 15. The Dream  Adaptive  Flexible A Ba Bb C  Contracts o Robust D E F G H I o Secure o Evolution o Distributed OSGi Platform 15/42
  • 16. The Dream  Adaptive  Flexible A Ba Bb C  Contracts  Robust D E G F H o Secure o Evolution o Distributed OSGi Platform 16/42
  • 17. The Dream  Adaptive  Flexible A Ba Bb C  Contracts  Robust D E G F H o Secure o Evolution o Distributed OSGi Platform 17/42
  • 18. The Dream  Adaptive  Flexible A Ba Bb C  Contracts  Robust D E G F H  Secure o Evolution o Distributed OSGi Platform 18/42
  • 19. The Dream  Adaptive  Flexible A Ba Bb C  Contracts  Robust D E G F H  Secure o Evolution o Distributed OSGi Platform 19/42
  • 20. The Dream  Adaptive  Flexible A Ba Bb C  Contracts  Robust D E F G H I v2.0  Secure o Evolution o Distributed OSGi Platform 20/42
  • 21. The Dream  Adaptive  Flexible A Ba Bb C  Contracts  Robust D E F G H I v2.0  Secure  Evolution o Distributed OSGi Platform 21/42
  • 22. The Dream  Adaptive  Flexible A Ba Bb C  Contracts  Robust D E F G H I v2.0  Secure  Evolution o Distributed OSGi Platform 22/42
  • 23. The Dream  Adaptive  Flexible A Ba Bb  Contracts  Robust D E F  Secure  Evolution  Distributed G OSGi Platform I v2.0 23/42
  • 24. What is an OSGi application o Collection of bundles integrated via Service interfaces o Bundles may be independently developed and deployed o Bundles and their associated services may appear or disappear at any time o Resulting application follows a Service-Oriented Component Model approach o Combines Ideas from both component and service orientation OSGi Platform 24/42
  • 25. Architecture abstraction o Application is a set of independent components, collaborating between each other in a service orienting way. Application A C D B E OSGi Platform F 25/42
  • 26. Architecture abstraction o Application implement reduced functionality, all additional features implements as plug-ins C A Application B D E OSGi Platform F 26/42
  • 27. Architecture abstraction o or even… Application A B A C B D E OSGi Platform D E 27/42
  • 28. Next level of modularity Subroutines (50’s) × × × × Focus on “what”, not “how” Encapsulate the implementation details Formalize the input data (arguments) Formalize the output data (return values) OSGi Platform 28/42
  • 29. Next level of modularity Input (arguments) function Output (return) Then systems grew… Functions Subroutines (50’s) Spaghetti Code OSGi Platform 29/42
  • 30. Next level of modularity Imported Functions Module Exported Functions Then systems grew… Modules (70’s) Functions Subroutines (50’s) Sharing Proved Hard OSGi Platform 30/42
  • 31. Next level of modularity Imported Members Type Exported Members Then systems grew… Classes/Objects (80’s) Modules (70’s) Functions Subroutines (50’s) OSGi Platform 31/42
  • 32. Next level of modularity Imported Types Packages (90’s) Type Exported Types Then and multiplies …… systems grew… and distributed Classes/Objects (80’s) Modules (70’s) Functions Subroutines (50’s) OSGi Platform 32/42
  • 33. Next level of modularity Small Java App … OSGi Platform 33/42
  • 34. Next level of modularity Bundles Packages (00’s) (90’s) Classes/Objects (80’s) Modules Imported Packages Bundle (JAR file) Exported Packages (70’s) Functions Subroutines (50’s) OSGi Platform 34/42
  • 35. Bundle o A Bundle - is a module in OSGi terminology o What is a bundle? • Simply a JAR file plus module metadata • Modules metadata is stored in META-INF/MANIFEST.MF • Define what the module provides and require o What does a bundle JAR contain? • Java classes (i.e., standard JAR file content) • Resources (e.g., configuration files, images, etc.) • Native code • Embedded JAR files • Bundles have their own class path OSGi Platform 35/42
  • 36. OSGi architecture Application composite (Bundles) OSGi Layer Service Bundle Bundle Bundle Life Cycle Bundle Bundle Module Bundle Bundle Security Java VM OS / Hardware OSGi Platform 36/42
  • 37. Life cycle of bundles INSTALLED STARTING RESOLVED ACTIVE UNINSTALLED STOPPING OSGi Platform 37/42
  • 38. Services System o Services are simple POJOs with a published service interface o Coupling to the framework is isolated to the Activator and collaborators o Services may bind to other services through their published interfaces o The framework provides a standard Service Factory mechanism track publish Bundle A Bundle B Service Registry track publish Bundle C Service OSGi Platform 38/42
  • 39. OSGi Bundle Manifest Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.foo.simplebundle Bundle-Version: 1.0.0 Bundle-Activator: org.foo.Activator Bundle-ClassPath: .,org/foo/embedded.jar Bundle-NativeCode: libfoo.so; osname=Linux; processor=x86, foo.dll; osname=Windows 7; processor=x86 Import-Package:o sgi.service.log; version="[1.0.0,1.1.0)"; resolution:="optional" Export-Package: org.foo.service; version=1.1; vendor="org.foo:"; exclude:="*Impl", org.foo.service.bar; version=1.1; uses:="org.foo.service" OSGi Platform 39/42
  • 40. OSGi Bundle Manifest Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.foo.simplebundle Bundle-Version: 1.0.0 Indicates semantic Bundle-Activator: org.foo.Activator and syntax Bundle-ClassPath: .,org/foo/embedded.jar Bundle-NativeCode: libfoo.so; osname=Linux; processor=x86, foo.dll; osname=Windows 7; processor=x86 Import-Package:o sgi.service.log; version="[1.0.0,1.1.0)"; resolution:="optional" Export-Package: org.foo.service; version=1.1; vendor="org.foo:"; exclude:="*Impl", org.foo.service.bar; version=1.1; uses:="org.foo.service" OSGi Platform 40/42
  • 41. OSGi Bundle Manifest Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.foo.simplebundle Bundle-Version: 1.0.0 Bundle-Activator: org.foo.Activator Indicates semantic Globally unique ID and syntax Bundle-ClassPath: .,org/foo/embedded.jar Bundle-NativeCode: libfoo.so; osname=Linux; processor=x86, foo.dll; osname=Windows 7; processor=x86 Import-Package:o sgi.service.log; version="[1.0.0,1.1.0)"; resolution:="optional" Export-Package: org.foo.service; version=1.1; vendor="org.foo:"; exclude:="*Impl", org.foo.service.bar; version=1.1; uses:="org.foo.service" OSGi Platform 41/42
  • 42. OSGi Bundle Manifest Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.foo.simplebundle Bundle-Version: 1.0.0 Bundle-Activator: org.foo.Activator Bundle-ClassPath: .,org/foo/embedded.jar Bundle-NativeCode: libfoo.so; osname=Linux; processor=x86, Life cycle entry foo.dll; osname=Windows 7; processor=x86 point Import-Package:o sgi.service.log; version="[1.0.0,1.1.0)"; resolution:="optional" Export-Package: org.foo.service; version=1.1; vendor="org.foo:"; exclude:="*Impl", org.foo.service.bar; version=1.1; uses:="org.foo.service" OSGi Platform 42/42
  • 43. OSGi Bundle Manifest Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.foo.simplebundle Bundle-Version: 1.0.0 Bundle-Activator: org.foo.Activator Bundle-ClassPath: .,org/foo/embedded.jar Bundle-NativeCode: libfoo.so; osname=Linux; processor=x86, foo.dll; osname=Windows 7; processor=x86 Internal bundle Import-Package:o sgi.service.log; version="[1.0.0,1.1.0)"; class path resolution:="optional" Export-Package: org.foo.service; version=1.1; vendor="org.foo:"; exclude:="*Impl", org.foo.service.bar; version=1.1; uses:="org.foo.service" OSGi Platform 43/42
  • 44. OSGi Bundle Manifest Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.foo.simplebundle Bundle-Version: 1.0.0 Native code Bundle-Activator: org.foo.Activator dependencies Bundle-ClassPath: .,org/foo/embedded.jar Bundle-NativeCode: libfoo.so; osname=Linux; processor=x86, foo.dll; osname=Windows 7; processor=x86 Import-Package:o sgi.service.log; version="[1.0.0,1.1.0)"; resolution:="optional" Export-Package: org.foo.service; version=1.1; vendor="org.foo:"; exclude:="*Impl", org.foo.service.bar; version=1.1; uses:="org.foo.service" OSGi Platform 44/42
  • 45. OSGi Bundle Manifest Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.foo.simplebundle Bundle-Version: 1.0.0 Bundle-Activator: org.foo.Activator Optional Bundle-ClassPath: .,org/foo/embedded.jar dependency on a package version Bundle-NativeCode: libfoo.so; osname=Linux; processor=x86, range foo.dll; osname=Windows 7; processor=x86 Import-Package: osgi.service.log; version="[1.0.0,1.1.0)"; resolution:="optional" Export-Package: org.foo.service; version=1.1; vendor="org.foo:"; exclude:="*Impl", org.foo.service.bar; version=1.1; uses:="org.foo.service" OSGi Platform 45/42
  • 46. OSGi Bundle Manifest Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.foo.simplebundle Bundle-Version: 1.0.0 Bundle-Activator: org.foo.Activator Bundle-ClassPath: .,org/foo/embedded.jar Provided package with Bundle-NativeCode: libfoo.so; osname=Linux; processor=x86, foo.dll; osname=Windows 7;arbitrary attribute and processor=x86 excluded classes Import-Package:o sgi.service.log; version="[1.0.0,1.1.0)"; resolution:="optional" Export-Package: org.foo.service; version=1.1; vendor="org.foo:"; exclude:="*Impl", org.foo.service.bar; version=1.1; uses:="org.foo.service" OSGi Platform 46/42
  • 47. OSGi Bundle Manifest Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.foo.simplebundle Bundle-Version: 1.0.0 Bundle-Activator: org.foo.Activator Bundle-ClassPath: .,org/foo/embedded.jar Bundle-NativeCode: libfoo.so; osname=Linux; processor=x86, Provided package with foo.dll; osname=Windows 7; processor=x86 dependency on Import-Package:o sgi.service.log; exported package version="[1.0.0,1.1.0)"; resolution:="optional" Export-Package: org.foo.service; version=1.1; vendor="org.foo:"; exclude:="*Impl", org.foo.service.bar; version=1.1; uses:="org.foo.service" OSGi Platform 47/42
  • 48. Declarative Services o Declarative services provides a minimally intrusive way to: • Define components that provide and use services • Automate dependency resolution and maintenance package foo.impl; public class HelloImpl implements foo.HelloService { LogService log; protected void setLog(LogService l) { log = l; } protected void unsetLog(LogService l) { log = null; } public void sayHello(String s) { log.log(LogService.LOG_INFO, "Hello " + s); } } OSGi Platform 48/42
  • 49. Declarative Services o Declarative services component metadata: <?xml version="1.0" encoding="UTF-8"?> <component name="example.hello"> <implementation class="foo.impl.HelloImpl"/> <service> <provide interface="foo.HelloService"/> </service> <reference name="LOG" interface="org.osgi.service.log.LogService" bind="setLog" unbind="unsetLog" /> </component> OSGi Platform 49/42
  • 50. OSGi implementations o Specification it is good, but without implementation it is a dead stuff o The most popular open source implementation is: • Equinox • Apache Felix • Knopflerfish OSGi Platform 50/42
  • 51. OSGi in Enterprise (as example) o Why? • Create modular and reusable software • Create evolvable software • Create line of products o What? • • • • • • Desktop Applications Web Applications Service Layers Content Management Systems Embedded and Mobile Applications Cloud Applications OSGi Platform 51/42
  • 52. Conclusions o Java needs improved modularity support • Lagging behind .NET in this area for years • The OSGi framework provides it now o Importance and relevance of OSGi is growing • Industry support for mobile applications • Significant uptake in the enterprise space OSGi Platform 52/42