Skip to main content

Posts

Showing posts from July, 2011

Add a new servlet to an OSGI bundle

Servlets are useful while handling requests coming from web browsers and setting responses according to the requests and after process them. In WSO2 carbon environment,OSGI UI bundles are exposed to web and sometimes there might be cases where we need to use a servlet and process on it according to web browser requests.Following steps will help you in such cases when you need to add a servlet for an UI bundle. Pre-requesties- Any product server from WSO2 Carbon products [1] IntelliJ IDEA 10.0 Maven 2.1.0 or higher JDK 1.6 or higher 1.First create a servlet class by extending HttpServlet abstract class inside an OSGI bundle.You can create a new UI-bundle by creating a new maven project and add this servlet class inside it..You can refer the WSO2 dashboard UI bundle code structure fro m here[2].Else For a new bundle you need to import 'javax.servlet' package from bundle pom.xml as we did for wso2 dashboard UI bundle pom.xml[3]. 2.Then you need to add

Love Green...!!!

After staying a week in a dusty brown colored,busy town with full of vehicles noise as in Colombo,what do u prefer in your weekend? Get away from there right? Yaa,this weekend I was able to go through green colored village and have a wonderful time on there. Walk through paddy fields,listen to wind.Watch multi-colored birds,Wash hands from water canals. This facilitates me to come back Colombo on starting of next week with a fresh mind.But what about future?With current human actions,is it guaranteed future kids will get such moments in their lives.I think we have to think this for a while.Money is not all about life.We are part of the nature.We have to protect Nature in sake of survival of ourselves.Hence please don't sell nature for a bundle of money and watch it's end. The most valuable lession teach by Nature is ''Simplicity".If you obey this lession you will never hurt nature. :):):)

WSO2 ESB learning part1-Usage of a class mediator in a makeFault mediator

Class Mediator -The class mediator creates an instance of a custom specified class and sets it as a mediator. The class must implement the org.apache.synapse.api.Mediator interface.For more info makeFault mediator -The fault mediator transforms the current message into a SOAP fault message.but does NOT send it. The mediator needs to be invoked to send a fault message created this way.For more info Sample makeFault mediator Below is the sample fault mediator that we are going to use in ESB sequence. Creating a new class mediator There is a good article on how to create a new class mediator which can be found here .Hence I'm not going to repeat those steps.But for your easier,i'll give the overview of a class mediator.Any class mediator must have to extend 'AbstractMediator' abstract class and hence such a mediator need to implement the method 'mediate()'.The purpose of creating the class mediator here,is to set the property value 'ERROR_CODE'

JMX configurable Support from WSO2 Carbon

When a user start-up any WSO2 product and while having a look on the log displays while server starting he/she could see a URL called JMX Service URL as in [1] displays on the log.This is the URL use to connect with JConsole to monitor memory consumption,thread utility,manage MBeans and more. As above each of the products from WSO2 family,provides in-built support from Carbon platform to manage and monitor of its resources such as applications,services,JVM using JMX [Java Management Extensions] support. You can see each JMX service url contains host names and port values.In early Carbon released versions [before 3.2.0 release],these values couldn't be change according to user's preference.Those values directly taken from system properties own by running Carbon server.But there are some use-cases where users need to create JMX URLs according to their preference.For example when apache proxy server configured infront of ESB and user need to connec t to JConsole by using apac