Monday, June 29, 2009

Mr. Lakshman Kadiragamar's Lesson

In 2005, almost fifty years after he left Oxford, Mr. Lakshman Kadiragamar's portrait was unveiled at the Oxford Union. This was a great honour bestowed by the Oxford Union on only 15 others in its 183 year history.

Mr Kadirgamar had this to say about that event;

'......I would like to, if I may, to assume that I could share the honour with the people of my country, Sri Lanka . I had my schooling there, my first university was there, I went to Law College there and by the time I came to Oxford as a postgraduate student, well, I was relatively a matured person. Oxford was the icing on the cake … but the cake was baked at home ......(applause) .'

This is indeed true. People appreciate only the icing on the cake not where it was baked first.

Saturday, June 27, 2009

Design for Jython Extension for Axis2

In a earlier post I said that I am coming up with a Jython extension for Axis2. This will be a code generation tool for jython. This will use existing infrastructure in Axis2 to support Contract First Web services in Jython. What I am planning to do is to integrate this code generation tool into WSF/Jython. Then WSF/Jython will be able to support both, contract-first and code-first approaches. Thus, making the life easier for the Jython developer :).

The code generation engine calls the extensions one by one and then calls a component what is known as the Emitter. Emitter is the actual component that does the significant bit of work in the code generation process. Emitters are usually language dependent and hence one language has one emitter associated with it. Therefore there should be an emitter to support Jython code generation. This simple yet powerful architecture is shown in the above illustration.

The Emitter processes the WSDL and builds a object model. The object model is simply an XML file which contains the object model of the WSDL with respect to Axis2 information model (ie. axis service, axis operation, axis message, etc). The template is a XSLT file which contains information on how the code should be generated. Then the built object model is parsed against the template to build the jython source code.

wsdl2java Code Generation

Axis2's wsdl2java code generation tool can be used to auto-generate programming language code for a given WSDL file. It can either generate code to invoke a Web service, or it can auto-generate the skeleton code that will adhere to the specification described within the WSDL file so that the generated code can be deployed as a Web service.

$HOME = Small Miracle

My $HOME sweet home - Sri Lanka :).

Friday, June 26, 2009

Axis2 Code Generator

This is a follow up to my earlier post. What I am planning to do is to come up with a mechanism to generate jython code for a given WSDL. For this purpose I am planning to use Axis2's Code Generation module.

When you consider a SOAP processing engine, one of the key value additions will be code generation based on WSDL. It is normally considered as a tool and importance of it can be seen as;
  1. User convenience - Code generation tool helps users, to use the framework in easy and efficient way.
  2. Make use of the framework to it's full potential.
Now let's have a look at the architecture of Axis2 Code generator.

The tool's architecture is pretty straight forward. The core processes the WSDL and builds a object model. Then the built object model is parsed against the template to build the source code.

King of Pop - MJ

Michael Jackson died yesterday. He was considered the King of Pop and a megastar of music industry. Despite all accusations, he is one of those people who really made a difference. RIP MJ.

Thursday, June 25, 2009

Building Axis2

This is a bug (I think) which I came across a couple of times, while building Axis2. To overcome this you have to follow 2 simple instructions ;). For the completeness of this blog post, I will direct you through he complete build process.

1. First checkout the source.
svn co

2. Build the project from the source. Do not skip the tests, when you do a fresh build.
mvn clean install

Now is the tricky part. If you are not getting build errors, then no problems at all :). If you start getting build errors related to plugins, then do the following to overcome it.

1. First build the axis2-aar-maven-plugin.

2. Then build the axis2-mar-maven-plugin.

3. Afterwards, build axis2. This should pretty much overcome the build error :).

Jython extension for Apache Axis2

In a earlier post I mentioned that my proposal for GSoC 2009 was accepted. There I didn't give much details on what my project is about. Here is a description of my project.

If you have tried out WSO2 WSF/Jython, you will know that it is based on code-first approach. Web services, is a technology to deliver the architectural style defined in SOA. Although there seems to be a general confusion about the relationship between SOA and Web services, it is important to know that Web services are an implementation methodology that adopts standard protocols to execute SOA. There are two widely used techniques in Web service development, ie.
  1. Code First
  2. Contract First
With the contract-first approach, the contract for the Web service is determined first and then the supporting tools are used to generate the implementation code. In contrast, in the code-first approach, first the implementation code is created and then the Web service development framework is used to produce the contract for the Web service.

In simpler terms; in WSF/Jython what I am doing is asking you to write the web service and the client. Then based on the service, a WSDL is generated and exposed as a Web service. Afterwards jython client can be used to invoke the service (ie. code-first).

When it comes to contract-first it is vice versa of the above scenario. First we will have to take the provided WSDL in to consideration. Then based on this WSDL, the code should be generated. Following are the advantages of using contract first approach.
  • Loose coupling between applications
  • Interoperability between multiple services
  • Abstraction hides underlying implementation details
  • Collaboration and agreement between all parties

Saturday, June 20, 2009

Prof: V. K. Samaranayake Commemoration

The Students' Union of UCSC commemorated late Prof. V.K. Samaranayake by donating equipment to Army Hospital at Narahenpita on 18.06.2009. Prof. Samaranayake was considered the "Father of Information Technology" in Sri Lanka.

Tuesday, June 2, 2009

Writing a Web Server in C

Though the above heading may give you a headache when thinking "how to do it?", in practical sense it is pretty simple. I'm not talking about a fully functioning Web Server with wide array of functionalities, but a simple Web Server that will cater basic requirements of a Web Server. Through web surfing I found out some interesting web links which helped me to write my simple Web Server.

The way in which I did it was,
  1. First, got hold of a chat server (I used a one which I have written already).
  2. Then implemented the logic for handling http.

Following links helped me a lot in understanding the domain knowledge. If you'd like to have a look at the code feel free to drop a comment, I will be more than happy to share it with you :) .

MPI vs Pthread

I did a performance comparison between my MPI & pthread codes for Matrix multiplication. Matrices used were 1000*1000 and MPI code was run on UCSC's swelanka cluster (using 4 CPUs). While the MPI code took only 2.6 seconds to multiply two 1000*1000 matrices, the pthread code took more that 45 seconds(on avg).

Checking Hardware configuration of your Linux Distribution

Following are some useful commands to check your h/w configuration in linux.

1.Linux Flavor
$ cat /etc/issue

$ cat /proc/cpuinfo

$ cat /proc/meminfo

4.Hard Disk
$ df -h