260 likes | 282 Views
Apache Axis2 - OSGi Integration in WSO2 Carbon Platform. Sameera Jayasoma Technical Lead and Product Manager WSo2 Inc. WSO2. Founded in 2005 by acknowledged leaders in XML, Web Services Technologies & Standards and Open Source.
E N D
Apache Axis2 - OSGi Integration in WSO2 Carbon Platform Sameera Jayasoma Technical 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
Apache Axis2 • A Web Services Engine. • Java runtime for hosting Web Services. • Runs standalone or in conjunction with Applicationserverssuch as Apache Tomcat. • Supports both SOAP and REST • It is extensible.
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 anduninstalled without restarting the JVM. • Benefits of OSGi, Improved time to market, Reduced development cost.
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.
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
Bundle B Exported Packages Imports Imported Packages Bundle A Private Packages Exported Packages Imported Packages Private Packages Imports Bundle C Exported Packages Imported Packages Private Packages Bundles And Java Packages
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
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.
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.
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.
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.
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.
Web Services In Bundles • Implemented a custom Service Deployer to handle Web services reside in Bundles. • UsedOSGi 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.
Axis2 Extensions In Bundles • Extensions such as Axis2 Modules, Service Deployers, etc. in bundles are required to be deployed inAxis2. • 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.
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.
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.
QuickStart • DevelopmentSupport • Development Services • Production Support • Turnkey Solutions • WSO2 Mobile Services Solution • WSO2 FIX Gateway Solution • WSO2 SAP Gateway Solution WSO2 engagement model