osgi service platform release 4 overview - bj hargrave, ibm & peter kriens, aqute
TRANSCRIPT
OSGi Service PlatformRelease 4 Overview
BJ HargraveBJ HargraveOSGi Alliance Fellow & CTOOSGi Alliance Fellow & CTO
IBM Senior Technical Staff MemberIBM Senior Technical Staff Member
The Past to The PresentThe Past to The Present
•• Work began as an Work began as an ad hocad hoc group called the group called the Connected AllianceConnected Alliance in 1998in 1998
•• The OSGi Alliance was founded in March, 1999The OSGi Alliance was founded in March, 1999–– As an independent, worldwide, nonAs an independent, worldwide, non--profit organization profit organization
with open membershipwith open membership•• JSRJSR--008 was withdrawn and technical work moved 008 was withdrawn and technical work moved
to the OSGi Allianceto the OSGi Alliance•• OSGi Service Gateway Release 1.0 was published OSGi Service Gateway Release 1.0 was published
in May 2000in May 2000……
Service Platform ReleasesService Platform Releases
2000 2001 2003 2005
R1
R2
R3
FrameworkHttpLogDevice Access
Package AdminConfiguration AdminPermission AdminUser AdminPreferencesMetaTypeService Tracker
R4
UPnPInitial ProvisioningName SpaceJiniStart LevelIO ConnectorWire AdminXML ParserMeasurement & StatePositionExecution EnvironmentsURL Handler
Core• Framework Layering• Conditional Permission Admin• Declarative Services• Event Admin
Mobile• DMT Admin• Deployment Admin• Foreign Applications• Mobile Management Tree
Vehicle• Power Management• Metatype 2• Diagnostic• Vehicle API
Who created the Releases?Who created the Releases?
The OSGi Expert GroupsThe OSGi Expert Groups•• Core Platform Expert Group (CPEG)Core Platform Expert Group (CPEG)
–– Responsible for the Framework and core services as Responsible for the Framework and core services as well as overall architecturewell as overall architecture
•• Vehicle Expert Group (VEG)Vehicle Expert Group (VEG)–– Responsible for vehicle related requirements and Responsible for vehicle related requirements and
designsdesigns•• Mobile Expert Group (MEG)Mobile Expert Group (MEG)
–– Responsible for mobile device related requirements Responsible for mobile device related requirements and designsand designs
Mobile
Service Compendium
Service
Core Specification
R4 Documentation PlanR4 Documentation Plan
Framework Implementer’s
spec
Bundle Programmer’s
guide
Normative
Informative
EEService
ServiceService
Ref Arch / Guide
ServiceService
Service
Vehicle Other
…
} } }
Ref Arch / Guide
Ref Arch / Guide
DocumentServiceService
Service
ServiceService
Service
Constraints Constraints Constraints
R4 Release PlanR4 Release Plan
•• Core Specification and Service Compendium published 11 Core Specification and Service Compendium published 11 OctoberOctober
•• Mobile Specification is being developed in cooperation Mobile Specification is being developed in cooperation with JSRwith JSR--232232
–– JSRJSR--232 went to Early Draft Review (EDR) on 7 October232 went to Early Draft Review (EDR) on 7 October–– Completion of the Mobile Specification will be coordinated with Completion of the Mobile Specification will be coordinated with
JSRJSR--232232
•• Vehicle Specification is under developmentVehicle Specification is under development–– Receiving contributions from AMIReceiving contributions from AMI--CC–– Current outlook for completion is 1Q2006Current outlook for completion is 1Q2006
•• All specification companion code now released under an All specification companion code now released under an open source licenseopen source license
Today!
Core SpecificationCore Specification
Defines the Defines the •• FrameworkFramework
–– Module LayerModule Layer–– Lifecycle LayerLifecycle Layer–– Service LayerService Layer
•• Framework ServicesFramework Services–– Package AdminPackage Admin–– Start LevelStart Level–– Conditional Permission AdminConditional Permission Admin–– Permission AdminPermission Admin–– URL HandlersURL Handlers
New
Updated
Updated
Rewrittenand
Updated
Framework FeaturesFramework Features
Runs multiple applications and servicesRuns multiple applications and services•• Single VM instanceSingle VM instance•• Separate class loader per bundleSeparate class loader per bundle
––Class loader networkClass loader network–– Independent namespacesIndependent namespaces––Class sharing at the Java package levelClass sharing at the Java package level
•• Lifecycle management of bundlesLifecycle management of bundles•• Intra VM publish/find/bind service modelIntra VM publish/find/bind service model•• Java Permissions to secure frameworkJava Permissions to secure framework
Framework LayeringFramework Layering
CDCCDC
ExecutionEnvironment
L0 -•OSGi Minimum Execution Environment•CDC/Foundation•J2SE
MODULEL1 - Creates the concept of modules (aka. bundles) that use classes from each other in a controlled way according to system and bundle constraints
LIFECYCLEL2 - Manages the lifecycle of bundle in a bundle repository without requiring the VM be restarted
SERVICE MODELL3 – Provides a publish/find/bind service model to decouple bundles
Module LayerModule Layer
•• Provides a generic and standardized solution for Java Provides a generic and standardized solution for Java modularizationmodularization
•• BundleBundle is the unit of modularizationis the unit of modularization–– Contains Java classes and other resourcesContains Java classes and other resources–– Typically a JAR fileTypically a JAR file
•• Bundles can share Java packages in a wellBundles can share Java packages in a well--defined waydefined way–– Export a packageExport a package–– Import a packageImport a package
•• Bundle manifest contains metadata to declare modularity Bundle manifest contains metadata to declare modularity constraintsconstraints
Class Loading ArchitectureClass Loading Architecture
•• Bundles can hide packages and classes from other bundles, as welBundles can hide packages and classes from other bundles, as well l as share packages with other bundles.as share packages with other bundles.
•• The key mechanism to hide and share packages is the Java class The key mechanism to hide and share packages is the Java class loaderloader
–– Loads classes from a subset of the bundle space using wellLoads classes from a subset of the bundle space using well--defined rules.defined rules.•• Each bundle has a single class loaderEach bundle has a single class loader
–– Forms a class loading delegation network with other bundlesForms a class loading delegation network with other bundles•• Bundle class loader can load classes and resources from:Bundle class loader can load classes and resources from:
–– Boot class pathBoot class path –– The boot class path contains the java.* packages and their The boot class path contains the java.* packages and their implementation packages.implementation packages.
–– Framework (System Bundle) class pathFramework (System Bundle) class path –– The Framework usually has a The Framework usually has a separate class loader for the Framework implementation classes aseparate class loader for the Framework implementation classes as well as s well as key service interface classes.key service interface classes.
–– Bundle SpaceBundle Space –– The bundle space consists of the JAR file that is associated The bundle space consists of the JAR file that is associated with the bundle, plus any additional JAR that are closely tied twith the bundle, plus any additional JAR that are closely tied to the bundle, o the bundle, like fragmentslike fragments
Class SpaceClass Space
•• Defined to be all classes reachable from a given bundleDefined to be all classes reachable from a given bundle’’s s class loader.class loader.
•• Contains classes from:Contains classes from:–– The parent class loader (normally java.* packages from the boot The parent class loader (normally java.* packages from the boot
class path)class path)–– Imported packagesImported packages–– Required bundlesRequired bundles–– The bundle's class path (private packages)The bundle's class path (private packages)–– Attached fragmentsAttached fragments
•• A class space must be consistentA class space must be consistent–– It never contains two classes with the same fully qualified nameIt never contains two classes with the same fully qualified name–– Modularity layer supports a model where multiple versions of theModularity layer supports a model where multiple versions of the
same class are loaded in the same VM in different class spacessame class are loaded in the same VM in different class spaces
Resolving BundlesResolving Bundles
•• Resolving is the process where importers are wired Resolving is the process where importers are wired to exporters once specified constraints are satisfiedto exporters once specified constraints are satisfied––A bundle must be resolved before any code from a A bundle must be resolved before any code from a
bundle can be loaded or executedbundle can be loaded or executed•• A A wirewire is an actual connection between an exporter is an actual connection between an exporter
and an importer for a given package and an importer for a given package ––Associated with a number of constraints that are defined Associated with a number of constraints that are defined
by its importerby its importer’’s and exporters and exporter’’s manifest headerss manifest headers
Bundle Manifest Version 2Bundle Manifest Version 2
•• Change in the module layer for R4 required semantic Change in the module layer for R4 required semantic changes in some of the existing manifest headerschanges in some of the existing manifest headers
•• To distinguish between preTo distinguish between pre--R4 and R4 semantics, a R4 and R4 semantics, a bundle manifest version header is definedbundle manifest version header is defined
•• Manifest headerManifest headerBundleBundle--ManifestVersionManifestVersion ::= number::= number
•• Version 2 is R4 semanticsVersion 2 is R4 semantics•• If the manifest header is not specified then preIf the manifest header is not specified then pre--R4 R4
semantics are assumedsemantics are assumed•• ExampleExample
BundleBundle--ManifestVersionManifestVersion: 2: 2
ExportExport--PackagePackage
•• Manifest headerManifest headerExportExport--Package ::= export ( ',' export )*Package ::= export ( ',' export )*export ::= packageexport ::= package--names ( ';' parameter )*names ( ';' parameter )*packagepackage--names ::= packagenames ::= package--name ( ';' packagename ( ';' package--name )*name )*
•• DirectiveDirective–– uses := uses := package listpackage list–– mandatory := mandatory := attribute listattribute list–– include := include := class listclass list–– exclude := exclude := class listclass list
•• AttributesAttributes–– version = version = versionversion–– arbitraryarbitrary•• foofoo = bar= bar
•• ExampleExampleExportExport--Package: Package: org.osgi.fooorg.osgi.foo; ; org.osgi.barorg.osgi.bar; uses:=; uses:=org.osgi.xyzzyorg.osgi.xyzzy; ; version=1.2.1version=1.2.1
ImportImport--PackagePackage
•• Manifest headerManifest headerImportImport--Package ::= import ( ',' import )*Package ::= import ( ',' import )*import ::= packageimport ::= package--names ( ';' parameter )*names ( ';' parameter )*packagepackage--names ::= packagenames ::= package--name ( ';' packagename ( ';' package--name )*name )*
•• DirectiveDirective–– resolution := mandatory | optionalresolution := mandatory | optional
•• AttributesAttributes–– version = version = [[low,highlow,high))–– bundlebundle--symbolicsymbolic--name = name = rdn.bundle.namerdn.bundle.name–– bundlebundle--version = version = [[low,highlow,high))–– arbitraryarbitrary•• foofoo = bar= bar
•• ExampleExampleImportImport--Package: Package: org.osgi.foo;versionorg.osgi.foo;version==““[1.2,2.0)[1.2,2.0)””, , org.osgi.barorg.osgi.bar; ; resolution:=resolution:=optional;versionoptional;version=1.2.1=1.2.1
Bundle Class PathBundle Class Path
•• Manifest headerManifest headerBundleBundle--ClasspathClasspath::= entry ( ::= entry ( ’’,,’’ entry )*entry )*entry ::= target ( entry ::= target ( ’’;;’’ target )* ( target )* ( ’’;;’’ parameter ) *parameter ) *target ::= path | target ::= path | ’’..’’
•• Defines the Defines the ““innerinner”” class path of a bundleclass path of a bundle••pathpath can refer to a directory in the bundle or a can refer to a directory in the bundle or a
contained JARcontained JAR––/WEB/WEB--INF/classesINF/classes––util.jarutil.jar
•• ExampleExampleBundleBundle--ClasspathClasspath: : util.jarutil.jar,/classes,/classes
DynamicImportDynamicImport--PackagePackage
•• Manifest headerManifest headerDynamicImportDynamicImport--Package ::= dynamicPackage ::= dynamic--description ( ',' dynamicdescription ( ',' dynamic--description )*description )*dynamicdynamic--description::= wildcarddescription::= wildcard--names ( ';' parameter )*names ( ';' parameter )*wildcardwildcard--names ::= wildcardnames ::= wildcard--name ( ';' wildcardname ( ';' wildcard--name )*name )*wildcardwildcard--name ::= packagename ::= package--name| ( packagename| ( package--name '.*' ) | '*'name '.*' ) | '*'
•• Dynamic imports are matched to export definitions (to form Dynamic imports are matched to export definitions (to form package wirings) during class loadingpackage wirings) during class loading–– Does not affect module resolutionDoes not affect module resolution–– Apply only to packages for which no wire has been established Apply only to packages for which no wire has been established
and no definition could be found in any other wayand no definition could be found in any other way–– Dynamic import is used as last resortDynamic import is used as last resort
•• Used for Used for Class.forNameClass.forName idiomidiom•• ExampleExampleDynamicImportDynamicImport--Package: Package: org.osgiorg.osgi.*.*
RequireRequire--BundleBundle
•• Manifest headerManifest headerRequireRequire--Bundle ::= bundleBundle ::= bundle--description ( ',' bundledescription ( ',' bundle--description )*description )*bundlebundle--description ::= symbolicdescription ::= symbolic--name (';' parameter )*name (';' parameter )*
•• DirectiveDirective–– resolution := mandatory | optionalresolution := mandatory | optional–– Visibility := private | Visibility := private | reexportreexport
•• Mechanism where bundles can be directly wired to the Mechanism where bundles can be directly wired to the exported packages of other bundles without specifying the exported packages of other bundles without specifying the specific packagesspecific packages
•• Used by Eclipse Used by Eclipse pluginsplugins as a convenienceas a convenience•• Has several drawbacks but is seen as very convenient by Has several drawbacks but is seen as very convenient by
developersdevelopers•• ExampleExampleRequireRequire--Bundle: Bundle: org.osgi.foobundleorg.osgi.foobundle; bundle; bundle--version=version=““[1.2,2.0)[1.2,2.0)””
FragmentsFragments
•• Manifest headerManifest headerFragmentFragment--Host ::= bundleHost ::= bundle--descriptiondescriptionbundlebundle--descriptiondescription ::= symbolic::= symbolic--name (';' parameter ) *name (';' parameter ) *
•• DirectiveDirective–– extension := framework | extension := framework | bootclasspathbootclasspath
•• Fragments are bundles that are attached to a host Fragments are bundles that are attached to a host bundle as part of resolvingbundle as part of resolving––Treated as part of the host bundleTreated as part of the host bundle––Must not have their own class loader.Must not have their own class loader.
•• Localization is key use caseLocalization is key use case•• ExampleExampleFragmentFragment--Host: Host: org.osgi.foobundleorg.osgi.foobundle; bundle; bundle--version=version=““[1.2,2.0)[1.2,2.0)””
Extension BundlesExtension Bundles
•• Framework ExtensionFramework Extension––Loaded by framework class loaderLoaded by framework class loader––Used to extend the framework implementationUsed to extend the framework implementation
•• Boot Class Path ExtensionBoot Class Path Extension––Loaded by the boot class loaderLoaded by the boot class loader––Used to supply JRE extensionsUsed to supply JRE extensions
•• Declared as fragments of System BundleDeclared as fragments of System Bundle•• ExampleExampleFragmentFragment--Host: Host: system.bundlesystem.bundle; extension:=; extension:=bootclasspathbootclasspath
Module Layer: Best PracticesModule Layer: Best Practices
•• Partition public and nonPartition public and non--public classes into public classes into separate packagesseparate packages––Packages with public classes can be exportedPackages with public classes can be exported––Packages with nonPackages with non--public classes are not exportedpublic classes are not exported
•• Use ImportUse Import--Package rather than RequirePackage rather than Require--BundleBundle––Allows more substitutability of package providersAllows more substitutability of package providers
•• Limit fragment useLimit fragment use•• DonDon’’t use t use DynamicImportDynamicImport--PackagePackage
––Unless there is no other wayUnless there is no other way
Lifecycle LayerLifecycle Layer
•• Provides APIs to control the life cycle of bundlesProvides APIs to control the life cycle of bundles–– Install/Update/UninstallInstall/Update/Uninstall––Start/StopStart/Stop––NotificationsNotifications
•• Provides API to inspect state of module layerProvides API to inspect state of module layer•• Builds upon the module layerBuilds upon the module layer•• Supports dynamic management of bundles in Supports dynamic management of bundles in
running VMrunning VM•• Localization of bundle manifest informationLocalization of bundle manifest information•• No major changes for R4No major changes for R4
––Just API additions for module layer enhancementsJust API additions for module layer enhancements
Bundle IdentifiersBundle Identifiers
•• Bundle id Bundle id –– Locally unique long value assigned by Framework during installaLocally unique long value assigned by Framework during installationtion–– Does not change as bundle is updatedDoes not change as bundle is updated–– Never reusedNever reused–– Assigned in ascending orderAssigned in ascending order
•• Bundle location Bundle location –– Locally unique name assigned to bundle by installer during Locally unique name assigned to bundle by installer during installationinstallation–– Normally a URL to bundleNormally a URL to bundle–– Does not change as bundle is updatedDoes not change as bundle is updated–– May be reusedMay be reused
•• Bundle Symbolic Name Bundle Symbolic Name –– A unique name assigned to bundle by the developerA unique name assigned to bundle by the developer–– The combination of Bundle Version and Bundle Symbolic Name is a The combination of Bundle Version and Bundle Symbolic Name is a globally globally
unique identifier for a bundleunique identifier for a bundle–– When BundleWhen Bundle--SymbolicNameSymbolicName manifest header is manifest header is specifedspecifed, then Bundle, then Bundle--Version Version
manifest header value must be a valid versionmanifest header value must be a valid version–– Multiple bundles may have same symbolic name as long as versionsMultiple bundles may have same symbolic name as long as versions are distinctare distinct
Service LayerService Layer
•• Defines a publish/find/bind service modelDefines a publish/find/bind service model–– Fully dynamicFully dynamic–– Intra VMIntra VM–– NonNon--durable service registrydurable service registry
•• A service is a normal Java object published under one or A service is a normal Java object published under one or more Java interfaces with additional metadatamore Java interfaces with additional metadata
•• Find mechanism support searching on both interface name Find mechanism support searching on both interface name and metadata valuesand metadata values
•• Service lifecycle event notificationsService lifecycle event notifications•• No major changes for R4No major changes for R4
–– Just API additions for module layer enhancementsJust API additions for module layer enhancements–– But Declarative Services is a new mode of using the service layeBut Declarative Services is a new mode of using the service layerr
New Framework APINew Framework API
•• New typesNew types–– AllServiceListenerAllServiceListener
•• In support of multiple exported package versionsIn support of multiple exported package versions–– BundlePermissionBundlePermission
•• New permission for modularity featuresNew permission for modularity features–– FrameworkUtilFrameworkUtil
•• Static means of creating Filter objectsStatic means of creating Filter objects–– Version Version
•• Standardized version classStandardized version class•• ComparableComparable
New Framework APINew Framework API
•• New methodsNew methods–– AdminPermissionAdminPermission
•• AdminPermission(Bundle,StringAdminPermission(Bundle,String))–– BundleBundle
•• Dictionary Dictionary getHeaders(StringgetHeaders(String) ) •• String String getSymbolicNamegetSymbolicName()()•• Class Class loadClass(StringloadClass(String))•• Enumeration Enumeration getResources(StringgetResources(String))•• Enumeration Enumeration getEntryPaths(StringgetEntryPaths(String) ) •• URL URL getEntry(StringgetEntry(String))•• long long getLastModifiedgetLastModified()()•• Enumeration Enumeration findEntries(StringfindEntries(String, , String,booleanString,boolean))
–– BundleContextBundleContext•• ServiceReferenceServiceReference[] [] getAllServiceReferences(String,StringgetAllServiceReferences(String,String) )
–– BundleExceptionBundleException•• ThrowableThrowable getCausegetCause()()
–– FilterFilter•• booleanboolean matchCase(DictionarymatchCase(Dictionary))
–– InvalidSyntaxExceptionInvalidSyntaxException•• ThrowableThrowable getCausegetCause()()
–– ServiceReferenceServiceReference•• booleanboolean isAssignableTo(Bundle,StringisAssignableTo(Bundle,String))
New Framework APINew Framework API
•• New fields New fields –– AdminPermissionAdminPermission actionsactions
•• CLASS, EXECUTE, EXTENSIONLIFECYCLE, LIFECYCLE, CLASS, EXECUTE, EXTENSIONLIFECYCLE, LIFECYCLE, LISTENER, METADATA, RESOLVE, RESOURCE, LISTENER, METADATA, RESOLVE, RESOURCE, STARTLEVEL STARTLEVEL
–– BundleEventBundleEvent typestypes•• RESOLVED, UNRESOLVED, STARTING, STOPPING RESOLVED, UNRESOLVED, STARTING, STOPPING
–– ConstantsConstants•• Too many new constants to listToo many new constants to list
–– FrameworkEventFrameworkEvent typestypes•• WARNING, INFO WARNING, INFO
Package Admin UpdatePackage Admin Update
•• Package Admin has been updated to support the new features of Package Admin has been updated to support the new features of the module layerthe module layer
•• New typeNew type–– RequiredBundleRequiredBundle
•• New methodsNew methods–– ExportedPackageExportedPackage
•• Version Version getVersiongetVersion()()–– PackageAdminPackageAdmin
•• ExportedPackageExportedPackage[] [] getExportedPackages(StringgetExportedPackages(String))•• Boolean Boolean resolveBundles(BundleresolveBundles(Bundle[])[])•• RequiredBundleRequiredBundle[] [] getRequiredBundles(StringgetRequiredBundles(String))•• Bundle[] Bundle[] getBundles(String,StringgetBundles(String,String) ) •• Bundle[] Bundle[] getFragments(BundlegetFragments(Bundle))•• Bundle[] Bundle[] getHosts(BundlegetHosts(Bundle))•• Bundle Bundle getBundle(ClassgetBundle(Class))•• intint getBundleType(BundlegetBundleType(Bundle))
•• New fieldNew field–– PackageAdminPackageAdmin: BUNDLE_TYPE_FRAGMENT : BUNDLE_TYPE_FRAGMENT
Conditional Permission AdminConditional Permission Admin
•• New model of permission management based upon New model of permission management based upon conditionsconditions
–– If a condition evaluates to true, then the permissions If a condition evaluates to true, then the permissions ““guardedguarded””by the condition are evaluated as part of the bundleby the condition are evaluated as part of the bundle’’s Protection s Protection DomainDomain
•• Conditions can be Conditions can be –– Mutable: the results of an evaluation of the condition must not Mutable: the results of an evaluation of the condition must not
be cached and may changebe cached and may change–– Postponed: evaluating the condition must be postponed to the Postponed: evaluating the condition must be postponed to the
end of the end of the checkPermissioncheckPermission actionaction
•• Can be used instead of Permission Admin or in addition toCan be used instead of Permission Admin or in addition to–– Permission Admin will be deprecated in the future Permission Admin will be deprecated in the future
Specified ConditionsSpecified Conditions
•• BundleLocationConditionBundleLocationCondition–– Guards a set of permission based upon a bundle Guards a set of permission based upon a bundle
location patternlocation pattern–– [[BundleLocationConditionBundleLocationCondition ““http://http://www.osgi.orgwww.osgi.org/*/*””]]
•• BundleSignerConditionBundleSignerCondition–– Guards a set of permissions based upon the signer of Guards a set of permissions based upon the signer of
a bundle using DN chain matchinga bundle using DN chain matching–– [[BundleSignerConditionBundleSignerCondition ““*, o=OSGi Alliance, c=US*, o=OSGi Alliance, c=US””]]
•• Mobile Specification will also define additional Mobile Specification will also define additional mobile specific conditionsmobile specific conditions
Permission Admin UpdatePermission Admin Update
• Permission Info was updated to allow white space in the encoded format.
• The Package Admin methods which change the permissions now require the caller to have AllPermission
Service CompendiumService Compendium
•• Log ServiceLog Service•• Http ServiceHttp Service•• Device AccessDevice Access•• Configuration AdminConfiguration Admin•• Preferences ServicePreferences Service•• MetatypeMetatype•• Wire AdminWire Admin•• User AdminUser Admin•• IO ConnectorIO Connector
•• Initial ProvisioningInitial Provisioning•• UPnP DeviceUPnP Device•• Declarative ServicesDeclarative Services•• Event AdminEvent Admin•• Service TrackerService Tracker•• XML ParserXML Parser•• PositionPosition•• Measurement and StateMeasurement and State•• Execution EnvironmentsExecution Environments
Defines the compendium of OSGi defined servicesDefines the compendium of OSGi defined services•• Will be updated from time to time as new Will be updated from time to time as new servicesservices
are finalizedare finalized
New
Updated
Updated
Updated
Updated
Updated
New
Updated
Updated
Updated
Log Service UpdateLog Service Update
• New FrameworkEvent type strings are defined
• New BundleEvent type strings are defined
Http Service UpdateHttp Service Update
• NamespaceException has been updated to add getCause method
• AdminPermission references were updated to specify the new RESOURCE action
Configuration Admin UpdateConfiguration Admin Update
• Added a ConfigurationListener service that receives ConfigurationEvent objects when Configuration Admin events occur
• Added a new ConfigurationPermission class which replaces the use of AdminPermission
• ConfigurationException has been updated to add getCause method
Preferences Service UpdatePreferences Service Update
• Root nodes can be removed with Preferences.removeNode
– This allows a user root node to be removed when a user has been removed
• BackingStoreException has been updated to add getCause method
MetatypeMetatype UpdateUpdate
• Significantly expanded and now provides a service. • MetaTypeService provides MetaTypeInformation
from – Bundles containing an XML entry– MetaTypeProvider interface based on ManagedService
and ManagedServiceFactory services• A standardized XML schema to define Metatypes
as well as related instances
UPnP Device UpdateUPnP Device Update
• Added a UPnPLocalStateVariable interface that represents a State Variable that is implemented locally
• Added a UnPException class– Conveys the UPnP Forum, work groups, and vendor
defined errors
Declarative ServicesDeclarative Services
•• New declarative programming model for servicesNew declarative programming model for services–– Defines service metadataDefines service metadata–– Addresses performance concernsAddresses performance concerns–– Simplifies programming model for using servicesSimplifies programming model for using services
•• Fully integrates with existing procedural modelFully integrates with existing procedural model
New
Service MetadataService Metadata
•• The procedural model provides no metadata within The procedural model provides no metadata within a bundle which describes the services it can a bundle which describes the services it can provide and the services it will consumeprovide and the services it will consume–– So the framework or a management system does not So the framework or a management system does not
know what services, if any, a bundle may provide or know what services, if any, a bundle may provide or consume until the bundle executes and calls the consume until the bundle executes and calls the frameworkframework
PerformancePerformance
•• The procedural model requires that bundles must The procedural model requires that bundles must be started and execute in order to publish a servicebe started and execute in order to publish a service–– This means the bundle must have a class loader, This means the bundle must have a class loader,
classes must be loaded and objects instantiated and classes must be loaded and objects instantiated and some code executed which will explicitly publish the some code executed which will explicitly publish the serviceservice
–– From a performance view, this is undesirable. We would From a performance view, this is undesirable. We would rather be able to declaratively specify that a bundle will rather be able to declaratively specify that a bundle will publish a service and thus delay creating class loaders, publish a service and thus delay creating class loaders, loading classes and instantiating objects until some loading classes and instantiating objects until some other bundle actually desires to consume the service.other bundle actually desires to consume the service.
Simplify Service Programming ModelSimplify Service Programming Model
•• The procedural model requires that programmers be OSGi The procedural model requires that programmers be OSGi literateliterate–– As the OSGi service model API is specific to OSGi, it is As the OSGi service model API is specific to OSGi, it is
problematic to entice programmers to use it. problematic to entice programmers to use it. –– Furthermore, the OSGi environment can be a very dynamic Furthermore, the OSGi environment can be a very dynamic
environment. Services and bundles can come and go during environment. Services and bundles can come and go during the lifetime of the VM. Many programmers are not prepared to the lifetime of the VM. Many programmers are not prepared to deal with such dynamism. deal with such dynamism.
•• So we provide a simplification of the programming model So we provide a simplification of the programming model for using services in OSGi so that new programmers can for using services in OSGi so that new programmers can declare their service relationships and then have them declare their service relationships and then have them managed by the runtime rather than having to write code managed by the runtime rather than having to write code to call OSGi API.to call OSGi API.
Service ComponentsService Components
•• Contained within a Contained within a bundlebundle•• Their Their lifecyclelifecycle is contained within their bundleis contained within their bundle’’s lifecycles lifecycle•• Identified by an Identified by an implementationimplementation classclass•• Optionally Optionally providesprovides a service which is registered as an a service which is registered as an
OSGi serviceOSGi service•• Optionally Optionally referencesreferences other OSGi services (which may be other OSGi services (which may be
provided by other components)provided by other components)•• Optionally Optionally configuredconfigured•• Can be Can be lazily activatedlazily activated
–– This means the creation and activation of a component can be This means the creation and activation of a component can be delayed until the component is actually used.delayed until the component is actually used.
•• Described by an Described by an XMLXML documentdocument
Example Component DescriptionsExample Component Descriptions
<?xml version="1.0" encoding="UTF-8"?><component name="com.vendor.SimpleService“>
<implementation class="com.vendor.simpleclient.impl.SimpleServiceImpl" /><service>
<provide interface="org.simpleclient.interfaces.SimpleService"/><provide interface="org.simpleclient.interfaces.SimpleService2"/>
</service><reference name="otherService"
interface="org.simpleservice.interfaces.OtherService"/></component>
<?xml version="1.0" encoding="UTF-8"?><component name="com.vendor.OtherService“>
<implementation class="com.vendor.other.impl.OtherServiceImpl" /><service>
<provide interface="org.simpleservice.interfaces.OtherService"/></service>
</component>
Event AdminEvent Admin
•• Provides an intraProvides an intra--VM, interVM, inter--bundle communication bundle communication mechanismmechanism
–– Based on the publish/subscribe model, popular in Based on the publish/subscribe model, popular in many message based systemsmany message based systems
•• Provides for nonProvides for non--durable connections between durable connections between publisher and subscriber for exactly once delivery publisher and subscriber for exactly once delivery of a messageof a message
–– Either blocking (synchronous) or nonEither blocking (synchronous) or non--blocking blocking (asynchronous) delivery(asynchronous) delivery
New
Event AdminEvent Admin
•• Event publishers are bundles which call Event Event publishers are bundles which call Event Admin service to publish their eventAdmin service to publish their event––These bundles can proxy other event publishers such as These bundles can proxy other event publishers such as native code or other processes/systemsnative code or other processes/systems
•• Event subscribers are bundles which register Event Event subscribers are bundles which register Event Handler services to receive eventsHandler services to receive events––These bundles can proxy other event subscribers such These bundles can proxy other event subscribers such as native code or other processes/systemsas native code or other processes/systems
•• Events are objects passed by reference from Events are objects passed by reference from publisher to subscriber using the Event Admin as a publisher to subscriber using the Event Admin as a brokerbroker
Service Tracker UpdateService Tracker Update
• The open(boolean) method was added– In support of module and service layer support for
multiple versions of a package concurrently exported– Normal use is open(false) which tracks services whose
packages are wired to the context bundle– Using open(true) will track all matching services even if
they cannot be cast to the types accessible by the context bundle
Minimum Execution Environment UpdateMinimum Execution Environment Update
• java.lang.InheritableThreadLocal• java.lang.ThreadLocal• java.net.URLClassLoader• java.security.GeneralSecurityException• java.security.Guard• java.security.GuardedObject• java.security.InvalidKeyException• java.security.InvalidParameterException• java.security.Key• java.security.KeyException• java.security.NoSuchAlgorithmException• java.security.NoSuchProviderException
• java.security.Provider• java.security.PublicKey• java.security.SecureClassLoader• java.security.SignatureException• java.security.cert.Certificate.CertificateRep• java.security.cert.CertificateEncodingException• java.security.cert.CertificateException• java.util.EmptyStackException• java.util.HashMap• java.util.HashSet• java.util.LinkedList• java.util.Stack• java.util.TreeMap• java.util.TreeSet
• Added classes
Minimum Execution Environment UpdateMinimum Execution Environment Update
• Updated Classes• java.security.Permission updated to also implement
java.security.Guard
Minimum Execution Environment UpdateMinimum Execution Environment Update
• java.io.DataInputStream– String readUTF(java.io.DataInput)
• java.io.File– File[] listRoots() – File getParentFile() – boolean setLastModified(long) – File[] listFiles()
• java.lang.Character– boolean isLetterOrDigit(char)
• java.lang.Class– Object[] getSigners()
• java.lang.ClassLoader– void setSigners(Class,Object[])
• java.lang.Double– boolean isInfinite()– boolean isNaN()
• java.lang.Float– boolean isInfinite() – boolean isNaN()
• java.lang.Integer– String toOctalString(int) – String toString(int,int) – Integer valueOf(String)
• java.lang.Long– String toString(long,int)
• java.lang.String– String(StringBuffer)– String toLowerCase(Locale)– String toUpperCase(Locale)– String valueOf(char[]) – String valueOf(char[], int, int)
• java.lang.Thread– int activeCount() – ClassLoader getContextClassLoader()– void setContextClassLoader(ClassLoader)
• java.lang.Throwable– String getLocalizedMessage()
• java.security.CodeSource– Certificate[] getCertificates()
• java.security.Permission– void checkGuard(Object)
• java.security.Security– int addProvider(Provider) – Provider getProvider(String) – Provider[] getProviders()– Provider[] getProviders(String)– Provider[] getProviders(Map) – int insertProviderAt(Provider,int) – void removeProvider(String)
• java.security.cert.Certificate– boolean equals(Object) – byte[] getEncoded() – PublicKey getPublicKey() – String getType() – int hashCode() – String toString() – void verify(PublicKey) – void verify(PublicKey,String) – Object writeReplace()
• java.util.Calendar– Calendar(TimeZone,Locale) – Locale[] getAvailableLocales()– Calendar getInstance(Locale) – Calendar getInstance(TimeZone,Locale)
• java.util.GregorianCalendar– GregorianCalendar(Locale) – GregorianCalendar(TimeZone,Locale)
• java.util.Locale– Locale[] getAvailableLocales() – String getDisplayCountry() – String getDisplayCountry(Locale)– String getDisplayLanguage() – String getDisplayLanguage(Locale)– String getDisplayName(Locale) – String getDisplayName() – String getDisplayVariant() – String getDisplayVariant(Locale)– String getISO3Country() – String getISO3Language() – String[] getISOCountries() – String[] getISOLanguages()
• java.util.Properties– Object setProperty(String,String)
• java.util.SimpleTimeZone– int getDSTSavings()
• Added methods
Core Specification and Service CompendiumCore Specification and Service Compendium
•• This wraps up a quick This wraps up a quick ☺☺ overview of the Core overview of the Core Specification and the Service CompendiumSpecification and the Service Compendium
•• Peter Peter KriensKriens will now provide an overview of the will now provide an overview of the forthcoming Mobile Specification and Vehicle forthcoming Mobile Specification and Vehicle SpecificationSpecification
ContentsContents
•• Why a Mobile Specification?Why a Mobile Specification?•• Overall ArchitectureOverall Architecture•• ProfileProfile•• DeploymentDeployment•• Device ManagementDevice Management•• Application ModelApplication Model•• Foreign ApplicationsForeign Applications•• Power Power ManagementManagement•• Relation to JCPRelation to JCP•• Road AheadRoad Ahead
Why a Mobile Specification?Why a Mobile Specification?
•• MIDP is very successful for mobile devicesMIDP is very successful for mobile devices–– Over 200 million devices soldOver 200 million devices sold–– Multi billion dollar marketMulti billion dollar market–– Highly ProfitableHighly Profitable
•• So who needs an So who needs an OSGiOSGi handy?handy?
Why a Mobile Specification?Why a Mobile Specification?
•• Mobile Devices are becoming very powerfulMobile Devices are becoming very powerful–– 200 200 MhzMhz+ Processors+ Processors–– Flash has become very cheapFlash has become very cheap
•• End user street prices1 End user street prices1 GbGb $68, 128 Mb $13$68, 128 Mb $13
–– Displays become bigger and more usefulDisplays become bigger and more useful–– Networked Networked
•• WifiWifi, GPRS, 3GT, UMTS, GPRS, 3GT, UMTS
•• Are games Are games thethe market for such powerful devices?market for such powerful devices?
Why a Mobile Specification?Why a Mobile Specification?
•• The next generation of mobile devices brings Enterprise The next generation of mobile devices brings Enterprise Applications into rangeApplications into range
–– Sales Support, Expert Systems, Administrative, Data Sales Support, Expert Systems, Administrative, Data Acquisition, Acquisition, ……
•• Enterprise Applications Enterprise Applications –– Are exponentially more complex than gamesAre exponentially more complex than games–– Require high security for all facetsRequire high security for all facets–– Require collaboration between different applicationsRequire collaboration between different applications–– Will connect to a myriad of devicesWill connect to a myriad of devices–– Require lots of middlewareRequire lots of middleware
•• Is MIDP up to this?Is MIDP up to this?
Why a Mobile Specification?Why a Mobile Specification?
•• Additionally there is a silent software crisis at Additionally there is a silent software crisis at device manufacturersdevice manufacturers
•• Operators require their devices to be heavily Operators require their devices to be heavily customizedcustomized
•• Managing all these configurations is a tremendous Managing all these configurations is a tremendous task that negatively influences:task that negatively influences:
–– Product development costProduct development cost–– Technical supportTechnical support–– Developing new featuresDeveloping new features
•• Is MIDP really the solution here?Is MIDP really the solution here?
Over ArchitectureOver Architecture
•• What are the required features for a Mobile What are the required features for a Mobile Software Platform?Software Platform?
•• Very High SecurityVery High Security–– Protects against virusesProtects against viruses–– Allows mixing and matching applications from different Allows mixing and matching applications from different
sourcessources•• Strong modularity support Strong modularity support
–– Applications from different sources can coexistApplications from different sources can coexist–– Share libraries in a controlled wayShare libraries in a controlled way
Why a Mobile Specification?Why a Mobile Specification?
•• Collaboration ModelCollaboration Model–– Smaller components: easier to developSmaller components: easier to develop–– Mix and match: more flexible procurementMix and match: more flexible procurement–– PluginPlugin model widens the scope of devicesmodel widens the scope of devices
•• Remote ManagementRemote Management–– Maintain quality of serviceMaintain quality of service–– After sales applicationsAfter sales applications–– Low maintenance costLow maintenance cost
•• Management by EnterprisesManagement by Enterprises–– Allow Enterprise to manage part of the deviceAllow Enterprise to manage part of the device
OSGi Service Platform
Mobile Architecture OverviewMobile Architecture Overview
Log
Deployment
EventAdmin
ApplContainer
DmtAdmin
ConfigAdmin
ApplicationAdmin
DownloadAgent
MonitorAdmin
Servicesmanagementserver
Cond. PermAdmin
Services ForeignApplications
Start Level PackageAdmin
What Was Missing In OSGi R3What Was Missing In OSGi R3
•• EndEnd--toto--end Deploymentend Deployment•• Device ManagementDevice Management•• Device MonitoringDevice Monitoring•• Application ModelApplication Model•• Foreign Application supportForeign Application support•• Security Policy Model based on mobile conditionsSecurity Policy Model based on mobile conditions
–– Subscriber (IMSI)Subscriber (IMSI)–– Device Type (IMEI)Device Type (IMEI)
SecuritySecurity
Java 2 PermissionsJava 2 PermissionsPer Bundle PermissionsPer Bundle Permissions
Each Bundle carries its own permissionsEach Bundle carries its own permissionsThis set of permissions can never be exceededThis set of permissions can never be exceeded
Bundle Signing is completely specifiedBundle Signing is completely specifiedAuthentication of bundlesAuthentication of bundles
Permission Management via:Permission Management via:SignersSignersLocation of originLocation of originCustom conditionCustom condition
R4 Core Security is equipped to handle MEG R4 Core Security is equipped to handle MEG RequirementsRequirements
SecuritySecurity
•• Provide a flexible policy Provide a flexible policy management for a delegated management for a delegated management modelmanagement model
•• An Operator must be able to An Operator must be able to sell a device to an Enterprise sell a device to an Enterprise and be assured the enterprise and be assured the enterprise can not do anything the can not do anything the Operator does not wantOperator does not want
•• The Enterprise administrator The Enterprise administrator must be able to give the device must be able to give the device to a person and restrict the to a person and restrict the possibilities furtherpossibilities further
•• Bundles must be restricted to Bundles must be restricted to only the permissions they needonly the permissions they need
Operator
Enterprise
Sales
Management domain
Bundle
Security LayerSecurity Layer
•• Signing based on Public Key Signing based on Public Key CryptographyCryptography–– Operator signs signing certificate Operator signs signing certificate
of of DeployerDeployer•• Developer adds a local permissions Developer adds a local permissions
file to the bundlefile to the bundle–– Easy to readEasy to read
•• The local permissions are audited by The local permissions are audited by the the DeployerDeployer
•• DeployerDeployer signs the bundlesigns the bundle•• The bundle gets deployed on a The bundle gets deployed on a
Service PlatformService Platform•• The permissions of the bundle are The permissions of the bundle are
the intersection of:the intersection of:–– Local permissionsLocal permissions–– System permissions for that System permissions for that
signersigner•• Operator remains in full control at all Operator remains in full control at all
timestimes
BundleA
controls
localpermissions
signature
OSGi Service Platform
systempermissionsS
Enterprise
Developer
Operator
Security LayerSecurity Layer
•• Permissions can be assigned based Permissions can be assigned based on:on:–– SignerSigner–– Location (Channel)Location (Channel)–– Custom ConditionCustom Condition
•• Multiple signers are possibleMultiple signers are possible–– Bundle gets union of signer Bundle gets union of signer
permissionspermissions•• No partial signing, all signers must No partial signing, all signers must
sign all contentsign all content•• Flexible management API for Flexible management API for
permissionspermissions•• DynamicDynamic
–– changes take effect immediatelychanges take effect immediately•• Compatible with standard Java 2 Compatible with standard Java 2
VMsVMs–– Take advantage of optimizationsTake advantage of optimizations
OSGi Service Platform
systempermissions&local
permissions
BundleA
Location, signer, custom
Security LayerSecurity Layer
•• Signer requires coarse grained to be Signer requires coarse grained to be feasiblefeasible
•• Bundle can use very fine grainedBundle can use very fine grained•• Standard PermissionsStandard Permissions
–– FilePermissionFilePermission–– RuntimePermissionRuntimePermission–– SocketPermissionSocketPermission–– ……
•• Framework permissionsFramework permissions–– AdminPermissionAdminPermission–– ServicePermissionServicePermission–– PackagePermissionPackagePermission–– BundlePermissionBundlePermission
•• Service PermissionsService Permissions–– ConfigurationPermissionConfigurationPermission–– EventPermissionEventPermission–– ApplicationPermissionApplicationPermission
Fine grained local permissions
Coarse grained system permissions
Deployment AdminDeployment Admin
•• Deployment Admin Deployment Admin –– Adds new deployment artifact: Deployment Package (DP)Adds new deployment artifact: Deployment Package (DP)–– Groups bundles, resources and other artifacts Flexible Groups bundles, resources and other artifacts Flexible
Deployment format for Deployment format for –– BundlesBundles–– MegletsMeglets–– Configuration dataConfiguration data–– Custom types with Custom types with Resource ProcessorsResource Processors
•• SignedSigned–– Tamper proofTamper proof–– SecuritySecurity
Deployment AdminDeployment Admin
•• Run custom code at installation, updated, and Run custom code at installation, updated, and uninstallationuninstallation–– Database conversionDatabase conversion–– Installation scriptsInstallation scripts
•• Fix Packs, a delta formatFix Packs, a delta format–– Reduce download timeReduce download time
•• Deployment Packages are first class citizensDeployment Packages are first class citizens•• Extensive information is available to troubleshoot Extensive information is available to troubleshoot
Deployment Admin ServiceDeployment Admin Service
•• Deployment Admin provides the Deployment Admin provides the possibility to install and update possibility to install and update Deployment PackagesDeployment Packages
•• Deployment Packages areDeployment Packages are–– A set of bundles with associated A set of bundles with associated
Resource ProcessorResource Processor–– TransactionalTransactional–– No sharing with other Deployment No sharing with other Deployment
PackagesPackages•• Resource Processors provide the Resource Processors provide the
semantics for the semantics for the bitsbitsofof the resources the resources in the JAR filein the JAR file–– Process (install)Process (install)–– Drop (uninstall)Drop (uninstall)
•• Security based on the permissions Security based on the permissions associated with the signer of the associated with the signer of the Deployment PackageDeployment Package
Depl.Admin
ResourceProcessor
DeploymentAdmin
Rrsrc.Proc.
DmtDataPlugin
EventAdmin
Autoconf
Deployment Admin ServiceDeployment Admin Service
•• Deployment PackageDeployment Package–– Based on JAR FormatBased on JAR Format
•• Manifest describes the Manifest describes the resources and associates resources and associates them with a Resource them with a Resource ProcessorProcessor
•• Fix PackagesFix Packages–– Provide only updated Provide only updated
contentscontents
manifest.mf
signer.sf
signer.rsa
bundle-A.jar
bundle-B.jar
autoconf.xml
certificates.cer
Global section
Name: bundle-A.jarSHA1-Digest: RTasy&yasi987iasj=Bundle-SymbolicName: com.acme.aBundle-Version: 2.1
Name: certificates.crSHA1-Digest: lkMjUasm87asj&jasloeDP-ResourceProcessor: com.acme.c509
CertificateProcessor
ResourceProcessor
Deployment Admin ServiceDeployment Admin Service
•• CustomizersCustomizers•• A Deployment Package can A Deployment Package can
contain its own Resource contain its own Resource Processor bundleProcessor bundle
•• This This customizercustomizer is installed and is installed and started before other bundles in started before other bundles in the Deployment Packagethe Deployment Package
•• It registers a Resource It registers a Resource Processor serviceProcessor service
•• The Deployment Admin will The Deployment Admin will only allow contents from the only allow contents from the correct DP to be processed by correct DP to be processed by the the customizercustomizer
•• The The customizercustomizer gets access to gets access to the private data area of its the private data area of its related bundlesrelated bundles
DP
Customizer
Depl.Admin
bundleA
Device ManagementDevice Management
•• The basic OSGi architecture is management The basic OSGi architecture is management protocol agnosticprotocol agnostic
–– Provides a model where many parties can participateProvides a model where many parties can participate•• What is missing is an abstraction to manage a What is missing is an abstraction to manage a
device in detaildevice in detail•• The OMA DM protocol is dominant in the mobile The OMA DM protocol is dominant in the mobile
device marketdevice market–– Will be supported by a wide range of devicesWill be supported by a wide range of devices
•• The MEG therefore supports the OMA DM The MEG therefore supports the OMA DM management model with the management model with the DmtDmt Admin ServiceAdmin Service
DmtDmt AdminAdmin
•• Generic API to manipulate Generic API to manipulate the the Device Management Device Management TreeTree–– Single consistent API for Single consistent API for
applications to interact with applications to interact with the configuration of the the configuration of the devicedevice
•• Seamless interaction with Seamless interaction with the management of the the management of the native devicenative device–– Tree can be partly Tree can be partly
implemented in the native implemented in the native device, partly in Javadevice, partly in Java
.
Device
Battery
Level
OSGi
log
query1
query2
cfg
LogConfigAdmin
Nativecode
DmtDmt AdminAdmin
•• Implementation of the tree nodes can be provided Implementation of the tree nodes can be provided by downloadable servicesby downloadable services–– Useful for extensions, accessories, optionsUseful for extensions, accessories, options
•• Extensive Meta model Extensive Meta model –– Provide rich GUIs with very little effortProvide rich GUIs with very little effort–– Validation and this reliabilityValidation and this reliability
•• TransactionalTransactional–– ReliabilityReliability–– Partly implementation specificPartly implementation specific
•• API based on OMA DMAPI based on OMA DM–– Supports other protocolsSupports other protocols
MonitoringMonitoring
•• Light weight solution for Light weight solution for bundles to provide status bundles to provide status variables to the management variables to the management systemsystem–– Free space, thread usage, Free space, thread usage,
database usagedatabase usage•• Status Variables are mapped Status Variables are mapped
to the DMTto the DMT–– Provides unified access by the Provides unified access by the
management systemmanagement system•• A schedule can be created to A schedule can be created to
query the variables at a regular query the variables at a regular intervalinterval–– DebuggingDebugging–– Performance tuningPerformance tuning–– OptimizingOptimizing
Monitorable
MonitorAdmin
MonitorAdmin
Data Plugin
Any Bundle …
Generic Application ModelGeneric Application Model
•• A generic model that is A generic model that is intended to abstract different intended to abstract different application models so they can application models so they can be treated as onebe treated as one–– Provides for third party screen Provides for third party screen
managersmanagers•• Provides for rich GUIsProvides for rich GUIs
–– Icons, help, etc.Icons, help, etc.–– Can monitor the state of Can monitor the state of
running instancesrunning instances•• Applications can be scheduled Applications can be scheduled
for execution when a specific for execution when a specific event arrivesevent arrives–– Calendar notificationCalendar notification
•• Interacts with JSR 211 Content Interacts with JSR 211 Content HandlersHandlers
ApplicationModel
Symbian
ScreenManager
MIDP 1.0 MIDP 2.0
Foreign ApplicationsForeign Applications
•• MIDP, BREW, MIDP, BREW, SymbianSymbian, DOJO, , DOJO, XLetXLet, Applet, , Applet, ……
•• An OSGi Mobile Device is An OSGi Mobile Device is required to provide application required to provide application containers for different containers for different application models.application models.
•• The Application Model The Application Model manages these applications manages these applications
•• Some models use JavaSome models use Java–– Why not provide access to Why not provide access to
OSGi functionalityOSGi functionality•• The Foreign Application Model The Foreign Application Model
defines how nondefines how non--OSGi OSGi Applications can access and Applications can access and provide servicesprovide services
–– Header usageHeader usage–– Access to Framework classAccess to Framework class
MIDP 2.0
org.osgi.applicationorg.osgi.applicationFrameworkFramework
MIDP 1.0 XLet
OSGi Vehicle ArchitectureOSGi Vehicle Architecture
•• The OSGi Vehicle Profile shares its architecture The OSGi Vehicle Profile shares its architecture with the Mobile Profilewith the Mobile Profile
•• The Vehicle Profile provides specific vehicle The Vehicle Profile provides specific vehicle oriented servicesoriented services
•• The Vehicle Profile uses many more of the Core The Vehicle Profile uses many more of the Core Compendium Services because it is more matureCompendium Services because it is more mature
•• It is likely the vertical profiles will come closer in the It is likely the vertical profiles will come closer in the futurefuture
Vehicle ProfileVehicle Profile
•• Start Level ServiceStart Level Service•• URL HandlersURL Handlers•• Package Admin ServicePackage Admin Service•• Permission Admin ServicePermission Admin Service•• Log ServiceLog Service•• Http ServiceHttp Service•• Device AccessDevice Access•• Configuration Admin ServiceConfiguration Admin Service•• Metatype(2) ServiceMetatype(2) Service•• Preference ServicePreference Service•• User Admin ServiceUser Admin Service•• Wire Admin ServiceWire Admin Service•• IO Connector ServiceIO Connector Service•• Declarative ServicesDeclarative Services•• Event Admin ServiceEvent Admin Service•• Power Management ServicePower Management Service•• Diagnostic ServiceDiagnostic Service•• Service Tracker UtilityService Tracker Utility•• XML Parser UtilityXML Parser Utility•• Position UtilityPosition Utility•• Measurement and State UtilityMeasurement and State Utility
Power ManagementPower Management
•• The power management service The power management service makes power management pluggablemakes power management pluggable
•• The system power state can be set The system power state can be set externallyexternally
–– Full PowerFull Power–– PM ActivePM Active–– SuspendSuspend–– SleepSleep–– Power offPower off
•• is mapped to different device power is mapped to different device power statestate
–– D0D0--D3 power statesD3 power states•• Power manager can take device Power manager can take device
specific capabilities in considerationspecific capabilities in consideration•• An observer bundle can follow the An observer bundle can follow the
transitions in the system and device transitions in the system and device power statepower state
Device Power State
PowerManager
System Power StateListener
Observer
Device PowerImpl
SystemPower
System Power
Device PowerState Listener
Relation to JCPRelation to JCP
•• The relation to the JCP is The relation to the JCP is troublesometroublesome
•• Several Several JSRsJSRs overlap with JSR overlap with JSR 232232
•• JSR 277 ModularizationJSR 277 Modularization–– However, long way off from However, long way off from
J2MEJ2ME•• JSR 271 MIDP 3.0JSR 271 MIDP 3.0
–– Is addressing some of the Is addressing some of the solutions that MEG providessolutions that MEG provides
•• JSR 246 OMA DM AccessJSR 246 OMA DM Access–– Based on JSR 232 Based on JSR 232 DmtDmt Admin, Admin,
but slightly differentbut slightly different–– Needs to be mergedNeeds to be merged
•• JSR 249/248 MSA CDC/CLDCJSR 249/248 MSA CDC/CLDC–– Must select JSR 232 to make Must select JSR 232 to make
MEG viableMEG viable
JSR 232OSGi MEG
JSR 277Modules
JSR 246OMA DM
JSR 271MIDP 3.0
JSR 248/249 MSA
CDC/CLDC
ConclusionConclusion
•• The Mobile and Vehicle Profiles are taking advantage of The Mobile and Vehicle Profiles are taking advantage of the powerful OSGi R4 Service Platformthe powerful OSGi R4 Service Platform
•• The Mobile Platform focuses on deployment and device The Mobile Platform focuses on deployment and device managementmanagement
–– Applications will be foreign applicationsApplications will be foreign applications–– Mobile APIs will be derived from JCP Mobile APIs will be derived from JCP JSRsJSRs
•• The Vehicle Platform provides a more extensive The Vehicle Platform provides a more extensive application environmentapplication environment
•• Both platforms provide share more than they differBoth platforms provide share more than they differ•• The OSGi Service Platform provides therefore many The OSGi Service Platform provides therefore many
opportunities for applications that can live in both markets.opportunities for applications that can live in both markets.