Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "AQute Bundle Programming By Peter Kriens CEO aQute OSGi Technology Officer and OSGi Fellow."— Presentation transcript:

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

2 © aQute, All Rights Reserved slide #2 Contents

3 © aQute, All Rights Reserved slide #3 Content R1, R2, R3 Framework OSGi Specifications Content Execution Environment Device ManagerLog ServiceHttp Service R1 User Admin Service TrackerConfiguration Admin Preferences Service Package AdminPermission Admin R2 Connector Service Position XML Parser Service UPnP ServiceJini ServiceWire Admin Measurement Start LevelURL Handler R3 Preliminary

4 © aQute, All Rights Reserved slide #4 org.osgi.service.log v1.1 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 –Length implementation dependent

5 © aQute, All Rights Reserved slide #5 org.osgi.service.log v1.1 Log Service a log user a log reader LogService LogEntry LogListener LogReader Service LogReader Service 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 Log a message Store a message for retrieval and broadcast Message log Send new log entry Retrieve log A log user bundle A log reader using bundle

6 © aQute, All Rights Reserved slide #6 org.osgi.service.http v1.1 Http Service 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

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

8 © aQute, All Rights Reserved slide #8 org.osgi.service.device v1.1 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 Selector, Driver locator

9 © aQute, All Rights Reserved slide #9 Device Access 1.1 Locator bundle Locator bundle Device Manager Device Manager Device A device Driver Locator Driver Locator selector bundle selector bundle Driver Selector Driver Selector Driver References to install selectsattach

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

11 © aQute, All Rights Reserved slide #11 org.osgi.service.cm v1.0 Configuration Admin Service 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

12 © aQute, All Rights Reserved slide #12 Configuration Admin client bundle client bundle Configuration Admin impl Configuration Admin impl Configuration Admin Configuration Admin Configuration bundle Configuration bundle Managed Service Managed Service client bundle client bundle Managed Service Factory Managed Service Factory Configuration n Configuration Plugin Configuration Plugin Plugin impl Configuration Exception Configuration Exception

13 © aQute, All Rights Reserved slide #13 org.osgi.service.metatype V1.0 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

14 © aQute, All Rights Reserved slide #14 Meta Typing Class Diagram MetaType Provider MetaType Provider ObjectClass Definition ObjectClass Definition Attribute Definition Attribute Definition 1..n 1 1 Locale PID

15 © aQute, All Rights Reserved slide #15 org.osgi.service.prefs v1.0 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 Storage can be local or on management system

16 © aQute, All Rights Reserved slide #16 org.osgi.service.prefs v1.0 Preferences Service root Named or System c2 /c2 d1 c1 /c1/d2 foo=8 bar=9 lex=acme d2 d1 foo=8 bar=9 lex=acme d2 properties /c1/d2 /c1/d2/d1/d2 properties /c1/d2/d1/d2

17 © aQute, All Rights Reserved slide #17 Preferences Class Diagram BackingStore Exception BackingStore Exception a bundle Preferences Service Preferences Service Bundle preferences Bundle preferences Service impl. Preference Node impl. Preference Node impl. Preferences nodes 0..n Root user nodes Root system node User name

18 © aQute, All Rights Reserved slide #18 org.osgi.service.useradmin v1.0 User Admin Service 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

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

20 © aQute, All Rights Reserved slide #20 Wire Admin Service (R3) Connects Producer services to Consumer services via Wire object Wire objects have properties for configuration WireAdmin Producer Consumer Wire

21 © aQute, All Rights Reserved slide #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 © aQute, All Rights Reserved slide #22 Start Levels (R3) Allows Management Agent to control startup/shutdown sequence of installed bundles Supports many levels System service, implemented by Framework

23 © aQute, All Rights Reserved slide #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 © aQute, All Rights Reserved slide #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 © aQute, All Rights Reserved slide #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 © aQute, All Rights Reserved slide #26 Execution Environment (R3) OSGi defined 2 execution environments Minimal –Intended for really small devices Foundation Profile –Adapted from JCPs Foundation Profile Finally!

27 © aQute, All Rights Reserved slide #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 © aQute, All Rights Reserved slide #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, All Rights Reserved slide #29 aQute ,


Download ppt "AQute Bundle Programming By Peter Kriens CEO aQute OSGi Technology Officer and OSGi Fellow."

Similar presentations


Ads by Google