If you can't read please download the document
Upload
carl-hall
View
1.439
Download
1
Embed Size (px)
Citation preview
Introduction to OSGi and
Nakamura Services
Carl Hall, Hallway Technologies
OSGi- The Dynamic Module System for Java
what exactly is...
12th Sakai Conference Los Angeles, California June 14-16
OSGi - The Dynamic Module System for Java
Service PlatformFramework
LayersSecurity
Module
Life Cycle
Service
Actual Services
Bundles
Configuration
12th Sakai Conference Los Angeles, California June 14-16
OSGi Alliance founded 1999
Specification - 4 releasesCore: 332 pgs
Compendium: 850 pgs
Enterprise: 484 pgsTotal: 1666
12th Sakai Conference Los Angeles, California June 14-16
OSGi Containers
Apache FelixApache Karaf
Apache ServiceMix
Eclipse EquinoxEclipse Virgo (formerly Spring DM)
Knoplerfish
Concierge
Newton
Show me the details!
12th Sakai Conference Los Angeles, California June 14-16
Enough with the chatter...
12th Sakai Conference Los Angeles, California June 14-16
Manifest
12th Sakai Conference Los Angeles, California June 14-16
Bundle Life Cycle
INSTALLEDSuccessfully installed in container
RESOLVEDAll resources available; ready to start or has stopped
STARTINGActivator.start called; waiting for return
ACTIVENo errors during start; activator has returned
STOPPINGActivator.stop called; waiting for return
UNINSTALLEDCannot move to any other state
12th Sakai Conference Los Angeles, California June 14-16
Bundle Activation
12th Sakai Conference Los Angeles, California June 14-16
Components
12th Sakai Conference Los Angeles, California June 14-16
Component Execution
@Activateprotected void activate(ComponentContext cc) { }protected void activate(BundleContext bc) { }protected void activate(Map props) { }protected void activate(BundleContext b, ComponentContext c, Map props) { }
@Modifiedprotected void modified(...) {}
@Deactivateprotected void deactivate(...) {}protected void deactivate(int reasonCode) {}
// OSGi R4 Spec 112.5.8
12th Sakai Conference Los Angeles, California June 14-16
Defining a Service
// implement interfaces, provide services
12th Sakai Conference Los Angeles, California June 14-16
Configuring a Service
12th Sakai Conference Los Angeles, California June 14-16
Configuring a Service
12th Sakai Conference Los Angeles, California June 14-16
Configuring a Service
org.sakaiproject.nakamura.auth.cas.CasAuthenticationHandler.cfg
12th Sakai Conference Los Angeles, California June 14-16
Spec Defined Services
System ServicesLogging
Configuration Admin
Device Access
User Admin
IO Connector
Preferences
Component Runtime
Deployment Admin
Event Admin
Application Admin
Protocol ServicesHTTP Service
UPnP Device Service
DMT Admin
Miscellaneous ServicesWire Admin
XML Parse
Measurement and State
12th Sakai Conference Los Angeles, California June 14-16
Service Reference
//default reference settings
//optional reference
12th Sakai Conference Los Angeles, California June 14-16
Service References
//optional reference, multiple services
12th Sakai Conference Los Angeles, California June 14-16
Inverse Registration
12th Sakai Conference Los Angeles, California June 14-16
Multiple Service Impls
12th Sakai Conference Los Angeles, California June 14-16
Service Targets
Like a boss
12th Sakai Conference Los Angeles, California June 14-16
Nakamura Services
Nakamura (core)50 bundles
192 components77 configurable
244 services
Nakamura (all)101 bundles
266 components97 configurable
311 services
Nakamura + Sling121 bundles
318 components196 configurable
433 services
Click to edit the title text formatClick to edit Master title style
Click to edit the title text formatClick to edit Master title style
Click to edit the outline text formatSecond Outline LevelThird Outline LevelFourth Outline LevelFifth Outline LevelSixth Outline LevelSeventh Outline LevelEighth Outline Level
Ninth Outline LevelClick to edit Master text stylesSecond levelThird levelFourth levelFifth level
12th Sakai Conference Los Angeles, California June 14-16
Click to edit the title text formatClick to edit Master title style
Click to edit the outline text formatSecond Outline LevelThird Outline LevelFourth Outline LevelFifth Outline LevelSixth Outline LevelSeventh Outline LevelEighth Outline Level
Ninth Outline LevelClick to edit Master text styles
12th Sakai Conference Los Angeles, California June 14-16