Transforming the Way the World Runs Applications
Total Page:16
File Type:pdf, Size:1020Kb
Transforming the Way the World Runs Applications Enterprise OSGiTM - Why should I care? Copyright © 2006-2008 Paremus Ltd Transforming the Way the World Runs Applications February 2008 ‣ OSGi - Overview ‣ OSGi - Current Enterprise Initiatives ‣ OSGi - “The Cure” or “the Final Straw”? ‣ The bigger picture ‣ Conclusions Copyright © 2006-2008 Paremus Ltd Transforming the Way the World Runs Applications February 2008 ‣ The OSGi Alliance formed in 1999 to focus on standardizing dynamic services in embedded devices; (originally started life as JSR 8!) ‣ OSGi Alliance (www.osgi.org) now has representation from most technology companies and a variety of large end user organizations. ‣ Members include IBM, RedHat, Oracle [BEA], SAP AG, Sun Microsystems, Motorola, Nokia, NEC, SpringSource Copyright © 2006-2008 Paremus Ltd Transforming the Way the World Runs Applications February 2008 Modules Life Cycle Execution One of the nicest things about OSGi is Environment Service that there isn’t much to say! Registry Bundles Copyright © 2006-2008 Paremus Ltd Transforming the Way the World Runs Applications February 2008 OSGi Execution Environment Modules The OSGi ‘Execution Environment’ may be hosted by Java 2 J2SE, CDC, CLDC, MIDP environments. Life Cycle Execution Environment Service The OSGi platform has Foundation Profile and a small number of additions Registry that specifies the minimum requirements on an execution environment to be Bundles useful for OSGi bundles. Copyright © 2006-2008 Paremus Ltd Transforming the Way the World Runs Applications February 2008 OSGi Modules Modules The ‘Modules’ layer defines the class loading policies. The OSGi Modules layer Life Cycle adds private classes for a module as well as controlled linking between Execution Environment modules. The module layer is fully integrated with the security architecture, Service Registry enabling the option to deploy closed systems, walled gardens, or completely Bundles user managed systems at the discretion of the manufacturer. Copyright © 2006-2008 Paremus Ltd Transforming the Way the World Runs Applications February 2008 OSGi Life-cycle The ‘Life Cycle’ layer adds bundles that can be dynamically installed, started, Modules stopped, updated and uninstalled. Bundles rely on the module layer for class loading but add an API to manage the modules in run time. Life Cycle Execution Environment The life-cycle layer introduces dynamics that are normally not part of an Service Registry application. Extensive dependency mechanisms are used to assure the correct Bundles operation of the environment. Life cycle operations are fully protected with the security architecture, making it virtually impossible to be attacked by viruses. Copyright © 2006-2008 Paremus Ltd Transforming the Way the World Runs Applications February 2008 Bundle Life-cycle!"#$%& '()#$*+,#-.$ /01#$23-)#$/43#5$6#5708'$9:; !"#$%&'()*+ ,-.-&'/".#%.0'1$2/3& A bundle may be in one of six states: 0'7.4)) - Installed &F(4.# $12345567 5#15#7" - Resolved # # " B . 23493$1: 7 ) 4 # - Starting 8 ( 5 7 1 F F8)0-3 ) # # ) 5 & 5 4 . 7.45. - Active 7 ' 0 4=3$>6 ' 962;5>67 - Stopping & ) ) 4 7.8F . 7 ' - Uninstalled 0 ' 23;<<$1: & 81$12345567 !"#$%&%'($)*#%+,%+$,-&**#).%+-%+,%,-/0#)%+$%-"#%1#0,+,-#$-%,-/0&2#%/3%-"#%40&5#6 7/08%&$)%0#5&+$,%-"#0#%($-+*%+-%+,%#91*+:+-*;%($+$,-&**#)<%!"#-"#0%&%'($)*#% "&,%'##$%,-&0-#)%/0%,-/11#)%5(,-%'#%0#:/0)#)%+$%-"#%1#0,+,-#$-%,-/0&2#%/3%-"#% Copyright © 2006-2008 Paremus Ltd Transforming the4 Way0&5 the #World7/ Runs08< %Applications=%'($)*#%-"&-%"&,%'##$%1#0,+,-#$-*;%0#:/0)#)February%&,%,- 2008&0-#)%5(,-%'#% ,-&0-#)%7"#$#>#0%-"#%40&5#7/08%,-&0-,%($-+*%-"#%'($)*#%+,%#91*+:+-*;% ,-/11#)<%?"#%@-&0-%A#>#*%,#0>+:#%+$3*(#$:#,%-"#%&:-(&*%,-&0-+$2%&$)%,-/11+$2% /3%'($)*#,<%@##%,-.%-'4&5&3',&%5"6&',7&6"8"6.-"92%/$%1&2# BCD<% ?"#%!"#$%&%+$-#03&:#%)#3+$#,%&%'&()(*(&+,-5#-"/)%3/0%0#-(0$+$2%&%'($)*#E,% ,-&-#<% F3%-"+,%,1#:+3+:&-+/$%(,#,%-"#%-#05%.6-"5&%-/%)#,:0+'#%&%,-&-#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*#%+)#$-+3+#0%-"&-%+,%"+2"#0%-"&$% &$;%10#>+/(,%'($)*#%+)#$-+3+#0< <=>=?< *@A0$@#5B0-#$C)4.185D$E#)#47#$; OSGi Service Registry Modules The ‘Service Registry’ provides a cooperation model for bundles that takes the dynamics into account. Life Cycle Execution Environment Service The service registry provides a comprehensive model to share local objects Registry Registry between local bundles. A number of events are defined to handle the coming Bundles and going of services. Copyright © 2006-2008 Paremus Ltd Transforming the Way the World Runs Applications February 2008 An OSGi Bundle is... ... a JAR file with some additional Metadata! ‣ Identification ‣ Bundle Classpath ‣ Bundle Life-cycle (activator if required) ‣ Dependencies (if any) ‣ Exports (if any) Copyright © 2006-2008 Paremus Ltd Transforming the Way the World Runs Applications February 2008 OSGi is ... ... Service Oriented! ‣ Bundles can publish their services dynamically; i.e. registering these with the local service registry. ‣ Bundles can “find” and then “bind” to other local services via the local service registry. ‣ Allow Services to installed and uninstalled in a running JVM! Copyright © 2006-2008 Paremus Ltd Transforming the Way the World Runs Applications February 2008 Multi-Version Support xyz-version 1.0 Jar Jar xyz-version 2.0 Jar Jar Jar Jar Jar Jar Jar Jar Copyright © 2006-2008 Paremus Ltd Transforming the Way the World Runs Applications February 2008 Hierarchical Classloader Structure Classloader Hell :( Boot Classloader System Classloader URLClassloader1 URLClassloader2 Copyright © 2006-2008 Paremus Ltd Transforming the Way the World Runs Applications February 2008 OSGi Peer Classloader • Peer classloading removes the need for bar baz jars to be artificially promoted in order for two components to see the same class foo Copyright © 2006-2008 Paremus Ltd Transforming the Way the World Runs Applications February 2008 OSGi Peer Classloader • OSGi GUARANTEES that there will only be one instance of a class for a bar foo baz given package and version Copyright © 2006-2008 Paremus Ltd Transforming the Way the World Runs Applications February 2008 Implementations ‣ Open Source Implementations ‣ Knopflerfish - www.knopflerfish.org ‣ Apache Felix - http://cwiki.apache.org/FELIX/index.html ‣ Eclipse Equinox - http://www.eclipse.org/equinox ‣ Commercial Implementations ‣ In addition to the usual suspects... ‣ Makewave - www.makewave.com ‣ Prosyst - www.prosyst.com Copyright © 2006-2008 Paremus Ltd Transforming the Way the World Runs Applications February 2008 What about JSR277? A case of re-inventing the wheel? Copyright © 2006-2008 Paremus Ltd Transforming the Way the World Runs Applications February 2008 OSGi - The most important standard of the Decade*? * SD Times - 1 June 2007 Copyright © 2006-2008 Paremus Ltd Transforming the Way the World Runs Applications February 2008 Our Conclusion ‣ An elegant, well designed, mature modular framework for composite services in a single JVM. ‣ Application Decomposition - OSGi bundles are the re- usable so4ware components "LEGO blocks#. ‣ By addressing local dynamism, OSGi provides the foundations for dynamic 2 composite SOA. Copyright © 2006-2008 Paremus Ltd Transforming the Way the World Runs Applications February 2008 ‣ OSGi - Overview ‣ OSGi - Current Enterprise Initiatives ‣ OSGi - “The Cure” or “The Final Straw”? ‣ The bigger picture ‣ Conclusions Copyright © 2006-2008 Paremus Ltd Transforming the Way the World Runs Applications February 2008 OSGi in the Enterprise ‣All Application Servers now have road-maps based on OSGi: • Commercial - IBM (WebSphere) BEA 2 Oracle (WebLogic 2 Fusion), RedHat (JBoss) • Open Source Projects - JONAS, Geronimo, Jetty, GlassFish (optional) ‣In-house developed applications using • Spring DM • Eclipse IDE ‣Third Party applications • ISV.s • Middleware Companies (Iona, MuleSource, etc). Copyright © 2006-2008 Paremus Ltd Transforming the Way the World Runs Applications February 2008 OSGi Expert Enterprise Group OSGi EEG set up Sept 2006 to address the Enterprise (BEA, IBM, Eclipse Foundation, SpringSource, Iona, Oracle, RedHat, SAP, Sun Microsystems & SAP) Some of OSGi R5 themes (2009?)... • Multi-Language Support • Classloading & Marshaling • Remote Management • State Management • Support for JNDI & JEE Copyright © 2006-2008 Paremus Ltd Transforming the Way the World Runs Applications February 2008 Java Frameworks Supporting OSGi Spring Dynamic Modules (Spring-OSGi) Felix POJO Framework (Apache OSGi project). +