OSGi Service Platform Open Service Gateway initiative.

Slides:



Advertisements
Similar presentations
When Applications can Roam Freely OSGi Service Platform R4 Peter Kriens Technical Director OSGi
Advertisements

Universal Middleware Peter Kriens Technical Director OSGi
©2003 aQute, All Rights Reserved Tokyo, August 2003 : 1 OSGi Service Platform Tokyo August 28, 2003 Peter Kriens CEO aQute, OSGi Fellow
© OSGi, All Rights Reserved - Brussel Jan 22 Ertico/OSGi Tech Spec Overview: Introduction OSGi R3 and Remote Management Ertico/OSGi meeting Jan.
AQute R4 By Peter Kriens CEO aQute OSGi Technology Officer and OSGi Fellow.
SelfCon Foil no 1 Dynamic component systems 1. SelfCon Foil no 2 Pre-structured systems vs. dynamic component systems Pre-structured – emphasis on content.
OSGi Technology Hsin-Han Yang, Cheng-Yi Chien, Po-Cheng Huang.
Introduce OSGi BlueDavy
JavaScript Micro Services Simon Kaegi 27 March 2012.
CPSC 875 John D. McGregor Architecture evolution.
Component Models and Technologies Case Study: OSGI.
OSGi as a Framework for Building a Product Line: Experience and Best Practices Ruwan Linton & Afkham Azeez
Why OSGi matters for Enterprise Java Infrastructures
Apache Axis2 - OSGi Integration in WSO2 Carbon Platform
Eclipse Architecture Dwight Deugo Nesa Matic
OSGi: Open Services Gateway Initiative Richard Chapman 5 Sept
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins.
Page 1 Building Reliable Component-based Systems Chapter 4 - Component Models and Technology Chapter 4 Component Models and Technology.
Spring Dynamic Modules. Startlocation: Documentation: /1.2.1/reference/html/
Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department.
 Proteus Framework Redefining the plugin. Why a new framework?  Present approaches (e.g. OSGi) use non-standard approaches that create too many breaking.
Agenda Introduction to the Guidewire platform
An Introduction to OSGi: Creating Highly Modular Java Systems Simon Archer, IBM 15 November 2010.
OSGi.
1/151/15 ENT Metamodel Implementation & Applications ENT metamodel, prototype implementation Component substitutability checking, ENT based component comparison.
Introduction to the Atlas Platform Mobile & Pervasive Computing Laboratory Department of Computer and Information Sciences and Engineering University of.
Choon Oh Lee OSGi Service Platform. About OSGi Service Platform What it is, Where it is used, What features it provides are Today’s Content.
CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics NPRG044: OSGi framework Michal Malohlava & Pavel Parízek
@2011 Mihail L. Sichitiu1 Android Introduction Platform Overview.
OSGi & UPnP Technology 2009 Summer Ya-Lin Huang. 2 Outline What is OSGi Technology Introduction Alliance Specifications Key Benefits OSGi Framework Service.
Review: OSGi – a component framework for Java Bundle OSGi Framework Bundle Java Runtime Environment (JRE) Operating System (OS) Hardware “Dynamic Modules.
Android for Java Developers Denver Java Users Group Jan 11, Mike
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Contents 1.Introduction, architecture 2.Live demonstration 3.Extensibility.
Comparing JavaBeans and OSGi Towards an Integration of Two Complementary Component Models HUMBERTO CERVANTES JEAN-MARIE FAVRE 09/02.
OSGi Enablement for Tuscany Raymond Feng. Overview.
CPSC 875 John D. McGregor What do you do first?/ Architecture evolution.
In Pieces Breaking down monolithic applications with Spring-DM and OSGi.
Migrating Desktop The graphical framework for running grid applications Bartek Palak Poznan Supercomputing and Networking Center The.
Webservice versioning using osgi Allard Buijze, Jettro Coenradie.
Open Service Gateway Initiative (OSGi) Reporter : 林學灝 侯承育 1.
Sameera Jayasoma 18 th July, 2009 Senior Software Engineer Introduction to OSGi The Dynamic Module System for Java.
© 2002, Youngjoon Choi, RESL, Inha University Page : 1 Open Services Gateway initiative OSGi Open Services Gateway Initiative Youngjoon Choi © Realtime.
ICT Strategy Intelligent Highways: Endpoint Adapters.
SiD Workshop October 2013, SLACDmitry Onoprienko SiD Workshop SLAC, October 2013 Dmitry Onoprienko SLAC, SCA FreeHEP based software status: Jas 3, WIRED,
CPSC 875 John D. McGregor Architecture evolution.
JAVA Programming “When you are willing to make sacrifices for a great cause, you will never be alone.” Instructor: รัฐภูมิ เถื่อนถนอม
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
Migrating Desktop Bartek Palak Bartek Palak Poznan Supercomputing and Networking Center The Graphical Framework.
Slide 1 ApacheCon 2011 > Doreen Seider> Using OSGi to Build Better Software > Using OSGi to Build Better Software Lessons from a Telemedicine.
Getting Started with the Open Services Gateway Initiative (OSGi) CNT 5517 Dr. Sumi Helal, Ph.D. Professor Computer & Information Science & Engineering.
Plug-in Architectures Presented by Truc Nguyen. What’s a plug-in? “a type of program that tightly integrates with a larger application to add a special.
EUFORIA FP7-INFRASTRUCTURES , Grant Migrating Desktop Uniform Access to the Grid Marcin Płóciennik Poznan Supercomputing and Networking Center.
Impala A dynamic module framework for Java web development Phil Zoio Realsolve Solutions Devoxx 12 December, 2008.
Introduction to OSGi +ActorFrame Surya Bahadur Kathayat
© OSGi, All Rights Reserved Tech Spec Overview: Introduction Technical Specification Overview Introduction.
CPSC 875 John D. McGregor C22 - Architecture evolution.
Intro to the Atlas Platform Raja Bose Dr. Abdelsalam (Sumi) Helal January 23, 2007.
Real-Time Systems Lab. OSGi overview January 23, 2002 Sung-ho Park.
ECLIPSE RICH CLIENT PLATFORM Part 1 Introduction.
From “Hello World” to Real World : Building web apps with Spring OSGi Craig Walls The Spring Experience 2007 December 12, 2007.
Chapter 1 Introduction to Computers, Programs, and Java
OSGi: The Lifecycle Layer. The Extender Pattern
Overall Architecture and Component Model
CMPE419 Mobile Application Development
Presented by Jinpeng Zhou
ESIS Consulting LLC (C) ESIS Consulting LLC. All rights reserved
CMPE419 Mobile Application Development
Plug-In Architecture Pattern
Presentation transcript:

OSGi Service Platform Open Service Gateway initiative

Core Product RBCRBC CI B C IN G SYMCO R KINKOS...

Core Product 2.0 Core Product V 1.2 Core Product v1.0 RBCRBC CI B C IN G SYMCO R KINKOS...

Topics to cover ● Introduction ● Programming Model  Fundamentals  Collaboration ● Eclipse Equinox ● Market Interests

What is OSGi? ● A specification of a component based service oriented platform ● A Java Framework for developing Service Applications that requires:  Reliability  Large scale distribution  Wide range of devices  Collaborative development ● Created by collaboration of industry leaders (OSGi Alliance).

Industry Driven ● Home automation vendors ( ) ● Automotive Infotainment and Telematics vendors ( ) ● Mobile device vendors ( now) ● Many other vertical markets (now)

Ever wonder... Eclipse IDE Quantum Plugin Mylar Plugin Commons Collections Commons Collections 3.2 ?

Original Motivations ● Binary software portability  Low reusability of software components ● Software engineering is HARD  Software is complex  Collaboration helps ● Deployment is error prone  Deployment scripts are often too complicated and unreliable  Too much drama!!!

Fundamentals

Layering Services Life-cycle Module (bundle) Execution Environment Application s Securit y

Bundle

DictionaryService.jar (Bundle) src META-INF lib *.class *.dll, *.so, etc... *.jar MANIFEST.MF *.java

Bundles ● Packaging of Java library/service/application for deployment ( a jar file ) ● Registers zero or more services ● Services (Java interfaces) may be implemented by multiple bundles ● Search for services registered via a (LDAP-based query language. ● Fragment bundles are like attachments to a bundle-host. ● Manifest contains important information about its bundle.

Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: DictonaryService Plug-in Bundle-SymbolicName: DictonaryService Bundle-Version: Bundle-Activator: ca.intelliware.osgi.bundle.dictionary.Activator Bundle-Localization: plugin Import-Package: org.osgi.framework;version="1.3.0" Export-Package: ca.intelliware.osgi.bundle.dictionary.service Bundle-RequiredExecutionEnvironment: CDC-1.0/Foundation-1.0, OSGi/Minimum-1.1 MANIFEST.MF Sample

package ca.intelliware.osgi.bundle.dictionary; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext;... import ca.intelliware.osgi.bundle.dictionary.service.DictionaryService; public class Activator implements BundleActivator { public void start(BundleContext context) throws Exception { Properties properties = new Properties(); properties.put("Language", "English"); context.registerService(DictionaryService.class.getName(), new DictionaryServiceImpl(), properties); } public void stop(BundleContext context) throws Exception { } >

Registering a Service package ca.intelliware.osgi.bundle.dictionary; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceRegistration;... import ca.intelliware.osgi.bundle.dictionary.service.DictionaryService; public class Activator implements BundleActivator { public void start(BundleContext context) throws Exception { Properties properties = new Properties(); properties.put("Language", "English"); ServiceRegistration registration = context.registerService(DictionaryService.class.getName(), new DictionaryServiceImpl(), properties); } public void stop(BundleContext context) throws Exception { }

Locating and using a Service public class ClientActivator implements BundleActivator { public void start(BundleContext context) throws Exception { ServiceReference[] serviceReferences = context.getServiceReferences(DictionaryService.class.getName(), "(Language=*)");... ServiceReference firstServiceReference = serviceReferences[0]; DictionaryService service = (DictionaryService)context.getService(firstServiceReference); if (service.checkWord(word)) { System.out.println(word + " was correct."); } else { System.out.println(word + " was incorrect."); } context.ungetService(firstServiceReference); }...

Listening to ServiceEvent public class ServiceListenerActivator implements BundleActivator, ServiceListener { public void start(BundleContext context) throws Exception { context.addServiceListener(this); } public void stop(BundleContext context) throws Exception { context.removeServiceListener(this); } public void serviceChanged(ServiceEvent event) { int eventType = event.getType(); String serviceName = ((String[])event.getServiceReference().getProperty("objectClass"))[0]; switch (eventType) { case ServiceEvent.MODIFIED: System.out.println("service: " + serviceName + "has been modified."); case ServiceEvent.REGISTERED: System.out.println("service: " + serviceName + "has been registered."); case ServiceEvent.UNREGISTERING: System.out.println("service: " + serviceName + "has been unregistered."); default: break; }

Service Layer ● SOA Service Oriented Architecture Clarification:  OSGi Services != Web Services  OSGi Services are in-VM services ● Service Model  Services are POJO's in a bundle  Its interface is exported and registered in a Service Registry.  Discover and gets notified about services based on their interfaces and properties  Different bundles can register different implementations of the same interface. ● The OSGi Alliance provides many standardized services  Device Manager, Declarative Services, Event Admin, HTTP Service, Log Service, Metatype Service, Preferences Service, User Admin, Wire Admin, etc... Life- cycle Servic e Executi on module

Demo

Life Cycle Layer ● Controlled by the System Bundle ● Provides an API for managing bundles  Install  Resolve  Start  Stop  Refresh  Update  Uninstall Module Life- cycle Servic e Executi on

Life of a Bundle Installed Uninstalled Resolved Stopping Starting Active Bu ndl e ● Bundle started by an object of BundleActivator Type ● Manifest Header refer to this class ● BundleActivator Interface has 2 methods: start() and stop() ● BundleActivator gets a BundleContext provides access to the framework ● Framework provides Start Level Service to control start/stop of groups of applications

Traditional Class loading User-Defined ClassLoader User-Defined ClassLoader System ClassLoader Extension ClassLoader Single Parent Delegation Model Bootstrap ClassLoader classpath jre/ext java.lang.*

Class loading OSGi Style Delegation Model Bundle ClassLoader Bundle ClassLoader Bundle ClassLoader Bundle ClassLoader Parent System ClassLoader System Bundle ClassLoader importerExporter Bundle Space Boot Classpath (java.lang.*) Framework Classpath

Module Layer ● Applications and libraries are packaged in bundles (jar file) ● A classloader is assigned to each bundle for loading its classes and resources. ● Modularized Classloading  Traditional Single Parent Delegation Classloading model is inflexible ● Versioning  Raw Java cannot handle multiple versions of the same package Life cycle Module Servic e Executi on

Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: DictonaryService Plug-in Bundle-SymbolicName: DictonaryService Bundle-Version: Bundle-Activator: ca.intelliware.osgi.bundle.dictionary.Activator Bundle-Localization: plugin Import-Package: org.osgi.framework;version="1.3.0" Export-Package: ca.intelliware.osgi.bundle.dictionary.service Bundle-RequiredExecutionEnvironment: CDC-1.0/Foundation-1.0, OSGi/Minimum-1.1 MANIFEST.MF Sample

Execution Environments ● CDC-1.0/Foundation-1.0  Equals to J2ME Foundation Profile ● OSGi/Minimum-1.1  OSGi EE that is a minimal set that allows the implementation of an OSGi Framework. ● JRE-1.1, J2SE-1.2, J2SE-1.3, J2SE-1.4 ● PersonalJava-1.1, PersonalJava-1.2 ● CDC-1.0/PersonalBasis-1.0  J2ME Personal Basis Profile ● CDC-1.0/PersonalJava-1.0  J2ME Personal Java Profile Life- cycle Executi on Servic e Module

Programming Model

Object Oriented Model ● One of the challenges is managing dependencies, if we are not careful our objects can get quite tangled.

Object Oriented Model ● Coupling severely limits reuse.  Using a generic object can drag in a large number of other objects. ● Flexibility must be built by programmer  Plugin architectures

Service Oriented Architecture ● Separation of interface and implementation ● Allows swapping in alternative implementation ● Dynamically discover and bind object implementations ● Components are not coupled with implementation Client Component Implementation Component Service Contract...

Framework ● Allows applications to share a single JVM ● Dynamic classloading  Dependencies are “wired” at runtime  Compares to static classpaths ● Declarative Security  Java Security Model ● Declarative bundle dependency  Coordinated via manifest headers ● Independent life-cycle management of applications and services on a single JVM instance.

Framework and Bundles ● The framework at bundle installation time:  Security check the bundle  Reads the bundle's manifest  Installs code and resources  Resolve dependencies ● The framework at bundle runtime:  Calls the bundle's Activator to start the bundle  Manages classpath  Handles service dependencies  Calls the bundle's Activator to stop the bundle

Layering – Bigger Picture Courtesy of Michael Grammling

Collaborate or else...

Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: DictonaryService Plug-in Bundle-SymbolicName: DictonaryService Bundle-Version: Bundle-Activator: ca.intelliware.osgi.bundle.dictionary.Activator Bundle-Localization: plugin Import-Package: org.osgi.framework;version="1.3.0" Export-Package: ca.intelliware.osgi.bundle.dictionary.service Bundle-RequiredExecutionEnvironment: CDC-1.0/Foundation-1.0, OSGi/Minimum-1.1 MANIFEST.MF Sample

Component Interaction ● Bundles collaborate through:  Service objects  Package sharing ● Bundle Registry allows bundles to find and track service objects ● Framework manages the collaboration

Dependencies ● OSGi framework is a network of class loaders (one class loader per bundle). ● Complicated dependencies are “resolved” by the framework behind the scene. CommonsCollections Xerces JavaMail CommonsCollections-1.0 Xerces Commons Collections CommonsCollections-2.0 version=1.0 version=2.0 Bundle Exported package imported package Wire Constraint

Equinox

What is Equinox ● Eclipse Project  Complete implementation of OSGi R4 ● Provides the base for Eclipse plug-in Architecture  Since Eclipse 3.0 ● Eclipse 3.2 provides additional services  Device Manager, HTTP Service, Log Service, Preferences Service,... ● Eclipse Plug-in Development Environment (PDE) provides a environment for developing OSGi bundles.

Other OSGi implementations ● ProSyst ● Knopflerfish ● Gatespace Telematics – KnopflerfishPro ● Eclipse - Equinox ● Objectweb - Oscar ● Apache - Felix ● Concierge ● Oxygen ● osxa

Bundle Repositories ● OSGi Alliance  ● Oscar OBR  ● Knopflerfish bundle repository 

Market Interests

OSGi + ● OSGi + BMW = iDrive (In-car Infotainment system) ● OSGi + Siemens VDO = RIO (In-car Infotainment system) ● OSGi + Websphere = Websphere Application Server (WAS) 6.1 ● OSGi + JOnAS = JOnAS5 ● OSGi + Spring = ?... A much more comprehensive list of Markets and Solutions can be found at

My thoughts on OSGi ● Evolved WAY beyond the embedded markets ● Version management ● Encourages decoupling and collaboration ● Encourages reuse ● Think Product not Project ● Important role technologies

OSGi + Portugese Chicken = Lunch & Learn

FIN

Questions?