1 / 29

Bundle Programming

Bundle Programming. By Peter Kriens CEO aQute OSGi Technology Officer and OSGi Fellow. Contents. R1. R2. R3 Preliminary. Position. XML Parser Service. Measurement. Preferences Service. User Admin. Device Manager. Http Service. Log Service. Configuration Admin. Service Tracker.

varden
Download Presentation

Bundle Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Bundle Programming By Peter Kriens CEO aQute OSGi Technology Officer and OSGi Fellow

  2. Contents

  3. R1 R2 R3 Preliminary Position XML Parser Service Measurement Preferences Service User Admin Device Manager Http Service Log Service Configuration Admin Service Tracker Wire Admin Connector Service Jini Service UPnP Service Package Admin Permission Admin URL Handler Start Level Content R1, R2, R3 OSGi Specifications Content Framework Execution Environment

  4. 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 Length implementation dependent org.osgi.service.log v1.1Log Service

  5. org.osgi.service.log v1.1Log Service a log user a log reader A log user bundle A log reader using bundle Log a message Retrieve log LogService LogEntry LogListener LogReader Service Send new log entry A log entry impl. Message log a log service impl. A log reader impl. Store a message for retrieval and broadcast Log Service Impl. bundle

  6. Provides web access to bundles A powerful servlet runner Supports Servlets Version 2.1 Very simple to export static pages and files (like images) Automatically unregisters servlets when bundle is stopped org.osgi.service.http v1.1Http Service

  7. org.osgi.service.http v1.1Http Service Impl. Of Http context Bundles main code Impl. Of servlet javax.servlet. Servlet HttpContext NameSpace Exception HttpService javax.servlet. Request/ Response An Http Service impl. Default impl. HttpContext Resource registration NameSpace alias Servlet registration

  8. 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 Selector, Driver locator org.osgi.service.device v1.1Device Access

  9. Device Access 1.1 References to install selector bundle Locator bundle Driver A device selects attach Driver Selector Driver Locator Device Device Manager

  10. 1. Insert camera 5. Install bundle Camera 3. Select device 4. find bundle location 2. register 6. register 7. attach 9. Select camera 8. Register camera Device Access Device Manager IEEE 1394B Network bundle Driver Locator Device Driver Locator Interface Driver 10. Show camera on TV TV bundle Sony CCD654 TV Camera

  11. Configures bundles At startup, or any later moment Maintains a repository of configurations Local Management system Configurations are key/value pairs Typed with Meta Types Can be extended with plugins org.osgi.service.cm v1.0Configuration Admin Service

  12. Configuration Admin client bundle client bundle Configuration bundle Plugin impl Configuration Exception Managed Service Factory Managed Service Configuration Admin Configuration Plugin 0..n 1 Configuration 1 1 Configuration Admin impl

  13. 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 org.osgi.service.metatype V1.0Meta Typing

  14. Meta Typing Class Diagram MetaType Provider 1 1..n ObjectClass Definition 1 Locale PID 1..n Attribute Definition

  15. Simple hierarchical model like Windows Registry Uses simple hierarchical names /bundle/121/httpport=81 Different trees Multiple named trees per bundle One system tree Storage can be local or on management system org.osgi.service.prefs v1.0Preferences Service

  16. org.osgi.service.prefs v1.0Preferences Service Named or System root /c2 c1 c2 /c1/d2 d1 d2 foo=8 bar=9 lex=‘acme’ properties /c1/d2 d1 /c1/d2/d1/d2 d1 d2 foo=8 bar=9 lex=‘acme’ properties /c1/d2/d1/d2

  17. Preferences Class Diagram BackingStore Exception a bundle User name 1 1 0..n Root user nodes Preferences Preferences Service Root system node 0..n 1 1 Preference Node impl. Bundle preferences nodes 0..n 1 Service impl.

  18. 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 org.osgi.service.useradmin v1.0User Admin Service

  19. User Admin Class Diagram Action impl Request Authenticator User Listener impl. Perform action Consult for authorization Authorization authenticate UserAdmin Event Receive events Basic member Has roles Role UserAdmin UserAdmin Listener Required member User Group User name Send event Role impl User impl User admin impl UserAdmin Permission Group impl

  20. Wire Admin Service (R3) • Connects Producer services to Consumer services via Wire object • Wire objects have properties for configuration WireAdmin Producer Wire Consumer

  21. Position, Measurement, State • Support classes for Wire Admin • Position • Supports GPS like position • Measurement • SI measurement system to prevent calculation errors • Error calculations • Timestamp • State

  22. Start Levels (R3) • Allows Management Agent to control startup/shutdown sequence of installed bundles • Supports many levels • System service, implemented by Framework

  23. URL Stream & Content • Manages the URLStreamHandlerFactory and URLContentHandlerFactory of Java • These factories can only be set once so the Framework must manage them • Bundles can register a URLStreamHandlerService or ContentHandler • The Framework will automatically add these to the standard set

  24. Universal Plug ‘n Play (R3) • Popular UPnP specifications adapted to OSGi Service Platform • Makes it very easy to write a UPnP control point or device • Involves registering a simple UPnPDevice service

  25. Jini (R3) • Defined how Jini devices can cooperate with an OSGi service platform • Service Platform very good environment for Jini services, but • Security issues

  26. Execution Environment (R3) • OSGi defined 2 execution environments • Minimal • Intended for really small devices • Foundation Profile • Adapted from JCP’s Foundation Profile • Finally!

  27. IO Connector Service (R3) • Adopted J2ME javax.microedition.io package • Process in JCP is intended to make this stand-alone • Connection type + address selected by a single string • Connection interfaces allows client code to adapt to different schemes • Datagram, Sockets, Servers

  28. XML Parser Service • Allows different bundles to register an XML parser • Supports finding “best” parser for a specific application • Based on standard Java JAR service

  29. aQute www.aQute.biz +46 300 39800, Peter.Kriens@aQute.biz

More Related