Introduction to-osgi
Upcoming SlideShare
Loading in...5
×
 

Introduction to-osgi

on

  • 6,511 views

Introduction to OSGi and Apache Karaf Runtime.

Introduction to OSGi and Apache Karaf Runtime.

Statistics

Views

Total Views
6,511
Views on SlideShare
6,504
Embed Views
7

Actions

Likes
13
Downloads
228
Comments
1

2 Embeds 7

http://www.linkedin.com 6
http://paper.li 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Having some jars, without having informations as version or what are the 'required' runtime dependencies, is like having a cooking recipe which only contains raw ingredients.
    Unfortunately I need some more information to cook a 'pastitsio' than 'it contains spaghetti'.

    Unfortunately this how class loading works, you throw raw materials into the class-path and you pray that somehow things are going to work.

    This was a short explanation to an example contained in the presentation that probably did not make any sense.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Introduction to-osgi Introduction to-osgi Presentation Transcript

  • Introduction to OSGi using Apache Karaf
    Ioannis Canellos
    JHUG / 16 April 2011
  • Presenting today…
    OSGi
    Open Services Gateway initiative, since 1999
    Initially targeted embedded devices
    OSGi containers: Felix, Equinox, Knoperfish, Concierge
    Most known use is Eclipse IDE
    Apache Karaf
    Apache OSGi runtime runs on any OSGi container
    Born inside Service Mix, now is Top level project
    Standard runtime for Geronimo, Service Mix, Sling
    Ecosystem for deploying OSGi/EE applications
  • Part I
    Introduction to OSGi
  • Introduction to OSGi
    Problem
    Solution
    Architecture
    Tools
    OSGi in the Enterprise
    Questions & Answers
  • The problemaspects
    Dependency management
    Version Hell
    Conflicting dependencies
    Class loading issues
    Dynamic behavior
    Difficulties to control component lifecycle
    Lack of a pure modularity solution
  • The problemsDependency management
    Large number of transitive dependencies
    Conflicts among among dependencies
    Class loading issues
    Boot class loader
    JTA
    System class loader
    JTA
    war
    war
  • The problemsDynamic Behavior
    Components & Services need come and go
    Components need to get updated / replaced
    Components need to started / stopped
    Real life examples
    Eclipse IDE
    Adding/Removing “plugins”
    Ebay
    Multiple version of the same component
  • The problemsModularity
    The JVM does not address need for modularity
    The class path paradox
    The jar is a “black box”
    No dependencies & No version
    The pastitsioexample
    The “WORA” promise was repeatedly failed
    JavaBeans
    EJBs
    Has the quest for modularity failed ?
    Project Jigsaw will be shipped with JDK 8
    OSGi is already here
  • The OSGi SolutionOverview
    A Layer …
    A deployment infrastructure
    Bundles = class + metadata (import/exports)
    Bundles have a lifecycle
    Bundles have their own Class loader
    Class loading delegation between dependant bundles
    A service platform
    Defines a Service Registry
    Bundles provide or request services
    The service can “come and go”
  • Architecture
  • Architecture Execution Environment
    The Runtime where the bundles live
    A bundle can bound to an Execution Environment
    JRE-1.5
    J
    JRE-1.3
    OSGi/Minimum-1.0
  • Architecture Module Layer
    Bundles import, export or have private packages
    Each package can be assigned version range
    A bundle (fragment)can be attached to a bundle (host)
    Export Package
    javax.transaction 1.01B
    Import Package
    javax.transaction [1.0,1.1)
    Export Package
    javax.transaction 1.1
    Bundle Name: JMS API
    Import Package: javax.transaction
    Export Package: javax.jms
    Bundle-RequiredExecutionEnvironment: J2SE-1.5
  • Architecture Module Layera MANIFEST.MF example
    Manifest-Version:1.0
    Import-Package:
    javax.transaction;version="1.1”, javax.transaction.xa;version="1.1”
    Export-Package:
    javax.jms;version="1.1”
    Bundle-SymbolicName:org.apache.geronimo.specs.geronimo-jms_1.1_spec
    Tool:Bnd-0.0.227
  • Installed
    Starting
    Architecture Lifecycle Layer
    start
    update
    refresh
    resolve
    Started
    Resolved
    uninstall
    uninstall
    stop
    Stopped
    Uninstalled
  • Architecture Service Layer
    Each bundle can register or lookup a Service
    Each service corresponds to one or more interfaces
    Each service can be assigned and queried using properties
    Service Registry
    register
    lookup
    ServiceProvider
    Service Consumer
  • OSGi Tools working with services
    Managing Services programmatically
    Using the OSGi blueprint
    Spring Dynamic Modules
    Apache Aries
    Felix i-Pojo
  • OSGi Tools creating bundles
    Manually providing the MANIFEST.MF
    Bnd command line tool
    Maven Bundle Plug-in
    Spring’s Bundlor
    Maven plug-in flavor
    Command line flavor
  • OSGi Tools OSGi Bundle Repository
    Simplifies the provisioning of bundles
    The “apt-get install” for the OSGi
    Integrates with public repositories
    Eclipse Orbit
    Spring’s Enterprise Bundle Repository
  • OSGiEnd of Part I
    Questions & Answers
  • Part II
    Getting started with Apache Karaf
  • Apache Karafagenda
    Overview
    Shell Console
    Deployer
    Features Concept
    Security
    Logging Service
    Demo
    Questions and Answers
  • Apache KarafOverview
    Born as Service Mix Kernel project
    Grown inside Apache Felix project
    Become a Top Level Apache project last year
  • Apache KarafShell Console
    Extensible
    Auto complete & coloring support
    Rich command set, covers most OSGi concepts/services
    Special commands for the development phase
  • Apache KarafDeployer
    File Scanner
    War Transformer
    Configuration
    Bundles
    Transformation
    Spring
    Transformer
    Blueprint
    Transformer
    Configuration
    Admin
    URL
    Handler
    Maven Handler
    HTTP Handler
    Hot deployment
    Large number of supported artifacts
    Large number of installation mediums
    OBR Handler
  • Apache KarafFeatures Concept
    A Karaf feature is a descriptor which defines…
    A set of bundles
    A set of configurations
    A set of other features
    Allows provisioning of applications
    Maven integration
    OBR integration
  • Apache KarafFeatures Example
    <feature name="http" version=”2.2.0” resolver=“(obr)”>
    <configname="org.ops4j.pax.web”>
    org.osgi.service.http.port=8181
    </config>
    <feature version="[7.0,8.0)">jetty</feature>
    <bundle dependency=“true”>mvn:javax.servlet/servlet-api</bundle>
    <bundle>mvn:org.ops4j.pax.web/pax-web-api</bundle>
    </feature>
  • Apache KarafSecurity
    JAAS based security
    Multiple login module implementations
    Property Login Module
    JDBC Login Module
    LDAP Login Module
    Command line support
    Provisioning of any JASS realm
    Add users roles etc
  • Apache KarafLogging Service
    Centralized Logging configuration
    Supports most logging APIs
    Log4J
    Slf4j
    Commons Logging
    Command line support
    clear, display, tail change threshold etc.
    OSGi integration
    per bundle appender, osgi specific attributes
  • Apache Karaf End of Part II
    Questions & Answers
  • Thank you