OSGi Specification Evolution
BJ Hargrave
OSGi Fellow
Core Platform Expert Group Chair
hargrave@us.ibm.com
©1999-2002 OSGi, All Rights Reserved
OSGi Service Gateway Release 1
May 2000
DeviceManager
HttpService
LogService
Framework
©1999-2002 OSGi, All Rights Reserved
Framework
Package Admin Permission Admin
DeviceManager
UserAdmin
ServiceTracker
ConfigurationAdmin
PreferencesService
LogService
HttpService
OSGi Service Platform Release 2
Oct 2001
©1999-2002 OSGi, All Rights Reserved
Framework
PackageAdmin Start LevelPermissionAdmin URL handler support
DeviceManager
UserAdmin
ServiceTracker
ConfigurationAdmin
PreferencesService
LogService
HttpService
IOConnectorService
Position
XMLParserService
UPnPService
JiniService
WireAdmin
Measurement
Planned Content
OSGi Service Platform Release 3
1Q 2003
Execution Environment
©1999-2002 OSGi, All Rights Reserved
R3 Document Sections
• Reference section
– Not normative
– Intended to be illustrative, define common terminology and suggest how OSGi might be
used
• Specifications section
– Normative
– Future updates to these specifications will be made backward compatible
• Proposed Specifications section
– Normative
– A proposed specification has resolved known design choices, is believed to be well
understood, has received significant review and appears to enjoy enough interest to be of
considerable value
– However, these specifications lack real life experience by multiple companies which makes
it difficult to guarantee full backward compatibility in the future.
– Implementing the proposed specifications is recommended but implementers should
consider the effects of future changes to the specification that, in worst case, will not be
backward compatible
– Deploying implementations of such standards into a disruption-sensitive environment is not
recommended
©1999-2002 OSGi, All Rights Reserved
Framework Enhancements
• Dynamic Import Package
– Package may be imported after bundle resolution
– Useful for Class.forName idiom
• Automatic import of java.* packages
• Improved native code selection algorithm
• Different default FilePermissions for
bundle data area
• Additional FrameworkEvent types
©1999-2002 OSGi, All Rights Reserved
Execution Environments
• Two execution environments are specified
• OSGi/Minimum-1.0
– Minimum execution environment that supports OSGi Framework and
basic services implementations
• CDC-1.0/Foundation-1.0
– J2ME Foundation Profile
– Proper superset of OSGi/Minimum-1.0
• Bundles written to OSGi/Minimum-1.0 will also run
on CDC-1.0/Foundation-1.0 and J2SE
©1999-2002 OSGi, All Rights Reserved
EE Comparison
J2SE
CDC-1.0/Foundation-1.0
OSGi/Minimum-1.0
©1999-2002 OSGi, All Rights Reserved
Start Level Service
• Allows a management agent to order the
startup sequence and shutdown sequence of
bundles.
• Supports a virtually unlimited number of
levels.
• The model for start levels is compatible with
the Service Platform Release 2 specifications.
©1999-2002 OSGi, All Rights Reserved
Start Level Service
Class Diagram
management
bundle
event listener
<<interface>>
Framework
Listener
StartLevel
0..*
Framework
Implementation
Framework
impl.
Framework
Event
is notified by1
0..*
start level
gets changed
0..*
©1999-2002 OSGi, All Rights Reserved
URL Stream and Content
Handlers
• Multiple bundles are allowed to register
ContentHandler objects and URLStreamHandler
objects
• Existing schemes in an OSGi Service Platform
cannot be overridden
• The life cycle of bundles is supported
• Scheme handlers and content type handlers
become unavailable when the registering bundle is
stopped
• Minimal effort is required for a bundle to provide a
new URL scheme or content type handler
©1999-2002 OSGi, All Rights Reserved
URL Stream and Content
Handlers Class Diagram
java.net.URL
java.net.URL
StreamHandler
java.net.URL
StreamHandler
Factory
java.net.URL
Connection
java.net.Content
Handler
java.net.Content
HandlerFactor
URLStream
Handler
Service
URLConnection
subclass impl.
URL Stream
Handler Proxy
impl.
Content
Handler Proxy
impl.
Stream Handler
implement.
Content
Handler
implement.
URL Stream
Handler Fact.
impl.
URL Content
handler Fact.
implement.
1
0,1
gets URLStreamHandlers from
0..*
1
gets content via
1
0,1
1 0..*
0..*
0,1
<<interface>>
URLStream
HandlerSetter
<<class>>
AbstractURLStream
creates connections of
isby
isfoundinregistryy(keyedbymime)
is called by
setURL
tracked
b
©1999-2002 OSGi, All Rights Reserved
Wire Admin
• Provides a comprehensive mechanism to link data producing
components with data consuming components in an OSGi environment
• Contains configuration data in order to allow either party to adapt to
the special needs of the wire
• Facilitates the negotiation of the data type to be used for data transfer
between producers of data and consumers of data
– Consumers and producers must be able to handle multiple data types for data exchanges
using a preferred order
• Separates connected parties from each other. Neither party is required
to hold the service object of the other party
• The interfaces are designed so that both parties, the Producer and the
Consumer services, should be easy to implement
©1999-2002 OSGi, All Rights Reserved
Wire Admin
Class Diagram
0,1
0..*
<<interface>>
Wire
<<service>>
WireAdmin
<<service>>
Consumer
1
update/polled
maintains
<<service>>
Producer
WireAdmin
Event
<<service>>
WireAdmin
Listener
Wire Admin
impl.
Producer impl.
Consumer impl.
WireAdmin
Listener impl.
Wire impl
(persistent)
0..*
Administrating
UI
0,10..*
administers
updated
poll
listens to
0..*
1
sends out events
©1999-2002 OSGi, All Rights Reserved
XML Parser Service
• Leverages existing standards in Java based XML
parsing: JAXP, SAX and DOM
• Runs unmodified JAXP code
• Easy to provide a SAX or DOM parser as well as
easy to find a matching parser
• Possible to have multiple implementations of
parsers available
• Parsers are likely to be extended in the future with
more functionality
©1999-2002 OSGi, All Rights Reserved
XML Parser Service
Class Diagram
<<class>>
SAXParser
Factory
<<class>>
Document
BuilderFactory
XMLParser
Activator
SAXParser
user
Document
Builder user
Subclass impl.
<<class>>
SAXParser
<<class>>
Document
Builder
Document
Builder impl.
SAXParser
impl.
parses with
registered by
instantiates
reads bundle META-INF
Parser Implementation
Bundle
getsgets
0..*
0..*0..*
0..*
0..*0..*
0,1 0,1
0,10,1
0..* 1 0..*1
parses with
0..* 0..*
instant. by
registered by
©1999-2002 OSGi, All Rights Reserved
Measurement
• A utility class that provides a consistent way of
handling a diverse range of measurements
• Simplifies measurements calculations
• Handles unit conflict resolution
• Handles unit coercion
• Consistent handling of error calculation and unit
types
• Uses SI units
©1999-2002 OSGi, All Rights Reserved
Measurement
Class Diagram
is of unit
UnitMeasurement
0..n 1
State
©1999-2002 OSGi, All Rights Reserved
Position
• Utility class that provides an information object
that has well defined semantics for a position
• Uses the World Geodetic System 84 as the datum
• Provides speed and track information
• Position information may have errors or may not
be measurable
• Uses SI units for all measurements
• Works within the Wire Admin service
©1999-2002 OSGi, All Rights Reserved
Position
Class Diagram
latitude
<<class>>
Position
<<class>>
Measurement
1 1
longitude
1
1 1 1
1 altitude 1
1 track 1
speed
©1999-2002 OSGi, All Rights Reserved
IO Connector Service
• Provides an intermediate layer that abstracts the
actual protocol and devices from the using bundle
• Allows third-party bundles to extend the system
with new protocols and devices
• Allows a protocol to be layered on top of lower
layer protocols or devices
• Allows the selection of actual protocol/device by
means of configuration data
• Compatible with existing standards
©1999-2002 OSGi, All Rights Reserved
IO Connector Service
Class Diagram
Connector
<<interface>>
Connection
<<interface>>
InputConnecti
on
<<interface>>
Output
Connection
<<interface>>
Stream
Connection
<<interface>>
Content
Connection
<<interface>>
Http
Connection
<<interface>>
Datagram
Connection
<<interface>>
StreamConnec-
tionNotifier
Connector
Service impl.
Impl. of
scheme
providers
Impl. of IO
user
provides io scheme 0..*
1
0..*
uses Impl. of
Connection
10..*
1
0,1
<<service>>
ConnectorService
<<service>>
ConnectionFactory
connections factory
0,1
used as default
©1999-2002 OSGi, All Rights Reserved
Jini Service
• Jini services are usable as OSGi services and
vice versa
• Jini services should not compromise OSGi
Service Platform security
• A bundle can export an OSGi service as a
Jini service
• A bundle can use an OSGi service that
represents a Jini service
©1999-2002 OSGi, All Rights Reserved
Jini Service
Class Diagram
JiniDriver
Importer impl.
JiniDriver impl.
Exporter impl.
some
service tagged
with EXPORT
Service
Registrar
Some imported
Jini service
Some
importable Jini
Service
Service
Registrar
Some
exportable Jini
service
exported
to
gets
0..*
0..*
0..*
0..*
registered
Jini Community
Jini Driver
Bundle
proxy object Service
Registrar proxy
object
0..*
1
0..*
1
0..* 0..*
sets Jini templates for requested Jini services
gets
0..* 0..*
proxy for proxy for
©1999-2002 OSGi, All Rights Reserved
UPnP Service
• Limited to device control of UPnP
– Aspects concerning the TCP/IP layer are not addressed
• OSGi services can be transparently made available
to UPnP networks
• Possible to restrict the use of UPnP to a selection of
the possible networks
• Bundles can listen to UPnP events
• Bundles can make a service available to UPnP
controllers
• Bundles can control UPnP devices
©1999-2002 OSGi, All Rights Reserved
UPnP Service
Class Diagram
<<interface>>
UPnPService
a listener
<<interface>>
UPnPAction
<<interface>>
UPnPState
Variable
<<interface>>
UPnPEvent
Listener
<<interface>>
UPnPIcon
A UPnP device
implementer
A UPnP control
point
A UPnP device
implementation
out parm
has
1
0..n 0..n
1
10..n
11..n
UPnP Base
Driver
Implementation
associatedwith
has
registers
getsregisters
listensto
0..n
1 1 0..n
has
1..n
1
0..n
1
10..n
<<service>>
UPnPDevice 0..n
0,1
child
has
in parameter
©1999-2002 OSGi, All Rights Reserved
Availability
• OSGi Service Platform Release 3
– Specification on track to be publicly available in 1Q 2003
Backup
©1999-2002 OSGi, All Rights Reserved
Framework
• Foundation of OSGi specification
• Allows applications to share a single Java VM
• Manages applications
– Life cycle, Java Packages, Security, Dependencies between
applications
• Service registry for collaboration
• Extensive notification mechanism
• Policy free
©1999-2002 OSGi, All Rights Reserved
Log Service
• Simple and small Log service for operator
• 4 Levels
– INFO, DEBUG, WARNING, ERROR
• Automatically logs framework events in a
defined way
• Other bundles can access log history
– Management bundle
– History size implementation dependent
©1999-2002 OSGi, All Rights Reserved
Log Service
Class Diagram
a log usera log user a log readera log reader
LogServiceLogService
a log service
impl.
a log service
impl.
A log entry
impl.
A log entry
impl.
A log reader
impl.
A log reader
impl.
Log Service Impl. bundle
Store a message for retrieval and broadcast
Message log
Send new log entry
A log
user bundle
A log
reader
using bundle
Log a message Retrieve log
LogReader
ServiceServi
LogReader
LogEntryLogEntry LogListenerLogListener
ce
©1999-2002 OSGi, All Rights Reserved
Http Service
• Provides web access to bundles
• A powerful servlet runner
– Supports Servlet Version 2.1
• Very simple to export static pages and files
(like images)
• Automatically unregisters servlets when
bundle is stopped
©1999-2002 OSGi, All Rights Reserved
Http Service
Class Diagram
HttpServiceHttpService
Default impl.
HttpContext
Default impl.
HttpContext
Resource
registration
Resource
registration
Servlet
registration
Servlet
registration
NameSpace
alias
NameSpace
alias
An Http
Service
impl.
An Http
Service
impl.
Impl. Of Http
context
Impl. Of Http
context
Impl. Of
servlet
Impl. Of
servlet
Bundles main
code
Bundles main
code
javax.servlet.
ServletServlet
javax.servlet.
NameSpace
ExceptionException
NameSpace
HttpContextHttpContext
javax.servlet.
Request/
Response
javax.servlet.
Request/
Response
©1999-2002 OSGi, All Rights Reserved
Device Access
• Dynamic device driver download model
• Plug & Play
– Plugged in devices identify themselves
– Device Manager will download appropriate bundle
• Matching process for best driver
• Extendable
– Driver locator
©1999-2002 OSGi, All Rights Reserved
Device Access
Class Diagram
References to install
Locator
bundle
Locator
bundle A deviceA deviceselector
bundle
selector
bundle DriverDriver
attachselects
Device
Manager
Device
Manager
DeviceDeviceDriver
Locator
Driver
Locator
Driver
Selector
Driver
Selector
©1999-2002 OSGi, All Rights Reserved
Device Access
Driver
Locator
Driver
Locator
7. attach
4. find bundle location
5. Install bundle
2. register
Camera
1. Insert camera
9. Select
camera
8. Register camera
3. Select device
Device
Manager
Sony
CCD654
Driver 6. register
TV
bundle
Camera
Device
IEEE
1394B
Network
bundle
Interface
10. Show camera
on TV
TV
©1999-2002 OSGi, All Rights Reserved
Package Admin
• Policy interface to Framework for package
administration
• Uninstalling a bundle will not withdraw
exported packages
– anymore (this was optional in Release 1)
• Inspect current state of package sharing
• Cleanup stale exported packages by
refreshing the minimum set of bundles
©1999-2002 OSGi, All Rights Reserved
Permission Admin
• Policy interface to Framework for permission
administration
• Permissions associated with bundle location
– Allows setting before bundle is downloaded
• Synchronous Bundle Listener added
– A management agent can set the permissions Just In Time
• (Simple) Serializable format for permissions
©1999-2002 OSGi, All Rights Reserved
Service Tracker
• Services register and unregister all the time
• Onus on the programmer to only use
services that are registered
• ServiceTracker simplifies this task:
– Maintains a list of active services
– Events can be overridden in subclass
• Used in almost every bundle
©1999-2002 OSGi, All Rights Reserved
Configuration Admin
• Configures bundles
– At startup, or any later moment
• Maintains a repository of configurations
– Local
– Management system
• Configurations are key/value pairs
– Can be typed with Meta Types
• Can be extended with plugins
©1999-2002 OSGi, All Rights Reserved
Configuration Admin
Class Diagram
client
bundle
client
bundle
Configuration
Admin impl
Configuration
Admin impl
Configuration
bundle
Configuration
bundle
client
bundle
client
bundle
Managed
Service
Factory
Managed
Service
Factory
ConfigurationConfiguration
1
0..n
Plugin implPlugin impl
Configuration
Exception
Configuration
Exception
Configuration
Admin
Configuration
Admin
Managed
Service
Managed
Service
Configuration
Plugin
Configuration
Plugin
1
1
©1999-2002 OSGi, All Rights Reserved
Meta Typing
• Data Descriptors for generic editors
– Configurations, Properties
• Supports
– Basic types like String, Integer, Byte, Short …
– Arrays and Vectors
• Uses LDAP Objectclass, attribute model
• Can be localized for different languages
• General validation support
©1999-2002 OSGi, All Rights Reserved
Meta Typing
Class Diagram
MetaType
Provider
MetaType
Provider
ObjectClass
Definition
ObjectClass1 1..n
Definition
Attribute
Definition
Attribute
Definition
Locale
PID
1
1..n
©1999-2002 OSGi, All Rights Reserved
Preferences Service
• Simple hierarchical model like Windows
Registry
• Uses simple hierarchical names
– /bundle/121/httpport=81
• Different trees
– Multiple named trees per bundle
– One system tree per bundle
• Implementation can store locally or on
management system
©1999-2002 OSGi, All Rights Reserved
Preferences Service
Class Diagram
BackingStore
Exception
a bundlea bundle
PreferencesPreferences
0..n
1
0..n
1
1
1
Root user nodes
Root system node
User name
BackingStore
Exception
Preferences
Service
Preferences
Service
Bundle
preferences
Bundle
preferences
Service impl.Service impl.
Preference
Node impl.
Preference
Node impl.
nodes0..n 1
©1999-2002 OSGi, All Rights Reserved
Preferences Service
Named or Systemroot
c2
d1
c1
foo=8
bar=9
lex=‘acme’
d2
d1
d1
d2
/c2
/c1/d2
properties /c1/d2
/c1/d2/d1/d2
foo=8
bar=9
lex=‘acme’
properties /c1/d2/d1/d2
©1999-2002 OSGi, All Rights Reserved
User Admin
• Repository of users
• Maintains data for authentication and other
purposes
– Private keys, passwords, bio-profile, User Preferences
• Powerful role based authorization model
– Users, group of users, and groups of groups
• Administrative functions
©1999-2002 OSGi, All Rights Reserved
User Admin Class
Diagram
Request
Authenticator
Request
Authenticator
User Listener
impl.
User Listener
impl.
User admin
impl
User admin
impl
UserAdminUserAdminRoleRole
UserUser
GroupGroup
Role implRole impl
User implUser impl
Group implGroup impl
AuthorizationAuthorization
Has roles
Send event
Basic member
Required
member
Action implAction impl
Perform action
Consult for authorization
authenticate
UserAdmin
EventEvent
UserAdmin Receive
events
UserAdmin
ListenerListener
UserAdmin
User name
UserAdmin
Permission
UserAdmin
Permission

OSGi Specification Evolution - BJ Hargrave

  • 1.
    OSGi Specification Evolution BJHargrave OSGi Fellow Core Platform Expert Group Chair hargrave@us.ibm.com
  • 2.
    ©1999-2002 OSGi, AllRights Reserved OSGi Service Gateway Release 1 May 2000 DeviceManager HttpService LogService Framework
  • 3.
    ©1999-2002 OSGi, AllRights Reserved Framework Package Admin Permission Admin DeviceManager UserAdmin ServiceTracker ConfigurationAdmin PreferencesService LogService HttpService OSGi Service Platform Release 2 Oct 2001
  • 4.
    ©1999-2002 OSGi, AllRights Reserved Framework PackageAdmin Start LevelPermissionAdmin URL handler support DeviceManager UserAdmin ServiceTracker ConfigurationAdmin PreferencesService LogService HttpService IOConnectorService Position XMLParserService UPnPService JiniService WireAdmin Measurement Planned Content OSGi Service Platform Release 3 1Q 2003 Execution Environment
  • 5.
    ©1999-2002 OSGi, AllRights Reserved R3 Document Sections • Reference section – Not normative – Intended to be illustrative, define common terminology and suggest how OSGi might be used • Specifications section – Normative – Future updates to these specifications will be made backward compatible • Proposed Specifications section – Normative – A proposed specification has resolved known design choices, is believed to be well understood, has received significant review and appears to enjoy enough interest to be of considerable value – However, these specifications lack real life experience by multiple companies which makes it difficult to guarantee full backward compatibility in the future. – Implementing the proposed specifications is recommended but implementers should consider the effects of future changes to the specification that, in worst case, will not be backward compatible – Deploying implementations of such standards into a disruption-sensitive environment is not recommended
  • 6.
    ©1999-2002 OSGi, AllRights Reserved Framework Enhancements • Dynamic Import Package – Package may be imported after bundle resolution – Useful for Class.forName idiom • Automatic import of java.* packages • Improved native code selection algorithm • Different default FilePermissions for bundle data area • Additional FrameworkEvent types
  • 7.
    ©1999-2002 OSGi, AllRights Reserved Execution Environments • Two execution environments are specified • OSGi/Minimum-1.0 – Minimum execution environment that supports OSGi Framework and basic services implementations • CDC-1.0/Foundation-1.0 – J2ME Foundation Profile – Proper superset of OSGi/Minimum-1.0 • Bundles written to OSGi/Minimum-1.0 will also run on CDC-1.0/Foundation-1.0 and J2SE
  • 8.
    ©1999-2002 OSGi, AllRights Reserved EE Comparison J2SE CDC-1.0/Foundation-1.0 OSGi/Minimum-1.0
  • 9.
    ©1999-2002 OSGi, AllRights Reserved Start Level Service • Allows a management agent to order the startup sequence and shutdown sequence of bundles. • Supports a virtually unlimited number of levels. • The model for start levels is compatible with the Service Platform Release 2 specifications.
  • 10.
    ©1999-2002 OSGi, AllRights Reserved Start Level Service Class Diagram management bundle event listener <<interface>> Framework Listener StartLevel 0..* Framework Implementation Framework impl. Framework Event is notified by1 0..* start level gets changed 0..*
  • 11.
    ©1999-2002 OSGi, AllRights Reserved URL Stream and Content Handlers • Multiple bundles are allowed to register ContentHandler objects and URLStreamHandler objects • Existing schemes in an OSGi Service Platform cannot be overridden • The life cycle of bundles is supported • Scheme handlers and content type handlers become unavailable when the registering bundle is stopped • Minimal effort is required for a bundle to provide a new URL scheme or content type handler
  • 12.
    ©1999-2002 OSGi, AllRights Reserved URL Stream and Content Handlers Class Diagram java.net.URL java.net.URL StreamHandler java.net.URL StreamHandler Factory java.net.URL Connection java.net.Content Handler java.net.Content HandlerFactor URLStream Handler Service URLConnection subclass impl. URL Stream Handler Proxy impl. Content Handler Proxy impl. Stream Handler implement. Content Handler implement. URL Stream Handler Fact. impl. URL Content handler Fact. implement. 1 0,1 gets URLStreamHandlers from 0..* 1 gets content via 1 0,1 1 0..* 0..* 0,1 <<interface>> URLStream HandlerSetter <<class>> AbstractURLStream creates connections of isby isfoundinregistryy(keyedbymime) is called by setURL tracked b
  • 13.
    ©1999-2002 OSGi, AllRights Reserved Wire Admin • Provides a comprehensive mechanism to link data producing components with data consuming components in an OSGi environment • Contains configuration data in order to allow either party to adapt to the special needs of the wire • Facilitates the negotiation of the data type to be used for data transfer between producers of data and consumers of data – Consumers and producers must be able to handle multiple data types for data exchanges using a preferred order • Separates connected parties from each other. Neither party is required to hold the service object of the other party • The interfaces are designed so that both parties, the Producer and the Consumer services, should be easy to implement
  • 14.
    ©1999-2002 OSGi, AllRights Reserved Wire Admin Class Diagram 0,1 0..* <<interface>> Wire <<service>> WireAdmin <<service>> Consumer 1 update/polled maintains <<service>> Producer WireAdmin Event <<service>> WireAdmin Listener Wire Admin impl. Producer impl. Consumer impl. WireAdmin Listener impl. Wire impl (persistent) 0..* Administrating UI 0,10..* administers updated poll listens to 0..* 1 sends out events
  • 15.
    ©1999-2002 OSGi, AllRights Reserved XML Parser Service • Leverages existing standards in Java based XML parsing: JAXP, SAX and DOM • Runs unmodified JAXP code • Easy to provide a SAX or DOM parser as well as easy to find a matching parser • Possible to have multiple implementations of parsers available • Parsers are likely to be extended in the future with more functionality
  • 16.
    ©1999-2002 OSGi, AllRights Reserved XML Parser Service Class Diagram <<class>> SAXParser Factory <<class>> Document BuilderFactory XMLParser Activator SAXParser user Document Builder user Subclass impl. <<class>> SAXParser <<class>> Document Builder Document Builder impl. SAXParser impl. parses with registered by instantiates reads bundle META-INF Parser Implementation Bundle getsgets 0..* 0..*0..* 0..* 0..*0..* 0,1 0,1 0,10,1 0..* 1 0..*1 parses with 0..* 0..* instant. by registered by
  • 17.
    ©1999-2002 OSGi, AllRights Reserved Measurement • A utility class that provides a consistent way of handling a diverse range of measurements • Simplifies measurements calculations • Handles unit conflict resolution • Handles unit coercion • Consistent handling of error calculation and unit types • Uses SI units
  • 18.
    ©1999-2002 OSGi, AllRights Reserved Measurement Class Diagram is of unit UnitMeasurement 0..n 1 State
  • 19.
    ©1999-2002 OSGi, AllRights Reserved Position • Utility class that provides an information object that has well defined semantics for a position • Uses the World Geodetic System 84 as the datum • Provides speed and track information • Position information may have errors or may not be measurable • Uses SI units for all measurements • Works within the Wire Admin service
  • 20.
    ©1999-2002 OSGi, AllRights Reserved Position Class Diagram latitude <<class>> Position <<class>> Measurement 1 1 longitude 1 1 1 1 1 altitude 1 1 track 1 speed
  • 21.
    ©1999-2002 OSGi, AllRights Reserved IO Connector Service • Provides an intermediate layer that abstracts the actual protocol and devices from the using bundle • Allows third-party bundles to extend the system with new protocols and devices • Allows a protocol to be layered on top of lower layer protocols or devices • Allows the selection of actual protocol/device by means of configuration data • Compatible with existing standards
  • 22.
    ©1999-2002 OSGi, AllRights Reserved IO Connector Service Class Diagram Connector <<interface>> Connection <<interface>> InputConnecti on <<interface>> Output Connection <<interface>> Stream Connection <<interface>> Content Connection <<interface>> Http Connection <<interface>> Datagram Connection <<interface>> StreamConnec- tionNotifier Connector Service impl. Impl. of scheme providers Impl. of IO user provides io scheme 0..* 1 0..* uses Impl. of Connection 10..* 1 0,1 <<service>> ConnectorService <<service>> ConnectionFactory connections factory 0,1 used as default
  • 23.
    ©1999-2002 OSGi, AllRights Reserved Jini Service • Jini services are usable as OSGi services and vice versa • Jini services should not compromise OSGi Service Platform security • A bundle can export an OSGi service as a Jini service • A bundle can use an OSGi service that represents a Jini service
  • 24.
    ©1999-2002 OSGi, AllRights Reserved Jini Service Class Diagram JiniDriver Importer impl. JiniDriver impl. Exporter impl. some service tagged with EXPORT Service Registrar Some imported Jini service Some importable Jini Service Service Registrar Some exportable Jini service exported to gets 0..* 0..* 0..* 0..* registered Jini Community Jini Driver Bundle proxy object Service Registrar proxy object 0..* 1 0..* 1 0..* 0..* sets Jini templates for requested Jini services gets 0..* 0..* proxy for proxy for
  • 25.
    ©1999-2002 OSGi, AllRights Reserved UPnP Service • Limited to device control of UPnP – Aspects concerning the TCP/IP layer are not addressed • OSGi services can be transparently made available to UPnP networks • Possible to restrict the use of UPnP to a selection of the possible networks • Bundles can listen to UPnP events • Bundles can make a service available to UPnP controllers • Bundles can control UPnP devices
  • 26.
    ©1999-2002 OSGi, AllRights Reserved UPnP Service Class Diagram <<interface>> UPnPService a listener <<interface>> UPnPAction <<interface>> UPnPState Variable <<interface>> UPnPEvent Listener <<interface>> UPnPIcon A UPnP device implementer A UPnP control point A UPnP device implementation out parm has 1 0..n 0..n 1 10..n 11..n UPnP Base Driver Implementation associatedwith has registers getsregisters listensto 0..n 1 1 0..n has 1..n 1 0..n 1 10..n <<service>> UPnPDevice 0..n 0,1 child has in parameter
  • 27.
    ©1999-2002 OSGi, AllRights Reserved Availability • OSGi Service Platform Release 3 – Specification on track to be publicly available in 1Q 2003
  • 28.
  • 29.
    ©1999-2002 OSGi, AllRights Reserved Framework • Foundation of OSGi specification • Allows applications to share a single Java VM • Manages applications – Life cycle, Java Packages, Security, Dependencies between applications • Service registry for collaboration • Extensive notification mechanism • Policy free
  • 30.
    ©1999-2002 OSGi, AllRights Reserved Log Service • Simple and small Log service for operator • 4 Levels – INFO, DEBUG, WARNING, ERROR • Automatically logs framework events in a defined way • Other bundles can access log history – Management bundle – History size implementation dependent
  • 31.
    ©1999-2002 OSGi, AllRights Reserved Log Service Class Diagram a log usera log user a log readera log reader LogServiceLogService a log service impl. a log service impl. A log entry impl. A log entry impl. A log reader impl. A log reader impl. Log Service Impl. bundle Store a message for retrieval and broadcast Message log Send new log entry A log user bundle A log reader using bundle Log a message Retrieve log LogReader ServiceServi LogReader LogEntryLogEntry LogListenerLogListener ce
  • 32.
    ©1999-2002 OSGi, AllRights Reserved Http Service • Provides web access to bundles • A powerful servlet runner – Supports Servlet Version 2.1 • Very simple to export static pages and files (like images) • Automatically unregisters servlets when bundle is stopped
  • 33.
    ©1999-2002 OSGi, AllRights Reserved Http Service Class Diagram HttpServiceHttpService Default impl. HttpContext Default impl. HttpContext Resource registration Resource registration Servlet registration Servlet registration NameSpace alias NameSpace alias An Http Service impl. An Http Service impl. Impl. Of Http context Impl. Of Http context Impl. Of servlet Impl. Of servlet Bundles main code Bundles main code javax.servlet. ServletServlet javax.servlet. NameSpace ExceptionException NameSpace HttpContextHttpContext javax.servlet. Request/ Response javax.servlet. Request/ Response
  • 34.
    ©1999-2002 OSGi, AllRights Reserved Device Access • Dynamic device driver download model • Plug & Play – Plugged in devices identify themselves – Device Manager will download appropriate bundle • Matching process for best driver • Extendable – Driver locator
  • 35.
    ©1999-2002 OSGi, AllRights Reserved Device Access Class Diagram References to install Locator bundle Locator bundle A deviceA deviceselector bundle selector bundle DriverDriver attachselects Device Manager Device Manager DeviceDeviceDriver Locator Driver Locator Driver Selector Driver Selector
  • 36.
    ©1999-2002 OSGi, AllRights Reserved Device Access Driver Locator Driver Locator 7. attach 4. find bundle location 5. Install bundle 2. register Camera 1. Insert camera 9. Select camera 8. Register camera 3. Select device Device Manager Sony CCD654 Driver 6. register TV bundle Camera Device IEEE 1394B Network bundle Interface 10. Show camera on TV TV
  • 37.
    ©1999-2002 OSGi, AllRights Reserved Package Admin • Policy interface to Framework for package administration • Uninstalling a bundle will not withdraw exported packages – anymore (this was optional in Release 1) • Inspect current state of package sharing • Cleanup stale exported packages by refreshing the minimum set of bundles
  • 38.
    ©1999-2002 OSGi, AllRights Reserved Permission Admin • Policy interface to Framework for permission administration • Permissions associated with bundle location – Allows setting before bundle is downloaded • Synchronous Bundle Listener added – A management agent can set the permissions Just In Time • (Simple) Serializable format for permissions
  • 39.
    ©1999-2002 OSGi, AllRights Reserved Service Tracker • Services register and unregister all the time • Onus on the programmer to only use services that are registered • ServiceTracker simplifies this task: – Maintains a list of active services – Events can be overridden in subclass • Used in almost every bundle
  • 40.
    ©1999-2002 OSGi, AllRights Reserved Configuration Admin • Configures bundles – At startup, or any later moment • Maintains a repository of configurations – Local – Management system • Configurations are key/value pairs – Can be typed with Meta Types • Can be extended with plugins
  • 41.
    ©1999-2002 OSGi, AllRights Reserved Configuration Admin Class Diagram client bundle client bundle Configuration Admin impl Configuration Admin impl Configuration bundle Configuration bundle client bundle client bundle Managed Service Factory Managed Service Factory ConfigurationConfiguration 1 0..n Plugin implPlugin impl Configuration Exception Configuration Exception Configuration Admin Configuration Admin Managed Service Managed Service Configuration Plugin Configuration Plugin 1 1
  • 42.
    ©1999-2002 OSGi, AllRights Reserved Meta Typing • Data Descriptors for generic editors – Configurations, Properties • Supports – Basic types like String, Integer, Byte, Short … – Arrays and Vectors • Uses LDAP Objectclass, attribute model • Can be localized for different languages • General validation support
  • 43.
    ©1999-2002 OSGi, AllRights Reserved Meta Typing Class Diagram MetaType Provider MetaType Provider ObjectClass Definition ObjectClass1 1..n Definition Attribute Definition Attribute Definition Locale PID 1 1..n
  • 44.
    ©1999-2002 OSGi, AllRights Reserved Preferences Service • Simple hierarchical model like Windows Registry • Uses simple hierarchical names – /bundle/121/httpport=81 • Different trees – Multiple named trees per bundle – One system tree per bundle • Implementation can store locally or on management system
  • 45.
    ©1999-2002 OSGi, AllRights Reserved Preferences Service Class Diagram BackingStore Exception a bundlea bundle PreferencesPreferences 0..n 1 0..n 1 1 1 Root user nodes Root system node User name BackingStore Exception Preferences Service Preferences Service Bundle preferences Bundle preferences Service impl.Service impl. Preference Node impl. Preference Node impl. nodes0..n 1
  • 46.
    ©1999-2002 OSGi, AllRights Reserved Preferences Service Named or Systemroot c2 d1 c1 foo=8 bar=9 lex=‘acme’ d2 d1 d1 d2 /c2 /c1/d2 properties /c1/d2 /c1/d2/d1/d2 foo=8 bar=9 lex=‘acme’ properties /c1/d2/d1/d2
  • 47.
    ©1999-2002 OSGi, AllRights Reserved User Admin • Repository of users • Maintains data for authentication and other purposes – Private keys, passwords, bio-profile, User Preferences • Powerful role based authorization model – Users, group of users, and groups of groups • Administrative functions
  • 48.
    ©1999-2002 OSGi, AllRights Reserved User Admin Class Diagram Request Authenticator Request Authenticator User Listener impl. User Listener impl. User admin impl User admin impl UserAdminUserAdminRoleRole UserUser GroupGroup Role implRole impl User implUser impl Group implGroup impl AuthorizationAuthorization Has roles Send event Basic member Required member Action implAction impl Perform action Consult for authorization authenticate UserAdmin EventEvent UserAdmin Receive events UserAdmin ListenerListener UserAdmin User name UserAdmin Permission UserAdmin Permission