Skip to main content

Posts

Showing posts from 2011

Me at WSO2Con 2011-Day 1

This blog will provide you my experience at WSO2Con 2011, as one of the witness from the large crowd participated in such a successful and valuable open-source programming conference. Location- Colombo,Sri Lanka Date- 12th Sep-16th Sep 2011 The key reason for blogging about this event is NOT due to I'm a member of the WSO2 team,but I want to share the value added knowledge and experience I was gained from the conference.The event continued with two tutorials days with three days of main conference.It's not only covered the technical stuff,but also cultural aspects with highlighting Sri Lankan signature in each of the conference day evenings. The agenda can be found from here Following is the summary what I learnt from some of the sessions out from the all sessions which I was able to participated in the conference.I'll  present the details of those sessions as linked multiple posts. Day 1-      12th of September 2011 Tutorial 1- ...

Good Bye!!!

It was nearly a month ago while a guest couple has chosen a wall lamp near to our in front-door as their home.Though the couple has not get any invitation from us or neither they had provided the boardin charge ;),but they started to build their house in the lamp.Guess who had come to acompany with us?? Yaa,it was a couple of birds. Unfortunately none of our family kn ew their names.That's because they are not from a kind as much as familiar in our gardens as 'demalichcha,polkichcha,mayna' does. As I observed they were hard workers and had a great relationship between them,hence they were able to buid their home step by step by going far-away to gather the home-made stuff as little plants,etc and finished the house building very fast. It was a small but a nice home.Later I saw birds has started to live in their home,but actually not both of them.Only the female-bird was lived in their home and male-bird was stayed at a tree in our garden.I noticed that t...

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...

Flowers

When I got leisure times,I began my new hobby to take photos of flowers in our garden.For that I used samsung digital camera[12mb pixel resolution].Though I'm not an experty in photography and with a small photo collection,felt those were have good quality to share with others. :)

Exec Maven Plugin

This plugin is very useful while executing system and java programs.It provides two goals as; exec:exec execute programs and Java programs in a separate process. exec:java execute Java programs in the same VM. The benefit of this plugin is we can execute the program without any IDE and using this maven plugin. I will explain how to use exec:java goal in a simple helloWorld program. First create a new maven project.Here I used IntelliJIDEA. Then add a java class to it with having the main method.For the moment just add a System.out in that method. Then add the following configurations to it's pom.xml file. Next build the project using 'mvn install' . Finally invoke 'mvn exec:java -o'. Then the program will execute and the terminal result will displays as follows. For further info, visit

Summarizing WSO2 Gadget Server

Near after eight months,that I have joined WSO2 team,I feel it's the better t ime to share some information regarding the product,that I have almost contributed there.It's non other than WSO2 Gadget Server- The Enterprise Information Portal ,which provides a framework built on top of the Google gadget specification.For more information regarding Google gadget specification visit . Simply saying,the key idea of GS is to keep all the relevant information in a single place in a well organized manner according to the portal user's preference.And the user can change this web space as a dynamical information store or either static information store according to his/her requirements. Accepting the idea of one picture could say more than 1000 words,before going to deep on it,below shows the s creen-shot of the portal view of GS. Highlighted features of Gadget Server... Embedded Gadget Repository It is to store gadget xml files and add them to portal once user required.Gadget repos...

Add a keyboard shortcut using javascript

When reading a web page,it's more comfortable for a user if that page supports keyboard shortcuts,since then a web user always no need to struggle with mouse. Add a keyboard shortcut means an event which triggers once a keyboard key is pressed.Hence the javascript event listener ' onkeyup ' is used for it. This method allow you to perform an action when a key is pressed. Each keyboard key have its own keyboard code. For example; Tab key code is 9 Enter key code is 13 Shift key code is 16 Ctrl key code is 17 Left Arrow key code is 37 We can defined our own custom keyboard keys association for a shortcut.And what we have to do is,once a user pressed keyboard keys, just need to verify that keys pressed and compare the returned value with the keyboard code associated with the keys used in our custom defined keyboard shortcut. Example: var isShift = false; document.onkeyup=function(e) { if(e.which == 16) isShift=false; }document.onkeydown=function(e){ if(e.which == 16) ...

Tribute to my father...

This is an idea came to my mind several times that I s hould post into blog someday.This is a real story of my father which gave me an important lession - " Never give up.Try and Try.One day you'll be success ". So thought of sharing with others too. Couple of years back,when my father was retired(on Jan 2009) he was so upset about it, with the mind of what else remian to do by him aft erwards.So on firs t two mo nths he spent it with a lazy plan-sleep,eat,a simple walk,read newspapers,so on. But finally he got a different idea of starting b ack his h obby o f planting.But then the major issue appeared.So is there any enough space remain in ou r g arden,exc ept c u tting down current planted trees? No way.Why no way?Y aa there is a one way.Finally he found it.Ya he thought to him self " I must starting planting on the slab". In our home,up-floor was not yet built.So slab is remaining.But when he told this idea to us,we were wondering how he could manage th...