osgi & upnp technology 2009 summer ya-lin huang. 2 outline what is osgi technology introduction...

50
OSGi & UPnP Technology OSGi & UPnP Technology 2009 Summer Ya-Lin Huang

Upload: todd-clark

Post on 12-Jan-2016

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

OSGi & UPnP TechnologyOSGi & UPnP Technology

2009 Summer

Ya-Lin Huang

Page 2: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

2

OutlineOutline

What is OSGi TechnologyIntroduction

AllianceSpecificationsKey Benefits

OSGi FrameworkService & BundleUse CasesOSGi Implementation

Page 3: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

3

What is OSGi TechnologyWhat 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

Page 4: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

4

OutlineOutline

What is OSGi TechnologyIntroduction

AllianceSpecificationsKey Benefits

OSGi FrameworkService & BundleUse CasesOSGi Implementation

Page 5: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

5

AllianceAlliance

OSGi - “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 April 2006) more than 35 companies from quite different business areas, for example Nokia, Motorola, Philips, BenQ, Siemens VDO Automotive, BMW, Gatespace Telematics, ProSyst, Samsung Electronics…

Page 6: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

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

Latest release (R4.1 / JSR-291): May 2007

Page 7: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

7

SpecificationsSpecifications

OSGi frameworkStandard service definitions

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

Page 8: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

8

Page 9: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

9

Key BenefitsKey Benefits

Platform Independence:OSGi member companies work in many different environments and as such they suffer different constraints, resulting in widely varying product characteristics and capabilities.

Application Independence:The OSGi specifications focus on defining common APIs for service deployment. This makes the specifications suitable for Service Platforms for a variety of applications in different markets.

Page 10: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

10

Key BenefitsKey Benefits

Multiple Service Support:OSGi environments should be capable of hosting multiple applications from different Service Providers on a single Service Platform with each application providing an independent set of services to the end user.

Service Collaboration Support:An important aspect of the OSGi deployment model is that it allows the core platform to be extended with deployed services. This is not limited to end user oriented services only, which is a limitation of some other deployment models.

Page 11: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

11

Key BenefitsKey Benefits

Multiple Network Technology Support:OSGi Service Platforms can work with wide area technologies like xDSL, Cable modems, Satellite, ISDN and PSTN and local area networks like Bluetooth, USB, IEEE 1394 Firewire.

Popular service discovery techniques like UPnP, Jini, Salutation and several others work very well in conjunction with an OSGi Service Platform and can even potentially interwork transparently.

Page 12: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

12

Key BenefitsKey Benefits

Security:The OSGi offers a fine grained security architecture that limits the potential harm a malicious or badly written application can do.

Simplicity:The OSGi environment offers a service environment for everybody by removing much of the complexity and putting it into the hands of professionals. The environment can be remotely managed by a professional organization, if so desired.

Page 13: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

13

OutlineOutline

What is OSGi TechnologyIntroduction

AllianceSpecificationsKey BenefitsOSGi Terminology

OSGi FrameworkService & BundleUse CasesOSGi Implementation

Page 14: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

14

OSGi FrameworkOSGi Framework

Services gateway

Generic application framework

Lightweight frameworkSimple component model

Service registry

Support for deployment

Page 15: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

15

OSGi PlatformOSGi Platform

Hardware

Drivers

e.g. Windows, Linux, VxWorks, QNXOperating System

applicaion OSGi Framework

System Services

Multimedia Bundles Health-Care Bundles

e.g. J2ME, J2SE, J2EEJava Runtime Environment

Page 16: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

16

OSGi FrameworkOSGi Framework

Hardware: the physical part of a computer.Operating System: a software program that manages the hardware and software resources of a computer. Java Runtime Environment: a software bundle from Sun Microsystems that allows a computer system to run a java application.Application: a subclass of computer software that employs the capabilities of a computer directly to a task that the user wishes to perform.

Page 17: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

OSGi FrameworkOSGi Framework

The Framework is divided in a number of layers:

Execution Environment

Modules

Life Cycle Management

Service Registry.

Additionally, there is a security system that is deeply intertwined with all the layers.

17

Page 18: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

18

OSGi FrameworkOSGi Framework

Execution environment: the specification of the Java environment. Java 2 Configurations and Profiles. Modules: defines the class loading policies. The OSGi Framework is a powerful and strictly specified class loading model. It is based on top of Java but add modularization. Life Cycle Management: 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.

Page 19: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

19

OSGi FrameworkOSGi Framework

Service Registry: The service registry provides a cooperation model for bundles that takes the dynamics into account. The service registry provides a comprehensive model to share objects between bundles. A number of events are defined to handle the coming and going of services.

Security is based on Java and the Java 2 security model.

Page 20: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

20

OSGi FrameworkOSGi Framework

Page 21: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

21

OutlineOutline

What is OSGi TechnologyIntroduction

AllianceSpecificationsKey BenefitsOSGi Terminology

OSGi FrameworkService & BundleUse CasesOSGi Implementation

Page 22: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

22

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 23: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

23

Bundle Life CycleBundle Life Cycle

Page 24: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

24

Bundle Acting Bundle Acting Progress(1/3)Progress(1/3)

Page 25: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

25

Bundle Acting Bundle Acting Progress(2/3)Progress(2/3)

Page 26: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

26

Bundle Acting Bundle Acting Progress(3/3)Progress(3/3)

Page 27: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

27

OutlineOutline

What is OSGi TechnologyIntroduction

AllianceSpecificationsKey BenefitsOSGi Terminology

OSGi FrameworkService & BundleUse CasesOSGi Implementation

Page 28: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

28

Typical Use CasesTypical Use Cases

Internet Access

Personal Communications

Home Automation

Home Security

Home health care monitoring

Entertainment

Information management

Automobiles

Page 29: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

29

Typical Use CasesTypical Use Cases

Page 30: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

30

Commercial Use CasesCommercial Use Cases

Nokia implements OSGi on 800Ricoh

Multi-functional Products (MFPs) laser printers

BMW Research 3GT, Ertico GST

Volvo Technology (VTEC)3GT (Third Generation Telematics)GST (Global System for Telematics) CVIS (Cooperative Vehicle Infrastructure Systems)

Philips iPronto

Page 31: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

31

OutlineOutline

What is OSGi TechnologyIntroduction

AllianceSpecificationsKey BenefitsOSGi Terminology

OSGi FrameworkService & BundleUse CasesOSGi Implementation

Page 32: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

32

Framework ImplementationFramework Implementation

IBM Lotus Expeditor

ProSyst Software

Knopflerfish OSGiMakewave (formerly Gatespace Telematics)

Equinox OSGi (Eclipse project)

Objectweb OscarApache Felix

Page 33: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

Knopflerfish Installation (1)Knopflerfish Installation (1)

Software EnvironmentJRE(Java Runtime Environment)

Window XP

Download Knopflerfish jar filehttp://www.knopflerfish.org/download.html

Knopflerfish support OSGi R4 from 2.0.5

Download knopflerfish_osgi_<version>.jar

Page 34: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

Knopflerfish Installation (2)Knopflerfish Installation (2)

Install JREExecute knopflerfish_osgi_<version>.jar

double-clicking on the distribution fileuse the command: java -jar knopflerfish_osgi_<version>.jarOr just extract the JAR file

Page 35: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

Startup KnopflerfishStartup Knopflerfish

Change the directory to the installation directory and start Knopflerfish

double-clicking on framework.jar

use the command: java -jar framework.jar

Eclipse plugin http://www.knopflerfish.org/eclipse_install.html

Bundle ActionBundle Action

Bundle Stateand Information

Bundle Stateand InformationOutputOutput

InputInput

Page 36: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

BUNDLE DEVELOPMENTBUNDLE DEVELOPMENT

36

Page 37: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

37

Bundle Activator(1/3)Bundle Activator(1/3)

Activator Class (implements BundleActivator)start()

This method implements what should the bundle do when it starts. The same as main() method in common Java program.

stop()This method implements what should the bundle do when it is going to stop.

Page 38: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

38

Bundle Activator(2/3)Bundle Activator(2/3)Simple implementationSimple implementation

package ismp.smart.HelloOSGi;import org.osgi.framework.BundleActivator;import org.osgi.framework.BundleContext;public class Activator implements BundleActivator { public void start(BundleContext context) throws Exception {

System.out.println("HELLO!!"); } public void stop(BundleContext context) throws Exception {

System.out.println("Byebye"); }}

package ismp.smart.HelloOSGi;import org.osgi.framework.BundleActivator;import org.osgi.framework.BundleContext;public class Activator implements BundleActivator { public void start(BundleContext context) throws Exception {

System.out.println("HELLO!!"); } public void stop(BundleContext context) throws Exception {

System.out.println("Byebye"); }}

Page 39: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

39

Bundle Activator(3/3)Bundle Activator(3/3)MANIFEST fileMANIFEST file

Manifest-Version: 1.0Bundle-Vendor: ISMPBundle-Version: 1.0.0Bundle-Name: HelloOSGiBundle-Activator: ismp.smart.HelloOSGi.ActivatorBundle-Description: FirstBundleImport-Package: org.osgi.frameworkBundle-SymbolicName: HelloOSGi

Manifest-Version: 1.0Bundle-Vendor: ISMPBundle-Version: 1.0.0Bundle-Name: HelloOSGiBundle-Activator: ismp.smart.HelloOSGi.ActivatorBundle-Description: FirstBundleImport-Package: org.osgi.frameworkBundle-SymbolicName: HelloOSGi

Page 40: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

MANIFEST headerMANIFEST header

Header Name DescriptionBundle-Actiovator Bundle’s Activator classBundle-ClassPath Bundle Class Path

Bundle-ContactAddress Bundle Developer’s E-mailBundle-Description Bundle usage and function description

Bundle-DocURL Bundle Document AddressBundle-Name Bundle Name. Display for user.

Bundle-NativeCode Make it be able to use self-generated Native Code(JNI NativeCode)

Bundle-UpdateLocation Bundle Update LocationBundle-Vendor Vendor NameBundle-Version Bundle Version InformationExport-package Export PackageExport-Service Export Service

Import-package Import PackageImport-Service Import Service

40

Page 41: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

41

Service Export(1/4)Service Export(1/4)

Activator Class (implements BundleActivator)start()

We have to implement a class and a service method for this class, and register this service in the start() method.

BundleContext.registerService (java.lang.String class, java.lang.Object service, java.util.Dictionary properties)

stop()Some services should be unregistered before the bundle stopped.

ServiceRegistration.unregister()

Page 42: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

Service Export(2/4)Service Export(2/4)Service interface and implementationService interface and implementation

42

package ismp.smart.helloOSGiServices;import java.util.Date;public interface FirstService {

public String getFormattedDate(Date date);

}

package ismp.smart.helloOSGiServices;import java.util.Date;public interface FirstService {

public String getFormattedDate(Date date);

}

package ismp.smart.helloOSGiServices.impl;import java.text.DateFormat;import java.util.Date;import ismp.smart.helloOSGiServices.FirstService;public class FirstServiceImpl implements FirstService {

public String getFormattedDate(Date date) {return

DateFormat.getDateInstance(DateFormat.SHORT).format(date);}

}

package ismp.smart.helloOSGiServices.impl;import java.text.DateFormat;import java.util.Date;import ismp.smart.helloOSGiServices.FirstService;public class FirstServiceImpl implements FirstService {

public String getFormattedDate(Date date) {return

DateFormat.getDateInstance(DateFormat.SHORT).format(date);}

}

Page 43: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

43

Service Export(3/4)Service Export(3/4)Register ServiceRegister Service

package ismp.smart.helloOSGiServices.impl;...import ismp.smart.helloOSGiServices.FirstService;public class Activator implements BundleActivator {

public static BundleContext bc = null;public void start(BundleContext bc) throws Exception {

...Activator.bc = bc;

FirstService service = new FirstServiceImpl();ServiceRegistration registration = bc.registerService( FirstService.class.getName(), service, new Hashtable());System.out.println("Service registered: FirstService");

}...

}

package ismp.smart.helloOSGiServices.impl;...import ismp.smart.helloOSGiServices.FirstService;public class Activator implements BundleActivator {

public static BundleContext bc = null;public void start(BundleContext bc) throws Exception {

...Activator.bc = bc;

FirstService service = new FirstServiceImpl();ServiceRegistration registration = bc.registerService( FirstService.class.getName(), service, new Hashtable());System.out.println("Service registered: FirstService");

}...

}

Page 44: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

44

Service Export(4/4)Service Export(4/4)Manifest fileManifest file

Manifest-Version: 1.0Bundle-Vendor: ISMPBundle-Version: 1.0.0Bundle-Name: HelloOSGiServiceProviderBundle-Activator: ismp.smart.helloOSGiServices.impl.ActivatorBundle-Description: FirstBundleServiceImport-Package: org.osgi.frameworkBundle-SymbolicName: HelloOSGiServiceProvider

Export-Package: ismp.smart.helloOSGiServices

Manifest-Version: 1.0Bundle-Vendor: ISMPBundle-Version: 1.0.0Bundle-Name: HelloOSGiServiceProviderBundle-Activator: ismp.smart.helloOSGiServices.impl.ActivatorBundle-Description: FirstBundleServiceImport-Package: org.osgi.frameworkBundle-SymbolicName: HelloOSGiServiceProvider

Export-Package: ismp.smart.helloOSGiServices

Page 45: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

45

Service Import(1/3)Service Import(1/3)Dynamic binding servicesDynamic binding services

public void start(BundleContext bc) throws Exception {System.out.println("start " + getClass().getName());Activator.bc = bc;String filter = "(objectclass=" + FirstService.class.getName()

+ ")";bc.addServiceListener(this, filter);ServiceReference references[] = bc.getServiceReferences(null,

filter);for (int i = 0; references != null && i < references.length;

i++){ this.serviceChanged(new

ServiceEvent(ServiceEvent.REGISTERED,references[i]));}

}

public void start(BundleContext bc) throws Exception {System.out.println("start " + getClass().getName());Activator.bc = bc;String filter = "(objectclass=" + FirstService.class.getName()

+ ")";bc.addServiceListener(this, filter);ServiceReference references[] = bc.getServiceReferences(null,

filter);for (int i = 0; references != null && i < references.length;

i++){ this.serviceChanged(new

ServiceEvent(ServiceEvent.REGISTERED,references[i]));}

}

Page 46: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

Service Import(2/3)Service Import(2/3)Must implemented methodMust implemented method

46

public void serviceChanged(ServiceEvent event) {switch (event.getType()) {case ServiceEvent.REGISTERED:

log("ServiceEvent.REGISTERED");this.service = (FirstService)Activator.bc.getService(

event.getServiceReference());this.startUsingService();break;

case ServiceEvent.MODIFIED:log("ServiceEvent.MODIFIED received");this.stopUsingService();this.service = (FirstService) Activator.bc.getService(

event.getServiceReference());this.startUsingService();break;

case ServiceEvent.UNREGISTERING:log("ServiceEvent.UNREGISTERING");this.stopUsingService();break;

}

}

public void serviceChanged(ServiceEvent event) {switch (event.getType()) {case ServiceEvent.REGISTERED:

log("ServiceEvent.REGISTERED");this.service = (FirstService)Activator.bc.getService(

event.getServiceReference());this.startUsingService();break;

case ServiceEvent.MODIFIED:log("ServiceEvent.MODIFIED received");this.stopUsingService();this.service = (FirstService) Activator.bc.getService(

event.getServiceReference());this.startUsingService();break;

case ServiceEvent.UNREGISTERING:log("ServiceEvent.UNREGISTERING");this.stopUsingService();break;

}

}

Page 47: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

Service Import(3/3)Service Import(3/3) Manifest fileManifest file

47

Manifest-Version: 1.0Bundle-Vendor: ISMPBundle-Version: 1.0.0Bundle-Name: HelloOSGiServiceClientBundle-Activator: ismp.smart.helloOSGiServicesClient.impl.ActivatorBundle-Description: FirstBundleServiceClientImport-Package: org.osgi.framework, ismp.smart.helloOSGiServicesClient

Bundle-SymbolicName: HelloOSGiServiceClient

Manifest-Version: 1.0Bundle-Vendor: ISMPBundle-Version: 1.0.0Bundle-Name: HelloOSGiServiceClientBundle-Activator: ismp.smart.helloOSGiServicesClient.impl.ActivatorBundle-Description: FirstBundleServiceClientImport-Package: org.osgi.framework, ismp.smart.helloOSGiServicesClient

Bundle-SymbolicName: HelloOSGiServiceClient

Page 48: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

Export JarExport Jar

Eclipse Export

Install BundleDrag and Drop or click “Bundle Action” buttons - [Open Bundle(s)]

If all the dependencies are satisfied, the installed bundle will automatically start, or it will prompt error messages.

Start BundleClick “Bundle Action” buttons - [Start Bundle]

Stop BundleClick “Bundle Action” buttons - [Stop Bundle]

Uninstall BundleClick “Bundle Action” buttons - [Uninstall Bundle]

48

Page 49: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

DEMODEMO

49

Page 50: OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service

HomeworkHomework

50