an introduction to osgi
DESCRIPTION
An introduction to OSGiTRANSCRIPT
First steps in OSGiAndrea Chiodoni, 2009
martedì, 17 maggio 2011
Understand: what OSGi is, why OSGi a n d w h y i t i s s o important to the Java community.
martedì, 17 maggio 2011
AgendaJar Hell problemA definition of OSGiModularity and JavaArchitectureVersioningSample: ActivatorSample: ServiceOSGi implementationsTools for OSGiRepositoriesAdvanced topicsWhat comes next...
martedì, 17 maggio 2011
Jar Hell problemMissing Module construct at runtime: JARs are only knows at build and deploy time
Information hiding not properly enforced
Version information not consumed at runtime
Java SE/EE are subject to JAR Hell problem
JAR specification is too old for the time being (JARs are not modules)!
Bootstrap Class Loader${JAVA_HOME}/jre/lib/rt.jar
Extension Class Loader${JAVA_HOME}/jre/lib/ext/
System Class Loader${CLASSPATH}
User-Defined Class Loader(s)
Delegate to
Delegate to
Delegate to
martedì, 17 maggio 2011
Modularity and Java 1/2JSR 277: Java Module System
A new module system for Java (JAR -> JAM)Abandoned the 3.12.2008, proceed under Project Jigsaw
Project Jigsaw (OpenJDK)Many discussions around “The massive, monolithic JDK”Low-level module system to modularise the JDK 7Available for developers to use in their own codeNot an official part of the Java SE 7!Interoperate with other module systems (OSGi)Apache Harmony (based on OSGi core)
martedì, 17 maggio 2011
Modularity and Java 2/2Open Service Gateway initiative (OSGi)
from OSGi Alliance, founded 1999 (Ericsson, IBM, Oracle,...)The Dynamic Module System for JavaTarget: embedded, client, server systemsWidely adopted: even by SUN (Glassfish v3)R1 (JSR 8) in May 2000, R4.1 (JSR 291) in May 2007 (current release)Will be closer to Java (language extensions), SUN-OSGi Alliance effort (JSR 294)
martedì, 17 maggio 2011
What is OSGi
Extension of the JARModule = bundle
Naming + definitionVersioning
■ Gestione automatica delle dipendenze■ Gestione del ciclo di vita del codice (configurazione e distribuzione dinamica)
martedì, 17 maggio 2011
Layered architecture
Native Operating SystemJava VM
Execution EnvironmentModulesLife Cycle
Services Security
Bundles
martedì, 17 maggio 2011
Bundle states
Installed
Resolved
Uninstalled
Starting
Active
Stopped
install refreshupdate
refreshupdateresolve
uninstalluninstallstop
start
Explicit transitionAutomatic transition
martedì, 17 maggio 2011
Service Registry
Service Registry
Service Provider<<bundle>>
Service Requester<<bundle>>
Service Description
publish
bind
discover
martedì, 17 maggio 2011
Sample:xx
A B
<<service>><<bundle>><<bundle>>
get
listen
register S
martedì, 17 maggio 2011
Execution Environments
Eclipse EquinoxEclipseSpring DM ServermBedded Server Equinox Edition
Apache FelixServiceMix Kernel
Knopflerfish
martedì, 17 maggio 2011
Development Tools
Eclipse
Maven Bundle Plugin (Apache Felix)
http://www.springsource.com/repository
Bundle Tool (BND), http://www.aqute.biz/Code/Bnd
martedì, 17 maggio 2011
What comes next
Advanced OSGiStandard ServicesWhiteboard PatternEvent AdminExtender Model Building WEB applicationsOSGi Bundle Repository (OBR, RFC 112)
Spring Dynamic ModulesDistributed OSGi Specification (RFC 119, OSGi R4.2)SCA and OSGi
martedì, 17 maggio 2011
Referenceshttp://www.osgi.orghttp://neilbartlett.name/blog/osgibookhttp://blogs.sun.com/mrhttp://wiki.ops4j.orghttp://www.eclipse.org/equinoxhttp://www.knopflerfish.orghttp://felix.apache.orghttp://www.prosyst.comhttp://www.aqute.biz/Code/Bndhttp://www.springsource.com/repository
martedì, 17 maggio 2011