SlideShare une entreprise Scribd logo
1  sur  47
Télécharger pour lire hors ligne
Carbon and OSGi Deep Dive
Sameera Jayasoma
Software Architect
WSO2 Meetup
18/12/2014
Overview
● What is Carbon?
● OSGi, P2.
● OSGI, P2 and Carbon integration.
● How carbon starts up?
● Carbon and OSGi bundles.
● Bundle pooling and multi-profiles support.
● Carbon and OSGi services.
● Axis2 OSGi integration in Carbon.
● Carbon, Components, Features,
● Carbon as a server building framework.
?
WSO2 Carbon
● Server building framework
○ offers a lean, modular platform to build servers/middleware products
● All WSO2 middleware products are developed based on this core
framework.
● Provides all the key ingredients to build enterprise-class servers.
● Servers built on top of this Carbon are designed as a set of reusable
modules/components.
Pre-Carbon Era
● Before 2008.
● We had,
○ Three separate products
○ Three code bases
○ Three teams
○ Similar features were available in these products but NO code has been
shared.
● This model wasn’t a scalable one.
● Therefore we decided to build our products in a
modular/componentized way to solve above issues.
● Realized the need of a solid foundation to achieve this.
OSGi to the rescue!!!
OSGi
● OSGi framework is a dynamic module system and a services
platform for Java programming language.
● OSGi defines a set of rules to build modules, to manage their
lifecycles and to communicate among these modules at runtime (in-
VM SOA).
● Modules(Bundles) in OSGi can be installed, updated and uninstalled
without restarting the JVM.
● Carbon has achieved modularity and dynamism through the
concepts defined in the OSGi framework.
Bundle
● The unit of modularization in OSGi
● Traditional Java app. is a collection of Jars. But an OSGi based
system is a collection of bundles.
● Bundle is just a JAR with some additional metadata(manifest
headers) in the MANIFEST.MF file
● A java package is the unit of information hiding.
Bundle and Java packages
● Bundles can share packages with other bundles or hide packages.
● Bundles can declare dependencies on java packages exported by
other bundles.
Life Cycle of a Bundle
OSGi Services
● An OSGi service is a java object, registered into OSGi runtime with a
set of properties.
● Any java object can be registered as a service, but typically it should
implements a well-known interface.
● Its a mechanism for bundles to collaborate at runtime.
● OSGi services provides in-VM SOA model for bundles.
Equinox P2
● A provision platform for OSGi based systems.
● p2 stands for “Provisioning Platform”
● Provides a well defined model for provisioning OSGi bundles
● p2 allows us to manage feature in a controlled manner
○ Install, Uninstall, Revert
○ Based on a web or file based repository
■ Can be hosted internally for an organization
○ Three approaches:
■ Command line
■ Web console
■ Secure remote API
OSGi, P2 and Carbon
● Carbon is tightly coupled with OSGi and P2, if you look at it in a deep
technical level.
● Carbon has achieved modularity and dynamism through the module
system and service platform concepts defined in OSGi spec.
● Everything in Carbon is a bundle.
● These bundles share Java packages among each other, some of
these bundles share Java objects as OSGi services to communicate
with each other.
OSGi, P2 and Carbon
● P2 has enabled the provisioning aspect in Carbon.
● P2 brings the concept of a "Feature" which means a logically related
set of bundles. In other words you can think of it as a functionality in
the system. E.g.
○ Service Management Feature.
○ Registry Feature.
○ JMS Transport Feature.
● You can combine a set of these features into a "Repository" and host
it online or as a distribution to download.
● With P2 you can easily install, update, uninstall features from
repository and customize products.
How Carbon Starts up?...
How Carbon Starts up?
● Carbon Kernel contains many different OSGi bundles which needs to be
loaded up and activated in a particular order to complete Carbon
Initialization.
○ e.g. opening ports only after the server initialization is completed.
● We cannot rely on the OSGi bundle startup order as the startup order is
unpredictable.
How Carbon Starts up?...
OSGi Repository in Carbon
${CARBON.HOME}/repository/components
Everything in Carbon is an OSGi Bundle
● Static resources (java packages/classes) are shared with the
bundles using the Export-Package manifest header.
● Carbon APIs classes shared while hiding implementation classes.
● Import-Package is used to declared dependencies to java packages
exposed from other bundles.
● Private packages (which are not supposed to be shared) are
grouped under the package called “internal”
○ e.g. org.wso2.carbon.caching.internal
● Usage of “maven-bundle-plugin” to build OSGi bundles.
maven-bundle-plugin
● Allows you to generate OSGi bundles from Maven project.
○ Generate manifest.mf file with the required OSGi manifest headers
● It automatically generate imports and exports if you haven’t specified
explicitly.
○ We recommend you to specify the list of of import and export packages
with versions explicitly in the pom.xml.
Jars to Bundles Converter
● Legacy jar files are covered the OSGi bundles on the fly.
● A Useful feature in Carbon which gives a quick and easy way for
developers to expose their legacy libraries to OSGi runtime.
○ Installing DB drivers into OSGi runtime.
● But we do not recommend this.
○ Because these converted bundles do not export or import packages
with versions. No way to specify bundle activators etc.
● This conversion happens during the server startup. just before
launching the OSGi runtime in Carbon.
Orbit Bundles
● Some third-party libraries are not available as OSGi bundles.
● Hence Carbon orbit bundles project was initiated to wrap these
libraries as OSGi bundles.
● Now it hosts many different orbit bundles required for many different
components in the Carbon platform.
○ Apache Tomcat OSGi bundle,
○ Apache Axis2 bundles,
○ Hazelcast bundle etc.
https://github.com/wso2/orbit
Bundle pooling
● Ability to share a common plugins directory by multiple applications.
● No duplication of content
● No duplicated downloads when upgrading your applications.
● Allows multiple modes/profiles of a single application to co-exists in
single distribution
http://wiki.eclipse.org/Equinox_p2_Getting_Started#Bundle_pooling
Multi-profile support
● One download, multiple servers.
e.g. sh wso2carbon.sh -Dprofile=profile_name
● Enables a product to run in multiple modes/profiles
● A profile of a product describes the runtime behaviour.
● Each profile contains only the required set of components
○ E.g. A single API Manager distribution can play following roles.
API Publisher
API Subscriber
API Gateway
Auth Server
Multi-profile support...
Demo
Role of OSGi Services in Carbon
● Shares state among modules.
○ e.g. carbon.xml configuration is shared among bundles as an OSGi
service
● Orders the initialization of modules during the server startup.
● Decouples to APIs from implementation classes.
● Means of extending the behaviour dynamically.
○ e.g. Registering a Servlet as an OSGi service
Apache Axis2
● A Web Services Engine.
● Java runtime for hosting services.
● Runs standalone or in conjunction Application servers such as
Apache Tomcat.
● Supports both SOAP and REST
● It is extensible.
○ Axis2 Modules.
○ Axis2 Deployers
○ Transports
○ Message Formatters and Message Builders.
○ etc..
Apache Axis2 and Carbon Integration: Motivation
● Facilitate using Apache Axis2 in OSGI based environments
● Improved class loading mechanism for deployed services and other
Axis2 extensions such as Modules.
● Deploying Web services reside in Bundles
● Deploying Axis2 Extensions(Modules, Service Deployers, etc.) reside
in Bundles.
Problems faced
● Existence of splitted packages among axis2 jar files
● Dependencies of Axis2 are not yet available as OSGi bundles.
● Modules are required to be deployed before Web services in Axis2.
One Big Bundle
● Axis2 consists of several application jar files and third party libraries.
○ axis2-kernal.jar
○ axis2-adb.jar and many more..
● Some Java packages are splitted among these jar files.
○ org.apache.axis2.util package is available in both axis2-kernal.jar
and axis2-adb.jar.
● A package can only be exported by a single bundle, if the version is
same.
● Solution: Bundled all these axis2 jars files into single Big Bundle.
Web Services in Bundles
● Implemented a custom Service Deployer to handle Web services
reside in Bundles.
● Used OSGi extender pattern to detect the list of bundles which has
Web services.
● BundleListeners are used listen to bundle events.
● Only the bundles in ACTIVE state are taken into consideration.
● Bundle classloader is set as the Service classloader to give a better
class loading mechanism for Web Services.
Axis2 Extension in Bundles
● Extensions such as Axis2 Modules, Service Deployers, etc. in
bundles are required to be deployed in Axis2.
● Here also, OSGi extender pattern is used.
● Bundles specify a custom manifest header.
○ Axis2Deployer: POJODeployer
○ Axis2Module: rampart
● Filter the list of bundles having Axis2 extensions using these
manifest headers.
Modules before Services
● Problem: In Axis2, modules should be deployed before services.
Otherwise services become faulty and also these faulty services
cannot be recovered.
● In OSGi, bundle starting order is unpredictable.Hence bundles with
Axis2 Services may become ACTIVE before bundles with Axis2
Modules.
● Possibility of services being deployed before modules.
WSO2 Carbon based products
● Product is a distribution artifact which combines Carbon kernel and a set of
logically related features.
● Following is a list of products offered by WSO2.
What is a Carbon Component?
● A set of OSGi Bundles.
● Lives in the Carbon Platform. Hence should conform to rules define
in the Carbon Platform.
● Uses Core Carbon Services
○ Via OSGi service registry
○ e.g. Registry Service, UserManager Service, etc.
What is a Carbon Feature?
● In Eclipse world
○ Feature is a grouping of set of logically related plug-ins/ OSGi
bundles
○ Feature can be installed into Eclipse platform using its Update
Manager
What is a Carbon Feature?
● In Carbon world
○ Feature can be thought of as an installable form of one or more
logically related Carbon component
■ Service Management Component
● What you develop
■ Service Management Feature
● What you install
○ Feature is a grouping of one or more logically related Carbon
components
○ Features can be installed into Carbon based product using
Feature Manager.
WSO2 Carbon: Component Architecture
WSO2 Carbon Kernel
WSO2 Carbon: Feature Library
WSO2 Carbon: Distribution Artifacts
WSO2 Carbon: Adaptability
Key Features offered by Carbon
● User Management API
● Registry/Repository API
● Caching API
● Clustering
● Pluggable Transports
● Artifact Deployment Engine
● Ghost Deployment of Artifacts
● Deployment Synchronization
● UI Framework
● Configuration and Context model (CarbonContext API)
● Multi-tenancy
Server Building Framework
http://awaytogarden.com/questions-anyone-or-careful-what-you-ask/
http://www.funlava.com/thank-you-quotes/

Contenu connexe

Tendances

Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1Etsuji Nakai
 
Kubernetes Stateful Workloads on Legacy Storage
Kubernetes Stateful Workloads on Legacy StorageKubernetes Stateful Workloads on Legacy Storage
Kubernetes Stateful Workloads on Legacy StorageAkhil Mohan
 
Osgi Webinar
Osgi WebinarOsgi Webinar
Osgi WebinarWSO2
 
Kubernetes Introduction & Whats new in Kubernetes 1.6
Kubernetes Introduction & Whats new in Kubernetes 1.6Kubernetes Introduction & Whats new in Kubernetes 1.6
Kubernetes Introduction & Whats new in Kubernetes 1.6Opcito Technologies
 
TechDay - Cambridge 2016 - OpenNebula Corona
TechDay - Cambridge 2016 - OpenNebula CoronaTechDay - Cambridge 2016 - OpenNebula Corona
TechDay - Cambridge 2016 - OpenNebula CoronaOpenNebula Project
 
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.Opcito Technologies
 
Disaster recovery solution with open nebula and storpool
Disaster recovery solution with open nebula and storpoolDisaster recovery solution with open nebula and storpool
Disaster recovery solution with open nebula and storpoolOpenNebula Project
 
Planning WSO2 Deployments on DC/OS
Planning WSO2 Deployments on DC/OSPlanning WSO2 Deployments on DC/OS
Planning WSO2 Deployments on DC/OSImesh Gunaratne
 
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...NETWAYS
 
Brief Introduction To Kubernetes
Brief Introduction To KubernetesBrief Introduction To Kubernetes
Brief Introduction To KubernetesAvinash Ketkar
 
SUSE Manager with Salt - Deploy and Config Management for MariaDB
SUSE Manager with Salt - Deploy and Config Management for MariaDBSUSE Manager with Salt - Deploy and Config Management for MariaDB
SUSE Manager with Salt - Deploy and Config Management for MariaDBMariaDB plc
 
CM for MariaDB Galera cluster
CM for MariaDB Galera clusterCM for MariaDB Galera cluster
CM for MariaDB Galera clusterMariaDB plc
 
Database experiences designing cassandra schema for keystone
Database experiences designing cassandra schema for keystone Database experiences designing cassandra schema for keystone
Database experiences designing cassandra schema for keystone openstackindia
 
TechDay - Toronto 2016 - OpenNebula @ Fuze
TechDay - Toronto 2016 - OpenNebula @ FuzeTechDay - Toronto 2016 - OpenNebula @ Fuze
TechDay - Toronto 2016 - OpenNebula @ FuzeOpenNebula Project
 
Introduction to OpenStack Cinder
Introduction to OpenStack CinderIntroduction to OpenStack Cinder
Introduction to OpenStack CinderSean McGinnis
 
OpenNebula 5.4 Enhancements vCenter Integration
OpenNebula 5.4 Enhancements vCenter IntegrationOpenNebula 5.4 Enhancements vCenter Integration
OpenNebula 5.4 Enhancements vCenter IntegrationOpenNebula Project
 
WSO2 API Manager Reference Architecture for DC/OS
WSO2 API Manager Reference Architecture for DC/OSWSO2 API Manager Reference Architecture for DC/OS
WSO2 API Manager Reference Architecture for DC/OSImesh Gunaratne
 
Evolution of containers to kubernetes
Evolution of containers to kubernetesEvolution of containers to kubernetes
Evolution of containers to kubernetesKrishna-Kumar
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopBob Killen
 

Tendances (20)

Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
 
Kubernetes Stateful Workloads on Legacy Storage
Kubernetes Stateful Workloads on Legacy StorageKubernetes Stateful Workloads on Legacy Storage
Kubernetes Stateful Workloads on Legacy Storage
 
Osgi Webinar
Osgi WebinarOsgi Webinar
Osgi Webinar
 
Kubernetes Introduction & Whats new in Kubernetes 1.6
Kubernetes Introduction & Whats new in Kubernetes 1.6Kubernetes Introduction & Whats new in Kubernetes 1.6
Kubernetes Introduction & Whats new in Kubernetes 1.6
 
TechDay - Cambridge 2016 - OpenNebula Corona
TechDay - Cambridge 2016 - OpenNebula CoronaTechDay - Cambridge 2016 - OpenNebula Corona
TechDay - Cambridge 2016 - OpenNebula Corona
 
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
Securing & Monitoring Your K8s Cluster with RBAC and Prometheus”.
 
Disaster recovery solution with open nebula and storpool
Disaster recovery solution with open nebula and storpoolDisaster recovery solution with open nebula and storpool
Disaster recovery solution with open nebula and storpool
 
Planning WSO2 Deployments on DC/OS
Planning WSO2 Deployments on DC/OSPlanning WSO2 Deployments on DC/OS
Planning WSO2 Deployments on DC/OS
 
OpenStack Kolla project update rocky release
OpenStack Kolla project update rocky releaseOpenStack Kolla project update rocky release
OpenStack Kolla project update rocky release
 
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
 
Brief Introduction To Kubernetes
Brief Introduction To KubernetesBrief Introduction To Kubernetes
Brief Introduction To Kubernetes
 
SUSE Manager with Salt - Deploy and Config Management for MariaDB
SUSE Manager with Salt - Deploy and Config Management for MariaDBSUSE Manager with Salt - Deploy and Config Management for MariaDB
SUSE Manager with Salt - Deploy and Config Management for MariaDB
 
CM for MariaDB Galera cluster
CM for MariaDB Galera clusterCM for MariaDB Galera cluster
CM for MariaDB Galera cluster
 
Database experiences designing cassandra schema for keystone
Database experiences designing cassandra schema for keystone Database experiences designing cassandra schema for keystone
Database experiences designing cassandra schema for keystone
 
TechDay - Toronto 2016 - OpenNebula @ Fuze
TechDay - Toronto 2016 - OpenNebula @ FuzeTechDay - Toronto 2016 - OpenNebula @ Fuze
TechDay - Toronto 2016 - OpenNebula @ Fuze
 
Introduction to OpenStack Cinder
Introduction to OpenStack CinderIntroduction to OpenStack Cinder
Introduction to OpenStack Cinder
 
OpenNebula 5.4 Enhancements vCenter Integration
OpenNebula 5.4 Enhancements vCenter IntegrationOpenNebula 5.4 Enhancements vCenter Integration
OpenNebula 5.4 Enhancements vCenter Integration
 
WSO2 API Manager Reference Architecture for DC/OS
WSO2 API Manager Reference Architecture for DC/OSWSO2 API Manager Reference Architecture for DC/OS
WSO2 API Manager Reference Architecture for DC/OS
 
Evolution of containers to kubernetes
Evolution of containers to kubernetesEvolution of containers to kubernetes
Evolution of containers to kubernetes
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
 

En vedette

Inside The Java Virtual Machine
Inside The Java Virtual MachineInside The Java Virtual Machine
Inside The Java Virtual Machineelliando dias
 
Java class loader
Java class loaderJava class loader
Java class loaderbenewu
 
Application of Ontology in Semantic Information Retrieval by Prof Shahrul Azm...
Application of Ontology in Semantic Information Retrieval by Prof Shahrul Azm...Application of Ontology in Semantic Information Retrieval by Prof Shahrul Azm...
Application of Ontology in Semantic Information Retrieval by Prof Shahrul Azm...Khirulnizam Abd Rahman
 
Functional Programming With Lambdas and Streams in JDK8
 Functional Programming With Lambdas and Streams in JDK8 Functional Programming With Lambdas and Streams in JDK8
Functional Programming With Lambdas and Streams in JDK8IndicThreads
 
Classloading and Type Visibility in OSGi
Classloading and Type Visibility in OSGiClassloading and Type Visibility in OSGi
Classloading and Type Visibility in OSGimartinlippert
 
Lambdas : Beyond The Basics
Lambdas : Beyond The BasicsLambdas : Beyond The Basics
Lambdas : Beyond The BasicsSimon Ritter
 
Lambdas And Streams Hands On Lab
Lambdas And Streams Hands On LabLambdas And Streams Hands On Lab
Lambdas And Streams Hands On LabSimon Ritter
 
Self adaptive based natural language interface for disambiguation of
Self adaptive based natural language interface for disambiguation ofSelf adaptive based natural language interface for disambiguation of
Self adaptive based natural language interface for disambiguation ofNurfadhlina Mohd Sharef
 
Project Jigsaw in JDK9
Project Jigsaw in JDK9Project Jigsaw in JDK9
Project Jigsaw in JDK9Simon Ritter
 
JDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
JDK8 Lambdas and Streams: Changing The Way You Think When Developing JavaJDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
JDK8 Lambdas and Streams: Changing The Way You Think When Developing JavaSimon Ritter
 
Playing with Java Classes and Bytecode
Playing with Java Classes and BytecodePlaying with Java Classes and Bytecode
Playing with Java Classes and BytecodeYoav Avrahami
 
Open Services Gateway Initiative (OSGI)
Open Services Gateway Initiative (OSGI)Open Services Gateway Initiative (OSGI)
Open Services Gateway Initiative (OSGI)Peter R. Egli
 
Java Modularity with OSGi
Java Modularity with OSGiJava Modularity with OSGi
Java Modularity with OSGiIlya Rybak
 
Lessons Learnt With Lambdas and Streams in JDK 8
Lessons Learnt With Lambdas and Streams in JDK 8Lessons Learnt With Lambdas and Streams in JDK 8
Lessons Learnt With Lambdas and Streams in JDK 8Simon Ritter
 
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A GrzesikApache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesikmfrancis
 

En vedette (20)

Functional java 8
Functional java 8Functional java 8
Functional java 8
 
Inside The Java Virtual Machine
Inside The Java Virtual MachineInside The Java Virtual Machine
Inside The Java Virtual Machine
 
Java Class Loading
Java Class LoadingJava Class Loading
Java Class Loading
 
Java class loader
Java class loaderJava class loader
Java class loader
 
Application of Ontology in Semantic Information Retrieval by Prof Shahrul Azm...
Application of Ontology in Semantic Information Retrieval by Prof Shahrul Azm...Application of Ontology in Semantic Information Retrieval by Prof Shahrul Azm...
Application of Ontology in Semantic Information Retrieval by Prof Shahrul Azm...
 
Functional Programming With Lambdas and Streams in JDK8
 Functional Programming With Lambdas and Streams in JDK8 Functional Programming With Lambdas and Streams in JDK8
Functional Programming With Lambdas and Streams in JDK8
 
Incremental Evolving Grammar Fragments
Incremental Evolving Grammar FragmentsIncremental Evolving Grammar Fragments
Incremental Evolving Grammar Fragments
 
The Java Carputer
The Java CarputerThe Java Carputer
The Java Carputer
 
Classloading and Type Visibility in OSGi
Classloading and Type Visibility in OSGiClassloading and Type Visibility in OSGi
Classloading and Type Visibility in OSGi
 
Lambdas : Beyond The Basics
Lambdas : Beyond The BasicsLambdas : Beyond The Basics
Lambdas : Beyond The Basics
 
OSGi Presentation
OSGi PresentationOSGi Presentation
OSGi Presentation
 
Lambdas And Streams Hands On Lab
Lambdas And Streams Hands On LabLambdas And Streams Hands On Lab
Lambdas And Streams Hands On Lab
 
Self adaptive based natural language interface for disambiguation of
Self adaptive based natural language interface for disambiguation ofSelf adaptive based natural language interface for disambiguation of
Self adaptive based natural language interface for disambiguation of
 
Project Jigsaw in JDK9
Project Jigsaw in JDK9Project Jigsaw in JDK9
Project Jigsaw in JDK9
 
JDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
JDK8 Lambdas and Streams: Changing The Way You Think When Developing JavaJDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
JDK8 Lambdas and Streams: Changing The Way You Think When Developing Java
 
Playing with Java Classes and Bytecode
Playing with Java Classes and BytecodePlaying with Java Classes and Bytecode
Playing with Java Classes and Bytecode
 
Open Services Gateway Initiative (OSGI)
Open Services Gateway Initiative (OSGI)Open Services Gateway Initiative (OSGI)
Open Services Gateway Initiative (OSGI)
 
Java Modularity with OSGi
Java Modularity with OSGiJava Modularity with OSGi
Java Modularity with OSGi
 
Lessons Learnt With Lambdas and Streams in JDK 8
Lessons Learnt With Lambdas and Streams in JDK 8Lessons Learnt With Lambdas and Streams in JDK 8
Lessons Learnt With Lambdas and Streams in JDK 8
 
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A GrzesikApache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
Apache Karaf - Building OSGi applications on Apache Karaf - T Frank & A Grzesik
 

Similaire à Carbon and OSGi Deep Dive

How to build a custom stack with WSO2 carbon
How to build a custom stack with WSO2 carbon How to build a custom stack with WSO2 carbon
How to build a custom stack with WSO2 carbon WSO2
 
How to build a custom stack with wso2 carbon
How to build a custom stack with wso2 carbonHow to build a custom stack with wso2 carbon
How to build a custom stack with wso2 carbonShameera Rathnayaka
 
Using the Carbon Architecture to Build a Fit-for-Purpose Platform
Using the Carbon Architecture to Build a Fit-for-Purpose PlatformUsing the Carbon Architecture to Build a Fit-for-Purpose Platform
Using the Carbon Architecture to Build a Fit-for-Purpose PlatformSameera Jayasoma
 
WSO2Con US 2013 - Using the Carbon Architecture To Build a Fit-for-Purpose Pl...
WSO2Con US 2013 - Using the Carbon Architecture To Build a Fit-for-Purpose Pl...WSO2Con US 2013 - Using the Carbon Architecture To Build a Fit-for-Purpose Pl...
WSO2Con US 2013 - Using the Carbon Architecture To Build a Fit-for-Purpose Pl...WSO2
 
Building a server platform with os gi
Building a server platform with os giBuilding a server platform with os gi
Building a server platform with os giDileepa Jayakody
 
Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...
Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...
Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...mfrancis
 
Building a Modular Server Platform with OSGi
Building a Modular Server Platform with OSGiBuilding a Modular Server Platform with OSGi
Building a Modular Server Platform with OSGiDileepa Jayakody
 
Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in PractiseDavid Bosschaert
 
Intro to OSGi and Eclipse Virgo
Intro to OSGi and Eclipse VirgoIntro to OSGi and Eclipse Virgo
Intro to OSGi and Eclipse VirgoGordon Dickens
 
OSGi Enterprise Expert Group (OSGi Users Forum Germany)
OSGi Enterprise Expert Group (OSGi Users Forum Germany)OSGi Enterprise Expert Group (OSGi Users Forum Germany)
OSGi Enterprise Expert Group (OSGi Users Forum Germany)David Bosschaert
 
Scalable Spark deployment using Kubernetes
Scalable Spark deployment using KubernetesScalable Spark deployment using Kubernetes
Scalable Spark deployment using Kubernetesdatamantra
 
Carbon: Towards a Server Building Framework for SOA Platform
Carbon: Towards a Server Building Framework for SOA PlatformCarbon: Towards a Server Building Framework for SOA Platform
Carbon: Towards a Server Building Framework for SOA PlatformSrinath Perera
 
Wso2 product release webinar wso2 carbon 4.3
Wso2 product release webinar   wso2 carbon 4.3Wso2 product release webinar   wso2 carbon 4.3
Wso2 product release webinar wso2 carbon 4.3WSO2
 
WSO2 Product Release webinar - WSO2 Carbon 4.3
WSO2 Product Release webinar - WSO2 Carbon 4.3 WSO2 Product Release webinar - WSO2 Carbon 4.3
WSO2 Product Release webinar - WSO2 Carbon 4.3 WSO2
 
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...OpenBlend society
 
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...IndicThreads
 
What's new in the OSGi Enterprise Release 5.0
What's new in the OSGi Enterprise Release 5.0What's new in the OSGi Enterprise Release 5.0
What's new in the OSGi Enterprise Release 5.0David Bosschaert
 

Similaire à Carbon and OSGi Deep Dive (20)

How to build a custom stack with WSO2 carbon
How to build a custom stack with WSO2 carbon How to build a custom stack with WSO2 carbon
How to build a custom stack with WSO2 carbon
 
How to build a custom stack with wso2 carbon
How to build a custom stack with wso2 carbonHow to build a custom stack with wso2 carbon
How to build a custom stack with wso2 carbon
 
Using the Carbon Architecture to Build a Fit-for-Purpose Platform
Using the Carbon Architecture to Build a Fit-for-Purpose PlatformUsing the Carbon Architecture to Build a Fit-for-Purpose Platform
Using the Carbon Architecture to Build a Fit-for-Purpose Platform
 
WSO2Con US 2013 - Using the Carbon Architecture To Build a Fit-for-Purpose Pl...
WSO2Con US 2013 - Using the Carbon Architecture To Build a Fit-for-Purpose Pl...WSO2Con US 2013 - Using the Carbon Architecture To Build a Fit-for-Purpose Pl...
WSO2Con US 2013 - Using the Carbon Architecture To Build a Fit-for-Purpose Pl...
 
Building a server platform with os gi
Building a server platform with os giBuilding a server platform with os gi
Building a server platform with os gi
 
Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...
Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...
Building a Modular Server Platform with OSGi - Harshana Eranga Martin, Dileep...
 
Building a Modular Server Platform with OSGi
Building a Modular Server Platform with OSGiBuilding a Modular Server Platform with OSGi
Building a Modular Server Platform with OSGi
 
GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010
 
Osgi
OsgiOsgi
Osgi
 
Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in Practise
 
Intro to OSGi and Eclipse Virgo
Intro to OSGi and Eclipse VirgoIntro to OSGi and Eclipse Virgo
Intro to OSGi and Eclipse Virgo
 
OSGi introduction
OSGi introductionOSGi introduction
OSGi introduction
 
OSGi Enterprise Expert Group (OSGi Users Forum Germany)
OSGi Enterprise Expert Group (OSGi Users Forum Germany)OSGi Enterprise Expert Group (OSGi Users Forum Germany)
OSGi Enterprise Expert Group (OSGi Users Forum Germany)
 
Scalable Spark deployment using Kubernetes
Scalable Spark deployment using KubernetesScalable Spark deployment using Kubernetes
Scalable Spark deployment using Kubernetes
 
Carbon: Towards a Server Building Framework for SOA Platform
Carbon: Towards a Server Building Framework for SOA PlatformCarbon: Towards a Server Building Framework for SOA Platform
Carbon: Towards a Server Building Framework for SOA Platform
 
Wso2 product release webinar wso2 carbon 4.3
Wso2 product release webinar   wso2 carbon 4.3Wso2 product release webinar   wso2 carbon 4.3
Wso2 product release webinar wso2 carbon 4.3
 
WSO2 Product Release webinar - WSO2 Carbon 4.3
WSO2 Product Release webinar - WSO2 Carbon 4.3 WSO2 Product Release webinar - WSO2 Carbon 4.3
WSO2 Product Release webinar - WSO2 Carbon 4.3
 
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
 
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
OSGi For Java Infrastructures [5th IndicThreads Conference On Java 2010, Pune...
 
What's new in the OSGi Enterprise Release 5.0
What's new in the OSGi Enterprise Release 5.0What's new in the OSGi Enterprise Release 5.0
What's new in the OSGi Enterprise Release 5.0
 

Dernier

What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingShane Coughlan
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jNeo4j
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfmaor17
 

Dernier (20)

What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdf
 

Carbon and OSGi Deep Dive

  • 1. Carbon and OSGi Deep Dive Sameera Jayasoma Software Architect WSO2 Meetup 18/12/2014
  • 2. Overview ● What is Carbon? ● OSGi, P2. ● OSGI, P2 and Carbon integration. ● How carbon starts up? ● Carbon and OSGi bundles. ● Bundle pooling and multi-profiles support. ● Carbon and OSGi services. ● Axis2 OSGi integration in Carbon. ● Carbon, Components, Features, ● Carbon as a server building framework.
  • 3. ?
  • 4. WSO2 Carbon ● Server building framework ○ offers a lean, modular platform to build servers/middleware products ● All WSO2 middleware products are developed based on this core framework. ● Provides all the key ingredients to build enterprise-class servers. ● Servers built on top of this Carbon are designed as a set of reusable modules/components.
  • 5. Pre-Carbon Era ● Before 2008. ● We had, ○ Three separate products ○ Three code bases ○ Three teams ○ Similar features were available in these products but NO code has been shared. ● This model wasn’t a scalable one. ● Therefore we decided to build our products in a modular/componentized way to solve above issues. ● Realized the need of a solid foundation to achieve this.
  • 6. OSGi to the rescue!!!
  • 7. OSGi ● OSGi framework is a dynamic module system and a services platform for Java programming language. ● OSGi defines a set of rules to build modules, to manage their lifecycles and to communicate among these modules at runtime (in- VM SOA). ● Modules(Bundles) in OSGi can be installed, updated and uninstalled without restarting the JVM. ● Carbon has achieved modularity and dynamism through the concepts defined in the OSGi framework.
  • 8. Bundle ● The unit of modularization in OSGi ● Traditional Java app. is a collection of Jars. But an OSGi based system is a collection of bundles. ● Bundle is just a JAR with some additional metadata(manifest headers) in the MANIFEST.MF file ● A java package is the unit of information hiding.
  • 9. Bundle and Java packages ● Bundles can share packages with other bundles or hide packages. ● Bundles can declare dependencies on java packages exported by other bundles.
  • 10. Life Cycle of a Bundle
  • 11. OSGi Services ● An OSGi service is a java object, registered into OSGi runtime with a set of properties. ● Any java object can be registered as a service, but typically it should implements a well-known interface. ● Its a mechanism for bundles to collaborate at runtime. ● OSGi services provides in-VM SOA model for bundles.
  • 12. Equinox P2 ● A provision platform for OSGi based systems. ● p2 stands for “Provisioning Platform” ● Provides a well defined model for provisioning OSGi bundles ● p2 allows us to manage feature in a controlled manner ○ Install, Uninstall, Revert ○ Based on a web or file based repository ■ Can be hosted internally for an organization ○ Three approaches: ■ Command line ■ Web console ■ Secure remote API
  • 13. OSGi, P2 and Carbon ● Carbon is tightly coupled with OSGi and P2, if you look at it in a deep technical level. ● Carbon has achieved modularity and dynamism through the module system and service platform concepts defined in OSGi spec. ● Everything in Carbon is a bundle. ● These bundles share Java packages among each other, some of these bundles share Java objects as OSGi services to communicate with each other.
  • 14. OSGi, P2 and Carbon ● P2 has enabled the provisioning aspect in Carbon. ● P2 brings the concept of a "Feature" which means a logically related set of bundles. In other words you can think of it as a functionality in the system. E.g. ○ Service Management Feature. ○ Registry Feature. ○ JMS Transport Feature. ● You can combine a set of these features into a "Repository" and host it online or as a distribution to download. ● With P2 you can easily install, update, uninstall features from repository and customize products.
  • 16. How Carbon Starts up? ● Carbon Kernel contains many different OSGi bundles which needs to be loaded up and activated in a particular order to complete Carbon Initialization. ○ e.g. opening ports only after the server initialization is completed. ● We cannot rely on the OSGi bundle startup order as the startup order is unpredictable.
  • 18. OSGi Repository in Carbon ${CARBON.HOME}/repository/components
  • 19. Everything in Carbon is an OSGi Bundle ● Static resources (java packages/classes) are shared with the bundles using the Export-Package manifest header. ● Carbon APIs classes shared while hiding implementation classes. ● Import-Package is used to declared dependencies to java packages exposed from other bundles. ● Private packages (which are not supposed to be shared) are grouped under the package called “internal” ○ e.g. org.wso2.carbon.caching.internal ● Usage of “maven-bundle-plugin” to build OSGi bundles.
  • 20. maven-bundle-plugin ● Allows you to generate OSGi bundles from Maven project. ○ Generate manifest.mf file with the required OSGi manifest headers ● It automatically generate imports and exports if you haven’t specified explicitly. ○ We recommend you to specify the list of of import and export packages with versions explicitly in the pom.xml.
  • 21. Jars to Bundles Converter ● Legacy jar files are covered the OSGi bundles on the fly. ● A Useful feature in Carbon which gives a quick and easy way for developers to expose their legacy libraries to OSGi runtime. ○ Installing DB drivers into OSGi runtime. ● But we do not recommend this. ○ Because these converted bundles do not export or import packages with versions. No way to specify bundle activators etc. ● This conversion happens during the server startup. just before launching the OSGi runtime in Carbon.
  • 22. Orbit Bundles ● Some third-party libraries are not available as OSGi bundles. ● Hence Carbon orbit bundles project was initiated to wrap these libraries as OSGi bundles. ● Now it hosts many different orbit bundles required for many different components in the Carbon platform. ○ Apache Tomcat OSGi bundle, ○ Apache Axis2 bundles, ○ Hazelcast bundle etc. https://github.com/wso2/orbit
  • 23. Bundle pooling ● Ability to share a common plugins directory by multiple applications. ● No duplication of content ● No duplicated downloads when upgrading your applications. ● Allows multiple modes/profiles of a single application to co-exists in single distribution http://wiki.eclipse.org/Equinox_p2_Getting_Started#Bundle_pooling
  • 24. Multi-profile support ● One download, multiple servers. e.g. sh wso2carbon.sh -Dprofile=profile_name ● Enables a product to run in multiple modes/profiles ● A profile of a product describes the runtime behaviour. ● Each profile contains only the required set of components ○ E.g. A single API Manager distribution can play following roles. API Publisher API Subscriber API Gateway Auth Server
  • 26. Demo
  • 27. Role of OSGi Services in Carbon ● Shares state among modules. ○ e.g. carbon.xml configuration is shared among bundles as an OSGi service ● Orders the initialization of modules during the server startup. ● Decouples to APIs from implementation classes. ● Means of extending the behaviour dynamically. ○ e.g. Registering a Servlet as an OSGi service
  • 28. Apache Axis2 ● A Web Services Engine. ● Java runtime for hosting services. ● Runs standalone or in conjunction Application servers such as Apache Tomcat. ● Supports both SOAP and REST ● It is extensible. ○ Axis2 Modules. ○ Axis2 Deployers ○ Transports ○ Message Formatters and Message Builders. ○ etc..
  • 29. Apache Axis2 and Carbon Integration: Motivation ● Facilitate using Apache Axis2 in OSGI based environments ● Improved class loading mechanism for deployed services and other Axis2 extensions such as Modules. ● Deploying Web services reside in Bundles ● Deploying Axis2 Extensions(Modules, Service Deployers, etc.) reside in Bundles.
  • 30. Problems faced ● Existence of splitted packages among axis2 jar files ● Dependencies of Axis2 are not yet available as OSGi bundles. ● Modules are required to be deployed before Web services in Axis2.
  • 31. One Big Bundle ● Axis2 consists of several application jar files and third party libraries. ○ axis2-kernal.jar ○ axis2-adb.jar and many more.. ● Some Java packages are splitted among these jar files. ○ org.apache.axis2.util package is available in both axis2-kernal.jar and axis2-adb.jar. ● A package can only be exported by a single bundle, if the version is same. ● Solution: Bundled all these axis2 jars files into single Big Bundle.
  • 32. Web Services in Bundles ● Implemented a custom Service Deployer to handle Web services reside in Bundles. ● Used OSGi extender pattern to detect the list of bundles which has Web services. ● BundleListeners are used listen to bundle events. ● Only the bundles in ACTIVE state are taken into consideration. ● Bundle classloader is set as the Service classloader to give a better class loading mechanism for Web Services.
  • 33. Axis2 Extension in Bundles ● Extensions such as Axis2 Modules, Service Deployers, etc. in bundles are required to be deployed in Axis2. ● Here also, OSGi extender pattern is used. ● Bundles specify a custom manifest header. ○ Axis2Deployer: POJODeployer ○ Axis2Module: rampart ● Filter the list of bundles having Axis2 extensions using these manifest headers.
  • 34. Modules before Services ● Problem: In Axis2, modules should be deployed before services. Otherwise services become faulty and also these faulty services cannot be recovered. ● In OSGi, bundle starting order is unpredictable.Hence bundles with Axis2 Services may become ACTIVE before bundles with Axis2 Modules. ● Possibility of services being deployed before modules.
  • 35. WSO2 Carbon based products ● Product is a distribution artifact which combines Carbon kernel and a set of logically related features. ● Following is a list of products offered by WSO2.
  • 36. What is a Carbon Component? ● A set of OSGi Bundles. ● Lives in the Carbon Platform. Hence should conform to rules define in the Carbon Platform. ● Uses Core Carbon Services ○ Via OSGi service registry ○ e.g. Registry Service, UserManager Service, etc.
  • 37. What is a Carbon Feature? ● In Eclipse world ○ Feature is a grouping of set of logically related plug-ins/ OSGi bundles ○ Feature can be installed into Eclipse platform using its Update Manager
  • 38. What is a Carbon Feature? ● In Carbon world ○ Feature can be thought of as an installable form of one or more logically related Carbon component ■ Service Management Component ● What you develop ■ Service Management Feature ● What you install ○ Feature is a grouping of one or more logically related Carbon components ○ Features can be installed into Carbon based product using Feature Manager.
  • 39. WSO2 Carbon: Component Architecture
  • 44. Key Features offered by Carbon ● User Management API ● Registry/Repository API ● Caching API ● Clustering ● Pluggable Transports ● Artifact Deployment Engine ● Ghost Deployment of Artifacts ● Deployment Synchronization ● UI Framework ● Configuration and Context model (CarbonContext API) ● Multi-tenancy