25
Apache Axis2 - OSGi Integration in WSO2 Carbon Platform Sameera Jayasoma Technical Lead and Product Manager WSo2 Inc.

Apache Axis2 - OSGi Integration in WSO2 Carbon Platform Sameera Jayasoma Technical Lead and Product Manager WSo2 Inc

  • View
    228

  • Download
    1

Embed Size (px)

Citation preview

Apache Axis2 - OSGi Integration in

WSO2 Carbon Platform

Sameera JayasomaTechnical Lead and Product Manager

WSo2 Inc.

WSO2• Founded in 2005 by acknowledged leaders in XML, Web

Services Technologies & Standards and Open Source.• Producing entire middleware platform 100% open source

under Apache license.• Business model is to sell comprehensive support &

maintenance for our products.• Venture funded by Intel Capital.• Global corporation with offices in USA, UK & Sri Lanka.• 100+ employees and growing.

Outline•Apache Axis2

•OSGi, the dynamic module system

•WSO2 Carbon SOA Platform

•Axis2 – OSGi Integration•Problems faced•Solutions•Benefits

4

Apache Axis2•A Web Services Engine.

•Java runtime for hosting Web Services.

•Runs standalone or in conjunction with Application servers such as Apache Tomcat.

•Supports both SOAP and REST

•It is extensible.

5

OSGi•Dynamic module system for Java platform

•Defines a way to create true modules and a way to interact at runtime.

•Modules(Bundles) in OSGi can be installed, updated and uninstalled without restarting the JVM.

•Benefits of OSGi,Improved time to market,

Reduced development cost.

6

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.

7

Bundles And Java Packages•Bundles can share packages with other bundles or hide packages.

•Bundles can declare dependencies on java packages exported by other bundles

8

Bundles And Java Packages

Bundle A

Exported Packages

Private Packages

Imported Packages

Bundle B

Exported Packages

Private Packages

Imported Packages

Bundle C

Exported Packages

Private Packages

Imported Packages

Imports

Imports

9

Life Cycle of a Bundle

10

OSGi Services•Mechanism for bundles to collaborate at runtime.

•A service is a plain old Java object(POJO) published in OSGi service registry

•OSGi services provides in-VM SOA model for bundles

11

WSO2 Carbon•A component based Service Oriented Architecture(SOA) platform for developing enterprise SOA middleware.

•Based on OSGi, provides a well define component model.

•Hence it allows you to create highly customized and optimized SOA applications to suit your enterprise.

•Base platform for all the Java products in WSO2.

12

WSO2 Carbon Based Products

Core Carbon Framework

Clustering

Security

T ransports Mgmt

Mgmt Stats

Logging

T ryIt

BundleMgmt

Cache

T hrot t le

KeyStoreManager

UserManager

ESB WSAS DataServices

MashupServer

ProcessServer

Registry

Proxy

MsgMediat ion

T asks

J SR181

ServiceHost ing

ServiceClients

DataSourceMgmt

DataServices

DSWizard

ScriptServices

Scraping

Gadgets

BPELRunt ime

ProcessUI

InstanceUI

Core Repos

AtomPub

SOAGovern

13

Axis2 – OSGi Integration

14

Motivation•Facilitate using Axis2 in OSGI based environments

•Improved class loading mechanism for deployed services and other Axis2 extensions such as Modules.

•Deploying Web services in Bundles

•Deploying Axis2 Extensions(Modules, Service Deployers, etc.) in Bundles.

15

Problems Faced•Existence of split 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.

16

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 split 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 jar files into single Big Bundle.

17

Carbon Orbit Bundles•This Axis2 bundle still needs other third party libraries

in the form of bundles to properly function in an OSGi environment.

•Most of these libraries were not available as bundles.

•Hence Carbon orbit project was initiated to wrap these libraries to OSGi bundles.

18

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 provide a better class loading mechanism for Web Services.

19

Axis2 Extensions 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 the manifest headers.

20

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.

•Solution: Implements a faulty services recovery mechanism in Axis2.

21

Benefits of OSGi Integration•OSGi has been accepted as the de facto standard which defines a dynamic modular system for Java.

•Major software vendors are moving to OSGi.

•Enables Axis2 to be used in any OSGi based applications, not just in WSO2 Carbon.

•Helps to increase its market share as a Web Services Engine.

22

Questions?

SELECTED CUSTOMERS

24

WSO2 ENGAGEMENT MODEL

•QuickStart•DevelopmentSupport•Development Services•Production Support•Turnkey Solutions•WSO2 Mobile Services Solution•WSO2 FIX Gateway Solution•WSO2 SAP Gateway Solution

25

Thank You!