Create your own Carbon Component Sameera Jayasoma Technical Lead and Product Manager of WSO2 Carbon sameera@wso2.com
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 80+ employees and growing
Introduction
What is WSO2 Carbon Carbon is modular middleware Eclipse for Server Completely built as a set of well-defined OSGi components. Highly stable foundation for middleware» High volume production use cases 200m+ transactions/day. Re-configurable» Install new features, uninstall, revert Fits the middleware to the architecture» Zero bloat but more that 150 features
WSO2 Carbon based Products WSO2 Carbon based products = WSO2 Carbon + Set of Features WSO2 Carbon based products WSO2 WSAS WSO2 ESB WSO2 IS Features Service Management Feature Proxy Services Features Transport Management Feature
WSO2 Carbon based Products
What is a 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 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
Features Allows you to specify pre-requisites of your Carbon component. Other dependent features, bundles. Dependency Management. Are installable Units which can be installed into any Carbon based product. Can be install using the WSO2 Carbon Feature Manager Can be shared with others by packaging features as a Repository (Update Site in eclipse terms).
What is a Carbon Component A set of OSGi Bundles. Lives in the Carbon Framework. Hence should conform to rules define in the Carbon Framework. Two aspects/ BE-FE Separation Every component has a core runtime, a clean SOA management interface, a well-defined front-end console component Back-end Runtime Front-end Console Uses Core Carbon Services Via OSGi service registry e.g. Registry Service, UserManager Service, etc.
The Big Picture WSO2 Carbon based Product Browser HTML HTTP Custom Client WS-* FE Console WS-* BE Server bundle bundle bundle bundle bundle bundle Equinox P2 Repository of Features Front end feature Aggregate Feature Back end feature bundle bundle bundle bundle bundle bundle bundle bundle
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 components 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
Carbon Component: Development Process 1. Develop the Carbon component Back-end component (BE OSGi bundles) Front-end component (FE OSGi bundles) Common bundles, if any 1. Develop the corresponding feature BE/Server Feature FE/UI Feature Composite Feature 1. Install into a Carbon based product By integrating with the product build system By developing a feature repository and installing using Feature Manager
Carbon Component: Build Process We use Maven as our build tool. Building Carbon components/osgi bundles Use Maven Bundle plugin to build OSGi bundles http://svn.wso2.org/repos/wso2/branches/carbon/3.0.0/components/logging/org.ws Building Features Use Maven P2 Feature plugin (Developed at WSO2) User p2-feature-gen goal http://svn.wso2.org/repos/wso2/branches/carbon/3.0.0/features/logging-mgt/org.w Building a Repository Use Mave P2 plugin P2-repo-generator goal http://svn.wso2.org/repos/wso2/branches/carbon/3.0.0/features/repository/pom.xm
What do you need to know to add to Carbon? Java to write some code Carbon Understand the architecture and the usage Apache Axis2 enough to create a service and consume it JSP XML SVN To check out the code Maven To build the code Plus a little OSGi and a little p2 OSGI is useful for: Getting OSGi services (e.g. Registry) injected into your code Handling activation of bundles
Student Manager Component Lets develop a sample Carbon component to understand the development process as well as the build process. Student Manager component consists of a BE runtime which exposes a Web services to Add new students Get the list of students Consist of a FE console which displays the available student information on the Carbon management console. Student Manager Feature org.wso2.carbon.student.mgt.server.feature org.wso2.carbon.student.mgt.ui.feature org.wso2.carbon.student.mgt.feature
Developing the BE Component Some actual server logic plus an admin service to manage it Add some special sauce into the services.xml to let us know it s an admin service component.xml configures permissions
BE Component: Directory Structure org.wso2.carbon.student.mgt src/ main/ Java/ Org/wso2/carbon/student/mgt Resources/ META-INF/ services.xml component.xml Test/ pom.xml
Demo
Developing the FE Component Admin service client standard Axis2 WSDL client JSP Helper code sets correct security component.xml Defines the menu structure to place the JSP in the right place
Front-end console JSP component.xml
FE Component: Directory Structure org.wso2.carbon.student.mgt.ui src/ main/ Java/ Resources/ studentmgt.wsdl Org/wso2/carbon/student/mgt/ui/i18n/Resources.properties META-INF/ component.xml Web/ pom.xml student-mgt/ (web context of the FE console) doc/ userguide.html images/ js/ *.jsp files
Demo
Developing the Feature Demo
Repository Generation Demo
Installing the Feature into WSO2 Carbon Demo
Summary
Engagement Model Quick Start - Combination of consulting, training and POC development in one week by WSO2 on-site team working hand-in-hand with customer team Development Support - On-going support for Customer's engineering teams Production Support - Full 24x7x365 enterprise support providing software maintenance and support
Selected Customers
Resources How to develop OSGi Bundles using the Maven Plugin http://bit.ly/9tpmjl Getting Started with WSO2 Carbon http://bit.ly/9cdzto
Thank you