osgi technology hsin-han yang, cheng-yi chien, po-cheng huang

32
OSGi Technology OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

Upload: lindsey-pickney

Post on 14-Dec-2015

226 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

OSGi TechnologyOSGi Technology

Hsin-Han Yang, Cheng-Yi Chien,Po-Cheng Huang

Page 2: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

2

OutlineOutline

What is OSGi TechnologyIntroduction

AllianceSpecificationsKey BenefitsOSGi Terminology

OSGi FrameworkService & BundleUse CasesOSGi Implementation

Page 3: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

3

What is OSGi TechnologyWhat is OSGi Technology

It’s a module system for the Java platformIt’s dynamicIt’s service-orientedA specification of the OSGi Alliance, a non-profit organization

Page 4: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

4

OutlineOutline

What is OSGi TechnologyIntroduction

AllianceSpecificationsKey BenefitsOSGi Terminology

OSGi FrameworkService & BundleUse CasesOSGi Implementation

Page 5: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

5

AllianceAlliance

“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…

Page 6: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

6

SpecificationsSpecifications

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

Page 7: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

7

SpecificationsSpecifications

OSGi frameworkStandard service definitions

Log ServiceHttp ServiceDevice ServicePackage Administration ServicePermission Administration ServiceConfiguration Administration ServicePreferences ServiceUser Administration Service

Page 8: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

SpecificationsSpecifications

8

Page 9: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

Key BenefitsKey Benefits

Platform IndependenceApplication IndependenceMultiple Service SupportService Collaboration SupportMultiple Network Technology SupportSecuritySimplicity

Page 10: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

14

Key BenefitsKey Benefits

Avoids Java Archive (JAR) file hellReuse code "out of the box"Simplifies multi-team projectsEnables smaller systemsManages deployments local or remotelyExtensive tool supportNo lock in, many providers of core technology including many open sourceVery high adoption rate

Page 11: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

15

OSGi TerminologyOSGi Terminology

Services gatewayFrameworkServiceBundle

Page 12: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

16

OutlineOutline

What is OSGi TechnologyIntroduction

AllianceSpecificationsKey BenefitsOSGi Terminology

OSGi FrameworkService & BundleUse CasesOSGi Implementation

Page 13: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

17

OSGi FrameworkOSGi Framework

Services gatewayGeneric application framework

Lightweight frameworkSimple component modelService registrySupport for deployment

Page 14: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

18

OSGi FrameworkOSGi Framework

Page 15: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

20

OSGi FrameworkOSGi 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.

Page 16: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

23

OSGi FrameworkOSGi Framework

Page 17: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

24

OutlineOutline

What is OSGi TechnologyIntroduction

AllianceSpecificationsKey BenefitsOSGi Terminology

OSGi FrameworkService & BundleUse CasesOSGi Implementation

Page 18: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

25

Service & BundleService & Bundle

ServicesProvide 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

Page 19: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

26

Bundle Life CycleBundle Life Cycle

Page 20: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

27

Page 21: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

28

Page 22: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

29

Page 23: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

30

OutlineOutline

What is OSGi TechnologyIntroduction

AllianceSpecificationsKey BenefitsOSGi Terminology

OSGi FrameworkService & BundleUse CasesOSGi Implementation

Page 24: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

31

Typical Use CasesTypical Use Cases

Internet AccessPersonal CommunicationsHome AutomationHome SecurityHome Health Care MonitoringEntertainmentInformation managementTelematics (Automotive)

Page 25: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

32

Typical Use CasesTypical Use Cases

Page 26: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

33

Typical Use CasesTypical Use Cases

Page 27: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

35

OutlineOutline

What is OSGi TechnologyIntroduction

AllianceSpecificationsKey BenefitsOSGi Terminology

OSGi FrameworkService & BundleUse CasesOSGi Implementation

Page 28: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

36

Framework ImplementationFramework Implementation

IBM Lotus ExpeditorProSyst SoftwareKnopflerfish OSGi

Makewave (formerly Gatespace Telematics)

Equinox OSGi (Eclipse project)Objectweb Oscar

Apache Felix

Page 29: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

Knopflerfish Installation (1)Knopflerfish Installation (1)

Software EnvironmentJRE 1.6.0_10Window XP

Download jar filehttp://www.knopflerfish.org/download.htmlCurrent release OSGi R4 - Knopflerfish 2.0.5Download knopflerfish_osgi_<version>.jar

Page 30: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

Knopflerfish Installation (2)Knopflerfish Installation (2)Execute knopflerfish_osgi_<version>.jar

double-clicking on the distribution fileor by the command: java -jar knopflerfish_osgi_<version>.jar

Page 31: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

Startup KnopflerfishStartup KnopflerfishChange the directory to the installation directory and start Knopflerfish

double-clicking on framework.jaror by the command: java -jar framework.jar

Page 32: OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang

Eclipse – Develop OSGi BundleEclipse – Develop OSGi Bundle

Software EnvironmentEclipse 3.1-3.4http://www.eclipse.org/downloadsKnopflerfish plug-in for Eclipsehttp://www.knopflerfish.org/eclipse_plugin.html

Programming TutorialKnopflerfish tutorialhttp://www.knopflerfish.org/tutorials.htmlOscar Tutorialhttp://oscar-osgi.sourceforge.net/tutorial/