<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5788585182362034570</id><updated>2011-11-14T04:24:27.387-08:00</updated><category term='music'/><category term='MObie Train Time table'/><title type='text'>Charith's Blog SPOT</title><subtitle type='html'>This is the blog space of Charith Dhanushka Wickramarachchi</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://charithwiki.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://charithwiki.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>CharithWiki</name><uri>http://www.blogger.com/profile/11621891184662231243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SbpO7BJKblI/AAAAAAAAADo/inO_nIjM-Pg/S220/me2.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5788585182362034570.post-7195779670501849957</id><published>2011-11-14T03:57:00.000-08:00</published><updated>2011-11-14T04:24:27.459-08:00</updated><title type='text'>Patterns in Science</title><content type='html'>&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0);  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  font-family:'Times New Roman';font-size:100%;"  &gt;&lt;div  style="background- ;color:transparent;"&gt;&lt;span id="internal-source-marker_0.9727441093418747" style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;In science we see problems , solutions and explanations . Most interesting thing about this is we can see same solutions get repeated in  different ways in different branches of science. &lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;In this blog i’m going to explain a common solution pattern we see.&lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;Recently i wrote and published an article named “&lt;/span&gt;&lt;a href="http://wso2.org/library/articles/2011/10/implementing-store-forward-messaging-patterns-wso2esb-part-1"&gt;&lt;span style="  color: rgb(59, 93, 133); background-color: rgb(238, 239, 239); font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Tahoma;" &gt;Implementing Store and Forward Messaging Patterns With WSO2ESB Part 1&lt;/span&gt;&lt;/a&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;” which explains how to implement store and forward messaging patterns using WSO2 Enterprise service bus. &lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;One problem solved using Store and forwarded messaging patters is integrating systems that accepts different message rates or traffic patterns. As an example say there is a system that provides a service but that service can accept messages below a certain rate say 500msg/sec.&lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;Requirement is to integrate it with another system. Now say if that system produces messages at average rate of 400msg/sec but it can have message rate spikes (ex : 800msg/sec). So One way to solve this problem is to have an intermediate storage for messages inside the message flow where message will get stored and then forwarded it to the destination at a constant rate. (Above mention article gives an example to implement this kind of a scenario). &lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;But if we look around we can see same generic problem is solved using the same generic solution in different scenarios. &lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;Scenario 1. &lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;Irrigation systems :&lt;/span&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;Problem : In rain season we get lot of excess water which can’t be applied to the cultivation directly. &lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;Solution : Store water in tanks and release them in a slow rate throughout the year.&lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;dev&gt;&lt;br /&gt;&lt;img src="http://www.vanlanka.com/images/IMG_6070.jpg" width="400" /&gt;&lt;br /&gt;&lt;/dev&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;Scenario 2&lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;AC to DC conversion :&lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;Problem : How to deliver a smooth constant DC voltage output from a AC source when we use a full wave or half wave rectification circuit using a diode bridge to do the conversion. &lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;Solution : After rectification use a Capacitor to store the charges and let it discharge at its slow discharge rate which will results a somewhat smooth  DC current. &lt;/span&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;dev&gt;&lt;br /&gt;&lt;img src="http://1.bp.blogspot.com/-4glTqIEBtaY/TsEFw0FWNwI/AAAAAAAAAM0/oG68reXdp2o/s320/ac_dc.jpg" border="0" /&gt;&lt;br /&gt;&lt;/dev&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;font-family:Arial;" &gt;And also the same pattern is indirectly used on old Sri Lanken irrigation systems to reduce the output water &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0);  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;  font-family:'Times New Roman';font-size:100%;"  &gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;pressure &lt;/span&gt;&lt;/span&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;of the Water Tanks.We call it “Bisokutuwa”. see &lt;/span&gt;&lt;a href="http://www.sinhalaya.com/network/index.php?topic=557.0"&gt;&lt;span style="  color: rgb(0, 0, 153); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;http://www.sinhalaya.com/network/index.php?topic=557.0&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;dev&gt;&lt;br /&gt;&lt;img src="http://farm4.static.flickr.com/3446/3864709903_6893f111f2.jpg" width="400" /&gt;&lt;br /&gt;&lt;/dev&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="  color: rgb(0, 0, 0); background- font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; font-family:Arial;" &gt;So we can see in all these scenarios we have used the generic solution “store and forward” to solve the generic problem of “integrating different output rates with different input rates”.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5788585182362034570-7195779670501849957?l=charithwiki.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://charithwiki.blogspot.com/feeds/7195779670501849957/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5788585182362034570&amp;postID=7195779670501849957' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/7195779670501849957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/7195779670501849957'/><link rel='alternate' type='text/html' href='http://charithwiki.blogspot.com/2011/11/patterns-in-science.html' title='Patterns in Science'/><author><name>CharithWiki</name><uri>http://www.blogger.com/profile/11621891184662231243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SbpO7BJKblI/AAAAAAAAADo/inO_nIjM-Pg/S220/me2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-4glTqIEBtaY/TsEFw0FWNwI/AAAAAAAAAM0/oG68reXdp2o/s72-c/ac_dc.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5788585182362034570.post-2611115482874609251</id><published>2011-08-20T21:20:00.001-07:00</published><updated>2011-08-20T21:55:45.170-07:00</updated><title type='text'>Understanding and Terminating the Enemy- Deadlocks</title><content type='html'>Concurrent programming is hard. And its even hard when you do it badly. Deadlocks are one of the classical enemies you must try to avoid when writing a concurrent program. Because if you face any deadlocks in your program its really hard to find and fix them.&lt;br /&gt;&lt;br /&gt;In this post i’m trying to explain what deadlocks are  and I’ll explain how to debug a program to find and fix deadlocks.&lt;br /&gt;&lt;br /&gt;There are different definitions for deadlock personally i prefer the following definition since i feel its the perfect one.&lt;br /&gt;&lt;br /&gt;“A set of processes is deadlocked if each process in the set is waiting for an event that only another process in the set can cause (including itself)” [1]&lt;br /&gt;&lt;br /&gt;There are four necessary conditions to be there in a program if its leading to a deadlock. Which means if a program ended up in a deadlock state it that program will satisfy following four conditions.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Mutual exclusion : The resources that must involve in the problem must only have mutually exclusive access.  Which means only an one thread/ process can have the access to the resources at one time.&lt;/li&gt;&lt;li&gt; Hold and wait : There are threads / processors   that hold resource/s and wait for another.&lt;/li&gt;&lt;li&gt; Non preemptive - The resources that are held by one processes can’t be forcefully released.&lt;/li&gt;&lt;li&gt; Circular wait condition : The processes in the system form a circular  list or chain where each process in the list is waiting for a resource  held by the next process in the list&lt;/li&gt;&lt;/ol&gt;There will be no deadlocks in a program if it does not satisfy all these conditions .&lt;br /&gt;&lt;br /&gt;I’ll explain a simple programming example that will demonstrate a simple deadlock.&lt;br /&gt;&lt;br /&gt;&lt;pre style="padding: 1px; overflow: auto; width: 600px; height: 300px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;public class Resource {&lt;br /&gt;&lt;br /&gt;private Object lockA = new Object();&lt;br /&gt;&lt;br /&gt;private Object lockB = new Object();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public void accessA() {&lt;br /&gt;  synchronized (lockA) {&lt;br /&gt;&lt;br /&gt;      //Access resource A&lt;br /&gt;      System.out.println("GOT A waiting for B");&lt;br /&gt;      synchronized (lockB) {&lt;br /&gt;          //Access resource B&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;  System.out.println("Done accessA");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void accessB() {&lt;br /&gt;  synchronized (lockB) {&lt;br /&gt;      //Access resource B&lt;br /&gt;      System.out.println("GOT B waiting for A");&lt;br /&gt;      synchronized (lockA) {&lt;br /&gt;          //Access resource A&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;  System.out.println("Done accessB");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Look at the above Resource class. It got two public methods accessA and accessB. and two locks that protect resources A and resource B from accessing them in parallel.&lt;br /&gt;&lt;br /&gt;if two threads try to invoke this two methods in parallel there can be a deadlock scenario where thread 1 will get the lock for A and waiting for B without releasing the lock for A and other thread will get lock for B and wait for the lock for A. This is the simplest scenario that a deadlock can happen between two threads.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If we look at the program you can see all the necessary conditions are satisfied by that program.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Mutual exclusion : resource A and B are Mutual exclusive resources ( Only one thread can access a resource at one time).&lt;/li&gt;&lt;li&gt;Hold and wait  : The threads that invoke accessA and accessB methods will hold one resource and wait for another.&lt;/li&gt;&lt;li&gt;Non preemptive : In this program there is not way for us to signal a thread to release a resource forcefully.&lt;/li&gt;&lt;li&gt;Circular wait condition :  thread1 &amp;lt;-&amp;gt;  thread2&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Now lets look at how we can eliminate deadlocks. I do not think there is such mechanical way to remove deadlocks from programs. And some times we will have to understand the lock access order of the program and change them in a such a way that they won’t endup in a cycle/s.If its not possible one thing we can do is track the lock order and detect possible deadlocks and forcefully terminate that thread or resource access.(Preemption)&lt;br /&gt;&lt;br /&gt;When writing a complex concurrent program with lot of locks its hard to keep track of the lock order. So identifying possible deadlocks in program can be really useful when writing complex program. And it will be a great advantage if we can have a tool that can be used to identify possible deadlocks.  I came across this tool JCarder[2] which i find really useful when analyzing programs for deadlocks. And the major advantage i see here is i could integrate it with integration tests.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;JCarder detect possible deadlocks by instrumenting programs byte code and tracking the lock order in runtime. Which means it may not detect all the deadlocks in your program as a given execution will not cover all the code.&lt;br /&gt;&lt;br /&gt;you can run your program with jcarder by passing vm parameter -javaagent:path/to/jcarder.jar&lt;br /&gt;&lt;br /&gt;ex :&lt;br /&gt;&lt;br /&gt;&lt;pre style="padding: 1px; overflow: auto; width: 600px; height: 50px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;java -javaagent:path/to/jcarder.jar -jar yourprogram.jar&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Then when your program executes jcarder will dump logs to a file which can be used later to analyze the deadlocks.&lt;br /&gt;&lt;br /&gt;Then you can stop the program when you want and run the analyzer with command&lt;br /&gt;&lt;br /&gt;&lt;pre style="padding: 1px; overflow: auto; width: 600px; height: 50px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;java -jar jcarder.jar&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Following is the report i got when i execute the above explained program.&lt;br /&gt;&lt;br /&gt;&lt;pre style="padding: 1px; overflow: auto; width: 600px; height: 200px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;Loaded from database files:&lt;br /&gt;Nodes: 2&lt;br /&gt;Edges: 2 (excluding 0 duplicated)&lt;br /&gt;&lt;br /&gt;Cycle analysis result:&lt;br /&gt;Cycles:          1&lt;br /&gt;Edges in cycles: 2&lt;br /&gt;Nodes in cycles: 2&lt;br /&gt;Max cycle depth: 2&lt;br /&gt;Max graph depth: 2&lt;br /&gt;&lt;br /&gt;Ignoring 0 gated cycle(s).&lt;br /&gt;Ignoring 0 almost identical cycle(s).&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Finally if deadlocks are found it will generate a .dot file which can be visualized using dotty&lt;br /&gt;&lt;br /&gt;ex :&lt;br /&gt;$dotty jcarder_result_0.dot&lt;br /&gt;or&lt;br /&gt;$dot -T png -o example.png jcarder_result_0.dot&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Following is the output i got for my program which clearly shows the deadlock.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-Ygw_P4lKw8k/TlCHxTmC_QI/AAAAAAAAAMM/rsXOZutFTEs/s1600/deadlock.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 193px;" src="http://2.bp.blogspot.com/-Ygw_P4lKw8k/TlCHxTmC_QI/AAAAAAAAAMM/rsXOZutFTEs/s320/deadlock.png" alt="" id="BLOGGER_PHOTO_ID_5643159614238424322" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Deadlocks are hard to debug and terminate so its always better to write programs carefully so that there won’t be any deadlocks :)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[1]http://homepages.uel.ac.uk/u0214248/Harriet3.htm&lt;br /&gt;[2]http://www.jcarder.org/&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5788585182362034570-2611115482874609251?l=charithwiki.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://charithwiki.blogspot.com/feeds/2611115482874609251/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5788585182362034570&amp;postID=2611115482874609251' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/2611115482874609251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/2611115482874609251'/><link rel='alternate' type='text/html' href='http://charithwiki.blogspot.com/2011/08/understanding-and-terminating-enemy.html' title='Understanding and Terminating the Enemy- Deadlocks'/><author><name>CharithWiki</name><uri>http://www.blogger.com/profile/11621891184662231243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SbpO7BJKblI/AAAAAAAAADo/inO_nIjM-Pg/S220/me2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-Ygw_P4lKw8k/TlCHxTmC_QI/AAAAAAAAAMM/rsXOZutFTEs/s72-c/deadlock.png' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5788585182362034570.post-7107060953162760212</id><published>2011-06-12T19:07:00.000-07:00</published><updated>2011-06-12T19:11:38.680-07:00</updated><title type='text'>WSO2 Enterprise Service Bus 4.0.0 Released!</title><content type='html'>&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial,sans-serif; font-size: 13px;"&gt;&lt;span style="border-collapse: collapse; font-family: Verdana,Arial,Helvetica,sans-serif; line-height: 16px;"&gt;The WSO2 ESB team is pleased to announce the release of version 4.0.0 of the Open Source Enterprise Service Bus (ESB).&lt;/span&gt;&lt;span style="border-collapse: collapse; font-family: arial,sans-serif;"&gt;&lt;p style="font-family: Verdana,Arial,Helvetica,sans-serif; line-height: 1.3em; font-size: small;"&gt;WSO2 ESB is a fast, lightweight and user friendly open source Enterprise Service Bus (ESB) distributed under the &lt;a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank" style="color: rgb(51, 102, 204); text-decoration: none; padding-right: 18px;"&gt;Apache Software License v2.0&lt;/a&gt;. WSO2 ESB allows system administrators and developers to easily configure message routing, intermediation, transformation, logging, task scheduling, fail over routing and load balancing. It also supports transport switching, eventing, rule based mediation and priority based mediation for advanced integration requirements. The ESB runtime is designed to be completely asynchronous, non-blocking and streaming based on the &lt;a href="http://synapse.apache.org/" target="_blank" style="color: rgb(51, 102, 204); text-decoration: none; padding-right: 18px;"&gt;Apache Synapse&lt;/a&gt; mediation engine.&lt;/p&gt;&lt;p style="font-family: Verdana,Arial,Helvetica,sans-serif; line-height: 1.3em; font-size: small;"&gt;WSO2 ESB 4.0.0 is developed on top of the revolutionary &lt;a href="http://wso2.org/projects/carbon" target="_blank" style="color: rgb(51, 102, 204); text-decoration: none; padding-right: 18px;"&gt;WSO2 Carbon platform&lt;/a&gt; (Middleware a' la carte), an OSGi based framework that provides seamless modularity to your SOA via componentization. This release also contains many new features and a range of optional components (add-ons) that can be installed to customize the behavior of the ESB. Further, any existing features of the ESB which are not required to your environment can be easily removed using the underlying provisioning framework of Carbon. In brief, WSO2 ESB can be fully customized and tailored to meet your exact SOA needs.&lt;/p&gt;&lt;p style="font-family: Verdana,Arial,Helvetica,sans-serif; line-height: 1.3em; font-size: small;"&gt;You can download this distribution from &lt;a href="http://wso2.org/downloads/esb" target="_blank" style="color: rgb(51, 102, 204); text-decoration: none; padding-right: 18px;"&gt;http://wso2.org/&lt;wbr&gt;downloads/esb&lt;/a&gt;and give it a try.&lt;/p&gt;&lt;p style="font-family: Verdana,Arial,Helvetica,sans-serif; line-height: 1.3em; font-size: small;"&gt;&lt;b&gt;Brand New Features in this Release&lt;/b&gt;&lt;/p&gt;&lt;p style="font-size: 13px;"&gt;&lt;/p&gt;&lt;ul style="font-family: Verdana,Arial,Helvetica,sans-serif; line-height: 18px; font-size: 12px;"&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;HTTP relay transport - Pure streaming HTTP transport based on Java NIO for ultra fast HTTP routing&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Deployment synchronizer - Easily synchronize the configuration across a cluster of Carbon Servers&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Message stores and processors - For advanced enterprise messaging and QoS enforcement (eg: in-order delivery, exactly once delivery)&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Mediation templates - The concept of reusable functions to the ESB configuration language&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Message broker - Built-in JMS provider/broker powered by Apache Qpid&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;FTPS support via file transport - Transfer files over SSH connections&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Conditional router mediator - Implement advanced and complex routing logic at ease&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;URL rewrite mediator - Rewrite URLs and URL fragments efficiently&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Custom XPath extensions - User defined custom XPath extensions support&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;New HL7 transport (optional) - Send and receive HL7 messages over MLLP and other transports&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;New eventing implementation - A powerful event broker with extensive support for WS-Eventing and topic management&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Event mediator - Publish events to topics defined in the built-in event broker&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;LDAP user store - Built-in LDAP service based on Apache Directory Server&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Dynamic registry keys and endpoint URL support - Construct registry lookup keys and endpoint URLs dynamically at mediation time&lt;/li&gt;&lt;/ul&gt;&lt;div style="font-size: 13px;"&gt;&lt;span style="font-family:Verdana, Helvetica, Arial, sans-serif;"&gt;&lt;b&gt;&lt;span style="line-height: 18px;"&gt;Enhancements&lt;/span&gt;&lt;span style="line-height: 18px;"&gt; in this Release&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-size: 13px;"&gt;&lt;span style="font-family:Verdana, Helvetica, Arial, sans-serif;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;ul style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 12px;"&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Improved Smooks mediator&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Enhanced support for service chaining with the receiving sequence support in the send mediator&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Improved weighted round robin algorithm for the load balance endpoint&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Improvements to caching&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Automatic schema imports from the WSDLs added to the registry (for proxy services)&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Automatic schema imports from the schema files added to the registry (for validate mediator)&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Support for setting properties at the endpoint level&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Enhanced Enrich Mediator&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Improved support for batch transfers in FIX transport&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Validation support for the ESB configuration editor (source view)&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Proxy service UI enhancements&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Enhanced menu layouts&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Local transport for fast in-VM service calls&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;b&gt;Key Features of WSO2 ESB&lt;/b&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;p style="font-size: 13px;"&gt;&lt;/p&gt;&lt;p style="font-size: 13px; line-height: 1.3em;"&gt;&lt;span style="line-height: 18px;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 12px;"&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Proxy services - facilitating synchronous/asynchronous transport, interface (WSDL/Schema/Policy), message format (SOAP 1.1/1.2, POX/REST, Text, Binary), QoS (WS-Addressing/WS-Security/WS-&lt;wbr&gt;RM) and optimization switching (MTOM/SwA).&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Non-blocking HTTP/S transports based on Apache HttpCore-NIO for ultra-fast execution and support for thousands of connections at high concurrency with constant memory usage.&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Built in Registry/Repository, facilitating dynamic updating and reloading of the configuration and associated resources (e.g. XSLTs, XSD, WSDL, Policies, JS configurations ..)&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Easily extendable via custom Java classes (mediator and command)/Spring configurations, or BSF Scripting languages (Javascript, Ruby, Groovy, etc.)&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Built in support for scheduling tasks using the Quartz scheduler.&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Load-balancing (with or without sticky sessions)/Fail-over, and clustered Throttling and Caching support&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;WS-Security, WS-Reliable Messaging, Caching &amp;amp; Throttling configurable via (message/operation/service level) WS-Policies&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Lightweight, XML and Web services centric messaging model&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Support for industrial standards (Hessian binary web service protocol/ Financial Information eXchange protocol and optional Health Level-7 protocol)&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Enhanced support for the VFS (File/FTP/SFTP), JMS, Mail transports with optional TCP/UDP transports and transport switching among any of the above transports&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Support for message splitting &amp;amp; aggregation using the EIP and service callouts&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Database lookup &amp;amp; store support with DBMediators with reusable database connection pools&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;WS-Eventing support with event sources and event brokering&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Rule based mediation of the messages using the Drools rule engine&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Transactions support via the JMS transport and Transaction mediator for database mediators&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Internationalized GUI management console with user management for configuration development&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Integrated monitoring support with statistics, configurable logging and tracing&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;JMX monitoring support and JMX management capabilities like, Graceful/Forceful shutdown/restart&lt;/li&gt;&lt;/ul&gt;&lt;div style="font-size: 13px;"&gt;&lt;span style="font-family:Verdana, Helvetica, Arial, sans-serif;"&gt;&lt;b&gt;Bugs Fixed in this Release&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-size: 13px;"&gt;&lt;span style="font-family:Verdana, Helvetica, Arial, sans-serif;"&gt;&lt;p style="font-family: Verdana,Arial,Helvetica,sans-serif; line-height: 1.3em; font-size: small;"&gt;This release of WSO2 ESB comes with a number of bug fixes, both in the base framework and the ESB specific components. All the issues which have been fixed in ESB 4.0.0 are recorded at following locations:&lt;/p&gt;&lt;ul style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 12px;"&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;&lt;a href="https://wso2.org/jira/secure/IssueNavigator.jspa?requestId=10522" target="_blank" style="color: rgb(51, 102, 204); text-decoration: none; padding-right: 18px;"&gt;Fixed ESB specific issues&lt;/a&gt;&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;&lt;a href="https://wso2.org/jira/secure/IssueNavigator.jspa?requestId=10523" target="_blank" style="color: rgb(51, 102, 204); text-decoration: none; padding-right: 18px;"&gt;Fixed base framework issues&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;b&gt;Known Issues&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;p style="font-family: Verdana,Arial,Helvetica,sans-serif; line-height: 1.3em; font-size: small;"&gt;All the open issues pertaining to WSO2 ESB 4.0.0 are reported at following locations:&lt;/p&gt;&lt;ul style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 12px;"&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;&lt;a href="https://wso2.org/jira/secure/IssueNavigator.jspa?requestId=10524" target="_blank" style="color: rgb(51, 102, 204); text-decoration: none; padding-right: 18px;"&gt;WSO2 ESB 4.0.0 component issues&lt;/a&gt;&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;&lt;a href="https://wso2.org/jira/secure/IssueNavigator.jspa?requestId=10525" target="_blank" style="color: rgb(51, 102, 204); text-decoration: none; padding-right: 18px;"&gt;WSO2 ESB 4.0.0 base framework issues&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="line-height: 18px;"&gt;&lt;b&gt;How to Run&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="line-height: 18px;"&gt;&lt;span style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 12px;"&gt;&lt;ol type="1"&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Extract the downloaded zip&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Go to the bin directory in the extracted folder&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Run the wso2server.sh or wso2server.bat as appropriate&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Point your browser to the URL &lt;a href="https://localhost:9443/carbon" target="_blank" style="color: rgb(0, 0, 204);"&gt;https://localhost:9443/&lt;wbr&gt;carbon&lt;/a&gt;&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Use "admin", "admin" as the username and password to login as an admin&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;If you need to start the OSGi console with the server use the property -DosgiConsole when starting the server. The INSTALL.txt file found on the installation directory will give you a comprehensive set of options and properties that can be passed into the startup script&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px;"&gt;Sample configurations can be started by the wso2esb-samples script passing the sample number with the -sn option (Please have a look at the samples guide for more information, on running samples)&lt;/li&gt;&lt;/ol&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;p style="font-size: 13px;"&gt;&lt;/p&gt;&lt;p style="font-family: Verdana,Arial,Helvetica,sans-serif; line-height: 1.3em; font-size: small;"&gt;&lt;b&gt;How to Contribute&lt;/b&gt;&lt;/p&gt;&lt;p style="font-family: Verdana,Arial,Helvetica,sans-serif; line-height: 1.3em; font-size: small;"&gt;&lt;b&gt;Mailing Lists&lt;/b&gt;&lt;/p&gt;&lt;p style="font-size: 13px; line-height: 1.3em;"&gt;&lt;b&gt;&lt;span style="line-height: 18px;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p style="font-family: Verdana,Arial,Helvetica,sans-serif; line-height: 1.3em; font-size: small;"&gt;Join our mailing list and correspond with the developers directly.&lt;/p&gt;&lt;ul style="font-family: Verdana,Arial,Helvetica,sans-serif;"&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; line-height: 18px;"&gt;Developer List : &lt;a href="mailto:carbon-dev@wso2.org" target="_blank" style="color: rgb(51, 102, 204); text-decoration: none; padding-right: 18px;"&gt;carbon-dev@wso2.org&lt;/a&gt; | &lt;a href="mailto:carbon-dev-request@wso2.org?subject=subscribe" target="_blank" style="color: rgb(51, 102, 204); text-decoration: none; padding-right: 18px;"&gt;Subscr&lt;wbr&gt;ibe&lt;/a&gt; | &lt;a href="http://wso2.org/mailarchive/carbon-dev/" target="_blank" style="color: rgb(51, 102, 204); text-decoration: none; padding-right: 18px;"&gt;Mail Archive&lt;/a&gt;&lt;/li&gt;&lt;li style="margin-left: 15px; font-family: Verdana,Helvetica,Arial,sans-serif; line-height: 18px;"&gt;User List : &lt;a href="mailto:esb-java-user@wso2.org" target="_blank" style="color: rgb(51, 102, 204); text-decoration: none; padding-right: 18px;"&gt;esb-java-user@wso2.org&lt;/a&gt; | &lt;a href="mailto:esb-java-user-request@wso2.org?subject=subscribe" target="_blank" style="color: rgb(51, 102, 204); text-decoration: none; padding-right: 18px;"&gt;Sub&lt;wbr&gt;scribe&lt;/a&gt; | &lt;a href="http://wso2.org/mailarchive/esb-java-user/" target="_blank" style="color: rgb(51, 102, 204); text-decoration: none; padding-right: 18px;"&gt;Mail Archive&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="font-size: 13px;"&gt;&lt;b&gt;&lt;span style="font-family:Verdana, Helvetica, Arial, sans-serif;"&gt;Reporting Issues&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="font-size: 13px;"&gt;&lt;span style="font-family:Verdana, Helvetica, Arial, sans-serif;"&gt;&lt;span style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 12px;"&gt;&lt;p style="font-weight: normal; line-height: 1.3em; font-size: small;"&gt;We encourage you to report issues, documentation faults and feature requests regarding WSO2 ESB through the public &lt;a href="http://www.wso2.org/jira/browse/ESBJAVA" target="_blank" style="color: rgb(51, 102, 204); text-decoration: none; padding-right: 18px;"&gt;ESB JIRA&lt;/a&gt;. You can use the &lt;a href="http://www.wso2.org/jira/browse/CARBON" target="_blank" style="color: rgb(51, 102, 204); text-decoration: none; padding-right: 18px;"&gt;Carbon JIRA&lt;/a&gt; to report any issues related to the Carbon base framework or associated Carbon components.&lt;/p&gt;&lt;p style="font-weight: bold; line-height: 1.3em; font-size: small;"&gt;Discussion Forums&lt;/p&gt;&lt;p style="font-weight: normal; line-height: 1.3em; font-size: small;"&gt;&lt;span style="font-size: 12px; line-height: 18px;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="line-height: 1.3em; font-size: small;"&gt;Alternatively, questions could be raised using the forums available.&lt;/p&gt;&lt;p style="line-height: 1.3em; font-size: small;"&gt;&lt;a href="http://wso2.org/forum/187" target="_blank" style="color: rgb(51, 102, 204); text-decoration: none; padding-right: 18px;"&gt;WSO2 ESB Forum&lt;/a&gt;&lt;b&gt;:&lt;/b&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;Discussion forum for WSO2 ESB developers/users&lt;/p&gt;&lt;/span&gt;&lt;p style="font-weight: bold;"&gt;&lt;/p&gt;&lt;div style="font-weight: bold;"&gt;Support&lt;/div&gt;&lt;div style="font-weight: normal;"&gt;&lt;p style="line-height: 1.3em; font-size: small;"&gt;We are committed to ensuring that your enterprise middleware deployment is completely supported from evaluation to production. Our unique approach ensures that all support leverages our open development methodology and is provided by the very same engineers who build the technology.&lt;/p&gt;&lt;p style="line-height: 1.3em; font-size: small;"&gt;For more details and to take advantage of this unique opportunity please visit &lt;a href="http://wso2.com/support" target="_blank" style="color: rgb(51, 102, 204); text-decoration: none; padding-right: 18px;"&gt;http://wso2.com/support&lt;/a&gt;.&lt;/p&gt;&lt;p style="line-height: 1.3em; font-size: small;"&gt;For more information about WSO2 ESB please see &lt;a href="http://wso2.com/products/enterprise-service-bus/" target="_blank" style="color: rgb(51, 102, 204); text-decoration: none; padding-right: 18px;"&gt;http://wso2.com/products/&lt;wbr&gt;enterprise-service-bus&lt;/a&gt;.&lt;/p&gt;&lt;p style="line-height: 1.3em; font-size: small;"&gt;&lt;i&gt;-- The WSO2 ESB Team --&lt;/i&gt;&lt;/p&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5788585182362034570-7107060953162760212?l=charithwiki.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://charithwiki.blogspot.com/feeds/7107060953162760212/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5788585182362034570&amp;postID=7107060953162760212' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/7107060953162760212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/7107060953162760212'/><link rel='alternate' type='text/html' href='http://charithwiki.blogspot.com/2011/06/wso2-enterprise-service-bus-400.html' title='WSO2 Enterprise Service Bus 4.0.0 Released!'/><author><name>CharithWiki</name><uri>http://www.blogger.com/profile/11621891184662231243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SbpO7BJKblI/AAAAAAAAADo/inO_nIjM-Pg/S220/me2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5788585182362034570.post-7977314746808561881</id><published>2011-02-15T21:11:00.000-08:00</published><updated>2011-02-15T22:02:51.854-08:00</updated><title type='text'>Web Service Orchestration with an ESB</title><content type='html'>Web service orchestration can be thought as a process of combining and coordinating of different web services based on a predefined pattern to give a desired result.&lt;br /&gt;&lt;br /&gt;Web Service Orchestration  is one of many features that comes with an ESB (see [1]). Even though Business process servers  can be used for this kind of tasks , using a business process server for a simple service orchestration scenario will be a waste of time. So  in this blog post i’ll explain how we can use an ESB for service orchestration which will be a much simpler task.. I’ll be using WSO2 ESB 3.0.1 for this.&lt;br /&gt;&lt;br /&gt;Let’s 1st come up with a scenario.&lt;br /&gt;&lt;br /&gt;There are consultants  who can give us some advices on life when we are in need. So lets try to have a consulting service.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.istockphoto.com/file_thumbview_approve/522838/2/istockphoto_522838-guru.jpg"&gt;&lt;img style="cursor: pointer; width: 322px; height: 380px;" src="http://www.istockphoto.com/file_thumbview_approve/522838/2/istockphoto_522838-guru.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;But to consult a “Life guru” or the consultant 1st we need to get a ticket and then go to the “Life guru ” with that ticket.&lt;br /&gt;&lt;br /&gt;Following is the high level message flow for this scenario&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-S_7RPWeg3cc/TVtkBdqZgsI/AAAAAAAAAK0/AFELm9c7A3U/s1600/ServiceChain.png"&gt;&lt;img style="cursor: pointer; width: 320px; height: 240px;" src="http://4.bp.blogspot.com/-S_7RPWeg3cc/TVtkBdqZgsI/AAAAAAAAAK0/AFELm9c7A3U/s320/ServiceChain.png" alt="" id="BLOGGER_PHOTO_ID_5574158940106228418" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1) Client invoke ESB proxy service with Parameters name and age&lt;br /&gt;2) ESB store the details and invoke Ticketing Service&lt;br /&gt;3) Ticketing service return a ticket&lt;br /&gt;4 ) ESB invoke consulting service with details name , age and ticket number&lt;br /&gt;5) Consulting service returns the life advice&lt;br /&gt;6) ESB pass the life advice to the client.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To implement this 1st we need to have some Services. So i’ll be creating two axis2 pojo services [2] for this.&lt;br /&gt;&lt;br /&gt;1. TicketCounterService - input : void  output : ticket number&lt;br /&gt;2. ConsultingService - input : name , age , ticketnumber output : life advice&lt;br /&gt;&lt;br /&gt;After having those service created and deployed (i used axis2 for service deployment).&lt;br /&gt;Having those services deployed we can go in to the  implementation of the  ESB logic.&lt;br /&gt;&lt;br /&gt;In WSO2 esb we will be creating a proxy service that excepts  users name and age.It will then invoke the other services and then return the life advice back to the user.&lt;br /&gt;&lt;br /&gt;We can use WSO2 ESB console to create the proxy service. I have choose to create  a custom proxy and named it as ConsultingProxyService. and also i’m publishing a wsdl from this proxy so that there will be contract between ESB and the client.&lt;br /&gt;&lt;br /&gt;Since ESB proxy must only accept users name and age. I edited the ConsultingServices wsdl by removing the ticket number input parameter.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-9iZewUm1oC0/TVtkXbolyhI/AAAAAAAAAK8/9lv3CQGjMfk/s1600/CreateCustomProxy.png"&gt;&lt;img style="cursor: pointer; width: 320px; height: 180px;" src="http://4.bp.blogspot.com/-9iZewUm1oC0/TVtkXbolyhI/AAAAAAAAAK8/9lv3CQGjMfk/s320/CreateCustomProxy.png" alt="" id="BLOGGER_PHOTO_ID_5574159317518895634" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Final Proxy service configuration will look like this.&lt;br /&gt;&lt;br /&gt;&lt;pre style="padding: 1px; overflow: auto; width: 600px; height: 300px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;proxy name="ConsultingProxyService" transports="https http" startOnLoad="true" trace="disable"&amp;gt;&lt;br /&gt;    &amp;lt;target&amp;gt;&lt;br /&gt;        &amp;lt;inSequence&amp;gt;&lt;br /&gt;            &amp;lt;property xmlns:char="http://charith.wickramarachchi.org" name="cname" expression="//char:name" scope="default"/&amp;gt;&lt;br /&gt;            &amp;lt;property xmlns:char="http://charith.wickramarachchi.org" name="cage" expression="//char:age" scope="default"/&amp;gt;&lt;br /&gt;            &amp;lt;enrich&amp;gt;&lt;br /&gt;                &amp;lt;source type="inline"&amp;gt;&lt;br /&gt;                    &amp;lt;p:getTicket xmlns:p="http://charith.wickramarachchi.org"/&amp;gt;&lt;br /&gt;                &amp;lt;/source&amp;gt;&lt;br /&gt;                &amp;lt;target type="body"/&amp;gt;&lt;br /&gt;            &amp;lt;/enrich&amp;gt;&lt;br /&gt;            &amp;lt;property name="count" value="1" scope="default" type="STRING"/&amp;gt;&lt;br /&gt;            &amp;lt;send&amp;gt;&lt;br /&gt;                &amp;lt;endpoint name="endpoint_urn_uuid_29C989B1BAE1F0A05F46088096875141764187336"&amp;gt;&lt;br /&gt;                    &amp;lt;address uri="http://localhost:8080/axis2/services/TicketCounterService"/&amp;gt;&lt;br /&gt;                &amp;lt;/endpoint&amp;gt;&lt;br /&gt;            &amp;lt;/send&amp;gt;&lt;br /&gt;            &amp;lt;log level="custom"&amp;gt;&lt;br /&gt;                &amp;lt;property name="Status" value="TicketCounterService Invoked"/&amp;gt;&lt;br /&gt;                &amp;lt;property name="cname" expression="get-property('cname')"/&amp;gt;&lt;br /&gt;                &amp;lt;property name="cage" expression="get-property('cage')"/&amp;gt;&lt;br /&gt;            &amp;lt;/log&amp;gt;&lt;br /&gt;        &amp;lt;/inSequence&amp;gt;&lt;br /&gt;        &amp;lt;outSequence&amp;gt;&lt;br /&gt;            &amp;lt;switch source="get-property('count')"&amp;gt;&lt;br /&gt;                &amp;lt;case regex="1"&amp;gt;&lt;br /&gt;                    &amp;lt;property name="count" value="2" scope="default" type="STRING"/&amp;gt;&lt;br /&gt;                    &amp;lt;xslt key="consultingServiceTransfrom"&amp;gt;&lt;br /&gt;                        &amp;lt;property name="cname" expression="get-property('cname')"/&amp;gt;&lt;br /&gt;                        &amp;lt;property name="cage" expression="get-property('cage')"/&amp;gt;&lt;br /&gt;                    &amp;lt;/xslt&amp;gt;&lt;br /&gt;                    &amp;lt;log level="full"&amp;gt;&lt;br /&gt;                        &amp;lt;property name="Status" value="Case2 Invoked"/&amp;gt;&lt;br /&gt;                    &amp;lt;/log&amp;gt;&lt;br /&gt;                    &amp;lt;send&amp;gt;&lt;br /&gt;                        &amp;lt;endpoint name="endpoint_urn_uuid_29C989B1BAE1F0A05F44795543807521144284854"&amp;gt;&lt;br /&gt;                            &amp;lt;address uri="http://localhost:8080/axis2/services/ConsultingService"/&amp;gt;&lt;br /&gt;                        &amp;lt;/endpoint&amp;gt;&lt;br /&gt;                    &amp;lt;/send&amp;gt;&lt;br /&gt;                &amp;lt;/case&amp;gt;&lt;br /&gt;                &amp;lt;case regex="2"&amp;gt;&lt;br /&gt;                    &amp;lt;send/&amp;gt;&lt;br /&gt;                &amp;lt;/case&amp;gt;&lt;br /&gt;            &amp;lt;/switch&amp;gt;&lt;br /&gt;        &amp;lt;/outSequence&amp;gt;&lt;br /&gt;    &amp;lt;/target&amp;gt;&lt;br /&gt;    &amp;lt;publishWSDL uri="file:///home/charith/Public/blogg/ServiceChaining/ConsultingProxyService.wsdl"/&amp;gt;&lt;br /&gt;&amp;lt;/proxy&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;When a message comes to the proxy service 1st it will go in to the insequence of the proxy service. Where 1st it will store the  name and age details in the message context. and then we will replace the body of the message with getTicket request message to invoke the Ticketconuter service. and then invoke the TocketCounter service. We also add the property named count to track the status of the service orchestration process.&lt;br /&gt;&lt;br /&gt;&lt;pre style="padding: 1px; overflow: auto; width: 600px; height: 300px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;inSequence&amp;gt;&lt;br /&gt;             &amp;lt;property xmlns:char="http://charith.wickramarachchi.org" name="cname" expression="//char:name" scope="default"/&amp;gt;&lt;br /&gt;             &amp;lt;property xmlns:char="http://charith.wickramarachchi.org" name="cage" expression="//char:age" scope="default"/&amp;gt;&lt;br /&gt;             &amp;lt;enrich&amp;gt;&lt;br /&gt;                 &amp;lt;source type="inline"&amp;gt;&lt;br /&gt;                     &amp;lt;p:getTicket xmlns:p="http://charith.wickramarachchi.org"/&amp;gt;&lt;br /&gt;                 &amp;lt;/source&amp;gt;&lt;br /&gt;                 &amp;lt;target type="body"/&amp;gt;&lt;br /&gt;             &amp;lt;/enrich&amp;gt;&lt;br /&gt;             &amp;lt;property name="count" value="1" scope="default" type="STRING"/&amp;gt;&lt;br /&gt;             &amp;lt;send&amp;gt;&lt;br /&gt;                 &amp;lt;endpoint name="endpoint_urn_uuid_29C989B1BAE1F0A05F46088096875141764187336"&amp;gt;&lt;br /&gt;                     &amp;lt;address uri="http://localhost:8080/axis2/services/TicketCounterService"/&amp;gt;&lt;br /&gt;                 &amp;lt;/endpoint&amp;gt;&lt;br /&gt;             &amp;lt;/send&amp;gt;&lt;br /&gt;             &amp;lt;log level="custom"&amp;gt;&lt;br /&gt;                 &amp;lt;property name="Status" value="TicketCounterService Invoked"/&amp;gt;&lt;br /&gt;                 &amp;lt;property name="cname" expression="get-property('cname')"/&amp;gt;&lt;br /&gt;                 &amp;lt;property name="cage" expression="get-property('cage')"/&amp;gt;&lt;br /&gt;             &amp;lt;/log&amp;gt;&lt;br /&gt;         &amp;lt;/inSequence&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The reply to the getTicket request will comes to the out sequence of the proxy service. Where we use the count value to determine the response type. If the count value is 1 then its a response from the ticket counter service.&lt;br /&gt;&lt;pre style="padding: 1px; overflow: auto; width: 600px; height: 300px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;&lt;br /&gt;&amp;lt;case regex="1"&amp;gt;&lt;br /&gt;                     &amp;lt;property name="count" value="2" scope="default" type="STRING"/&amp;gt;&lt;br /&gt;                     &amp;lt;xslt key="consultingServiceTransfrom"&amp;gt;&lt;br /&gt;                         &amp;lt;property name="cname" expression="get-property('cname')"/&amp;gt;&lt;br /&gt;                         &amp;lt;property name="cage" expression="get-property('cage')"/&amp;gt;&lt;br /&gt;                     &amp;lt;/xslt&amp;gt;&lt;br /&gt;                     &amp;lt;log level="full"&amp;gt;&lt;br /&gt;                         &amp;lt;property name="Status" value="Case2 Invoked"/&amp;gt;&lt;br /&gt;                     &amp;lt;/log&amp;gt;&lt;br /&gt;                     &amp;lt;send&amp;gt;&lt;br /&gt;                         &amp;lt;endpoint name="endpoint_urn_uuid_29C989B1BAE1F0A05F44795543807521144284854"&amp;gt;&lt;br /&gt;                             &amp;lt;address uri="http://localhost:8080/axis2/services/ConsultingService"/&amp;gt;&lt;br /&gt;                         &amp;lt;/endpoint&amp;gt;&lt;br /&gt;                     &amp;lt;/send&amp;gt;&lt;br /&gt;                 &amp;lt;/case&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;There we set the proerty count to 2 which means we are now going to invoke to ConsultingService. But for that we need to create the request message for that. Thats were we need the message transformation feature in an ESB. WSO2 ESB have few ways of transforming messages.(Ex : Enrichmediator , XSLT mediator) since i have used Enrich mediator before i’ll use XSLT mediator in this.&lt;br /&gt;&lt;br /&gt;The request for CunsultingService must contain name , age and ticket number. But we only have ticket number with in the response message body. That’s where we are going to use the message context properties we added in the in-sequence. Since we are in a single communication session that message context properties will be preserved. So   I m going to pass them as XSLT mediator properties so that i can use them in the xslt transformation .&lt;br /&gt;&lt;br /&gt;following is the xslt transformation .&lt;br /&gt;&lt;br /&gt;&lt;pre style="padding: 1px; overflow: auto; width: 600px; height: 300px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" exclude-result-prefixes="fn" version="2.0"&amp;gt;&lt;br /&gt;         &amp;lt;xsl:param name="cname"/&amp;gt;&lt;br /&gt;         &amp;lt;xsl:param name="cage"/&amp;gt;&lt;br /&gt;         &amp;lt;xsl:template xmlns:char="http://charith.wickramarachchi.org" match="//char:getTicketResponse "&amp;gt;&lt;br /&gt;             &amp;lt;char:consult&amp;gt;&lt;br /&gt;                 &amp;lt;!--Optional:--&amp;gt;&lt;br /&gt;                 &amp;lt;char:name&amp;gt;&lt;br /&gt;                     &amp;lt;xsl:value-of select="$cname"/&amp;gt;&lt;br /&gt;                 &amp;lt;/char:name&amp;gt;&lt;br /&gt;                 &amp;lt;!--Optional:--&amp;gt;&lt;br /&gt;                 &amp;lt;char:age&amp;gt;&lt;br /&gt;                     &amp;lt;xsl:value-of select="$cage"/&amp;gt;&lt;br /&gt;                 &amp;lt;/char:age&amp;gt;&lt;br /&gt;                 &amp;lt;!--Optional:--&amp;gt;&lt;br /&gt;                 &amp;lt;char:ticket&amp;gt;&lt;br /&gt;                     &amp;lt;xsl:value-of select="//char:return"/&amp;gt;&lt;br /&gt;                 &amp;lt;/char:ticket&amp;gt;&lt;br /&gt;             &amp;lt;/char:consult&amp;gt;&lt;br /&gt;         &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;     &amp;lt;/xsl:stylesheet&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The response of the Consulting service will also come to the out sequence but now it will hit the case 2 of the switch since we have set the property count to 2 in the case 1 . In that case we just send the response back to the client&lt;br /&gt;&lt;br /&gt;&lt;pre style="padding: 1px; overflow: auto; width: 600px; height: 100px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;&lt;br /&gt;&amp;lt;case regex="2"&amp;gt;&lt;br /&gt;                     &amp;lt;send/&amp;gt;&lt;br /&gt;                 &amp;lt;/case&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now we are done with the implementation.&lt;br /&gt;&lt;br /&gt;Now i m going to invoke the Proxy service with SOAP request&lt;br /&gt;&lt;br /&gt;&lt;pre style="padding: 1px; overflow: auto; width: 600px; height: 200px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;&lt;br /&gt;&amp;lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:char="http://charith.wickramarachchi.org"&amp;gt;&lt;br /&gt;&amp;lt;soapenv:Header/&amp;gt;&lt;br /&gt;&amp;lt;soapenv:Body&amp;gt;&lt;br /&gt;   &amp;lt;char:consult&amp;gt;&lt;br /&gt;      &amp;lt;!--Optional:--&amp;gt;&lt;br /&gt;      &amp;lt;char:name&amp;gt;Charith&amp;lt;/char:name&amp;gt;&lt;br /&gt;      &amp;lt;!--Optional:--&amp;gt;&lt;br /&gt;      &amp;lt;char:age&amp;gt;25&amp;lt;/char:age&amp;gt;&lt;br /&gt;   &amp;lt;/char:consult&amp;gt;&lt;br /&gt;&amp;lt;/soapenv:Body&amp;gt;&lt;br /&gt;&amp;lt;/soapenv:Envelope&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;and i received the response&lt;br /&gt;&lt;br /&gt;&lt;pre style="padding: 1px; overflow: auto; width: 600px; height: 100px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;&lt;br /&gt;&amp;lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&amp;gt;&lt;br /&gt;&amp;lt;soapenv:Body&amp;gt;&lt;br /&gt;   &amp;lt;ns:consultResponse xmlns:ns="http://charith.wickramarachchi.org"&amp;gt;&lt;br /&gt;      &amp;lt;ns:return&amp;gt;Hello Charith Since your age is 25 Now its a good time to have some fun&amp;lt;/ns:return&amp;gt;&lt;br /&gt;   &amp;lt;/ns:consultResponse&amp;gt;&lt;br /&gt;&amp;lt;/soapenv:Body&amp;gt;&lt;br /&gt;&amp;lt;/soapenv:Envelope&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I have uploaded all the source codes , configurations , xslt file , and web service archives to [3] so that you can try out your self.&lt;br /&gt;&lt;br /&gt;[1]&lt;a href="http://en.wikipedia.org/wiki/Enterprise_service_bus#Salient_characteristics"&gt;http://en.wikipedia.org/wiki/Enterprise_service_bus#Salient_characteristics&lt;/a&gt;&lt;br /&gt;[2]&lt;a href="http://axis.apache.org/axis2/java/core/docs/pojoguide.html"&gt;http://axis.apache.org/axis2/java/core/docs/pojoguide.html&lt;/a&gt;&lt;br /&gt;[3]&lt;a href="http://rapidshare.com/files/448188843/esb-service-chaining.zip"&gt;http://rapidshare.com/files/448188843/esb-service-chaining.zip&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5788585182362034570-7977314746808561881?l=charithwiki.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://charithwiki.blogspot.com/feeds/7977314746808561881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5788585182362034570&amp;postID=7977314746808561881' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/7977314746808561881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/7977314746808561881'/><link rel='alternate' type='text/html' href='http://charithwiki.blogspot.com/2011/02/web-service-orchestration-with-esb.html' title='Web Service Orchestration with an ESB'/><author><name>CharithWiki</name><uri>http://www.blogger.com/profile/11621891184662231243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SbpO7BJKblI/AAAAAAAAADo/inO_nIjM-Pg/S220/me2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-S_7RPWeg3cc/TVtkBdqZgsI/AAAAAAAAAK0/AFELm9c7A3U/s72-c/ServiceChain.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5788585182362034570.post-3356081190666946461</id><published>2010-12-26T21:46:00.000-08:00</published><updated>2010-12-26T21:55:16.909-08:00</updated><title type='text'>Play with your byte-code using Javassist</title><content type='html'>&lt;div&gt;I came to know about this nice tool named javassist which is a cool java byte code manipulation tool.It provides users with a very easy to use API to modify / create java classes in the Runtime. It provides some API  to do that using a Java like syntax so that we can easily hack the byte code without knowing any thing in-depth about the byte code structure.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In this blog post I'll explain you a simple example on how to use this tool.This will show how we can use javassist to change the byte code of a compiled class to change a method implementation in Runtime.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Step 1&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Download javassist library from &lt;a href="http://sourceforge.net/projects/jboss/files/Javassist/3.14.0.GA/"&gt;http://sourceforge.net/projects/jboss/files/Javassist/3.14.0.GA/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Step 2&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Create a new directory and copy javassist.jar to that directory.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Step 3&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Create Two java source file named HelloWorld.java and ByteCodeInjector.java in that directry&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;HelloWorld.java&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre style="padding: 1px; overflow: auto; width: 600px; height: 300px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;&lt;br /&gt;public class HelloWorld {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   public static void main(String[] args) {&lt;br /&gt;       new HelloWorld().sayHello();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public void sayHello(){&lt;br /&gt;       System.out.println("Hello!!! This is the original version!!!");&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;ByteCodeInjector.java&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;pre style="padding: 1px; overflow: auto; width: 600px; height: 800px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;&lt;br /&gt;import javassist.CannotCompileException;&lt;br /&gt;import javassist.CtClass;&lt;br /&gt;import javassist.CtMethod;&lt;br /&gt;import javassist.NotFoundException;&lt;br /&gt;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;&lt;br /&gt;import static javassist.ClassPool.getDefault;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public class ByteCodeInjector {&lt;br /&gt;&lt;br /&gt;   public static final String CLASS_NAME = "HelloWorld";&lt;br /&gt;   public static final String METHOD = "sayHello";&lt;br /&gt;&lt;br /&gt;   public static void main(String[] argos) throws Exception{&lt;br /&gt;       modifyByteCode(CLASS_NAME,METHOD);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public static void modifyByteCode(String className ,String methodName)&lt;br /&gt;           throws NotFoundException, CannotCompileException, IOException {&lt;br /&gt;       //Get the Class implementation byte code&lt;br /&gt;       CtClass ctClass = getDefault().get(className);&lt;br /&gt;&lt;br /&gt;       //Get the method from the Class byte code&lt;br /&gt;       CtMethod method= ctClass.getDeclaredMethod(methodName);&lt;br /&gt;&lt;br /&gt;       /**&lt;br /&gt;        * Creating the new Method implementation&lt;br /&gt;        */&lt;br /&gt;       StringBuffer content = new StringBuffer();&lt;br /&gt;       content.append("{\n System.out.println(\"Hello!!! This is the Modified version!!!\");\n } ");&lt;br /&gt;&lt;br /&gt;       /**&lt;br /&gt;        * Inserting the content&lt;br /&gt;        */&lt;br /&gt;       method.setBody(content.toString());&lt;br /&gt;       System.out.println("Replacing Method \' sayHello\' s body with new implementation : " + content);&lt;br /&gt;       //modify the actual class File&lt;br /&gt;       ctClass.writeFile();&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Step 4&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Compile the two java sources adding the javassist.jar to your class path&lt;/div&gt;&lt;div&gt;&lt;pre style="padding: 1px; overflow: auto; width: 600px; height: 70px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;$javac -cp javassist.jar:. HelloWorld.java ByteCodeInjector.java &lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Step 5&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Run the HelloWorld class and see the out put&lt;/div&gt;&lt;div&gt;&lt;pre style="padding: 1px; overflow: auto; width: 600px; height: 70px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;$java HelloWorld&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hello!!! This is the original version!!!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Step 6&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now Run the ByteCodeInjector class. That class will change the method implementation of the Helloworld:sayHello()&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;pre style="padding: 1px; overflow: auto; width: 600px; height: 70px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;$java -cp javassist.jar:. ByteCodeInjector&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;Replacing Method ' sayHello' s body with new implementation : {&lt;/div&gt;&lt;div&gt;System.out.println("Hello!!! This is the Modified version!!!");&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now if you run the HelloWorld class you must see a output like&lt;/div&gt;&lt;div&gt;Hello!!! This is the Modified version!!!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Enjoy!!!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;References&lt;/div&gt;&lt;div&gt;[1]http://www.csg.is.titech.ac.jp/~chiba/javassist/tutorial/tutorial.html&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5788585182362034570-3356081190666946461?l=charithwiki.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://charithwiki.blogspot.com/feeds/3356081190666946461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5788585182362034570&amp;postID=3356081190666946461' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/3356081190666946461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/3356081190666946461'/><link rel='alternate' type='text/html' href='http://charithwiki.blogspot.com/2010/12/play-with-your-byte-code-using.html' title='Play with your byte-code using Javassist'/><author><name>CharithWiki</name><uri>http://www.blogger.com/profile/11621891184662231243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SbpO7BJKblI/AAAAAAAAADo/inO_nIjM-Pg/S220/me2.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5788585182362034570.post-2463392753080381510</id><published>2010-11-12T11:01:00.000-08:00</published><updated>2010-11-12T11:24:10.973-08:00</updated><title type='text'>How to write a Axis2 Message Builder</title><content type='html'>&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; font-family: 'Times New Roman'; font-size: medium; "&gt;&lt;a href="http://ws.apache.org/axis2/" id="internal-source-marker_0.3344913183245808"&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 153); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap; "&gt;Apache Axis2 &lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt; is a open source SOAP/ Web services engine which consists of many extension points. Message Builders and Message Formatters are two ways we can extend the axis2 transport framework.In this post i’m going to explain the idea of Message builders and how we can implement a custom message builder and use it. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;As i mentioned above Axis2 is a SOAP engine. So it only accept SOAP messages for processing. So then a problem comes that how we can use axis2 with non-soap invocations like REST. So to convert row non soap content coming from a transport to a SOAP content we can use Message builders. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;This can  really be useful when your in coming message have a non-xml format and you need to invoke a web service or process it with the axis2 engine with the given content information.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;Its simple to Write your own Message builder. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;First what you have to do is write a class implementing  &lt;/span&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;b&gt;org.apache.axis2.builder.Builder&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt; interface in the Axis2 Kernal module.&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; font-family: 'Times New Roman'; font-size: medium; "&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; font-family: 'Times New Roman'; font-size: medium; "&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; font-family: 'Times New Roman'; white-space: normal; font-size: medium; "&gt;&lt;span id="internal-source-marker_0.3344913183245808" style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;The Builder method signature we need to implement look like this.&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; font-family: 'Times New Roman'; white-space: normal; font-size: medium; "&gt;&lt;span id="internal-source-marker_0.3344913183245808" style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; font-family: 'Times New Roman'; white-space: normal; font-size: medium; "&gt;&lt;span id="internal-source-marker_0.3344913183245808" style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;br /&gt;&lt;pre style="padding: 1px; overflow: auto; width: 600px; height: 70px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;&lt;br /&gt;public OMElement processDocument(InputStream inputStream, String contentType,&lt;br /&gt;                              MessageContext messageContext) throws AxisFault&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; font-family: 'Times New Roman'; font-size: medium; "&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; font-family: 'Times New Roman'; white-space: normal; font-size: medium; "&gt;&lt;span id="internal-source-marker_0.3344913183245808" style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;As we see here we have three input parameters &lt;/span&gt;&lt;ol&gt;&lt;li style="list-style-type: decimal; font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; "&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;input stream  : Stream of the raw payload &lt;/span&gt;&lt;/li&gt;&lt;li style="list-style-type: decimal; font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; "&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;content type : content type of the message that Builder is registered with.&lt;/span&gt;&lt;/li&gt;&lt;li style="list-style-type: decimal; font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; "&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;message context : axis2 message context &lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;Here we can use input stream to create the SOAP info set from the coming message and its not a must to consume the input stream inside the builder.And we can use Axis2 message context to set any message context property information we get from the content or to get information from the message context that we need to build the message.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;After we implement the Message builder we need to register it in the axis2 configuration (axis2.xml) with a content type. So messages that comes with that content type will be intercepted by the registered Message builder .&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;Example  configuration in axis2.xml of that will look like this&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; font-family: 'Times New Roman'; white-space: normal; font-size: medium; "&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;pre style="padding: 1px; overflow: auto; width: 650px; height: 80px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;&lt;br /&gt; &amp;lt messageBuilder contentType="application/xml"&lt;br /&gt;                        class="org.apache.axis2.builder.ApplicationXMLBuilder"/&amp;gt&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; font-family: 'Times New Roman'; white-space: normal; font-size: medium; "&gt;&lt;span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;&lt;div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: transparent; font-family: 'Times New Roman'; white-space: normal; font-size: medium; "&gt;&lt;span id="internal-source-marker_0.3344913183245808" style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: normal; font-style: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; "&gt;For a recent project i had to implement a custom Message builder to parse a Email coming in a plan text format and create a SOAP Info set out of it to processing.The Message builder solution become ideal for that problem since i had no control  over the system that send the Mails.&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5788585182362034570-2463392753080381510?l=charithwiki.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://charithwiki.blogspot.com/feeds/2463392753080381510/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5788585182362034570&amp;postID=2463392753080381510' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/2463392753080381510'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/2463392753080381510'/><link rel='alternate' type='text/html' href='http://charithwiki.blogspot.com/2010/11/how-to-write-axis2-message-builder.html' title='How to write a Axis2 Message Builder'/><author><name>CharithWiki</name><uri>http://www.blogger.com/profile/11621891184662231243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SbpO7BJKblI/AAAAAAAAADo/inO_nIjM-Pg/S220/me2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5788585182362034570.post-2524887329033551529</id><published>2010-04-17T23:45:00.001-07:00</published><updated>2010-04-17T23:58:14.685-07:00</updated><title type='text'>Dead Letter Channel Enterprise Application Integration Pattern</title><content type='html'>&lt;span style="font-size:100%;"&gt;Dead Letter Channel Pattern belongs to the Category of Message Channel patterns which describes the Message transport level attributes.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://msdn.microsoft.com/en-us/library/Aa480027.aj2mpsoarch10%28l=en-us,v=MSDN.10%29.gif"&gt;&lt;img style="cursor: pointer; width: 680px; height: 238px;" src="http://msdn.microsoft.com/en-us/library/Aa480027.aj2mpsoarch10%28l=en-us,v=MSDN.10%29.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;    &lt;br /&gt; &lt;style type="text/css"&gt;   &lt;/style&gt;  &lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;&lt;span style="font-size:100%;"&gt;Idea of having a dead letter channel is to handle Message failures. Message failures can be occurred due to several reasons.&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;&lt;br /&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: normal;"&gt;Transport  level failures&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: normal;"&gt;Due  to bad Configuration &lt;/span&gt;&lt;/span&gt;  &lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: normal;"&gt;Message  Expiration &lt;/span&gt;&lt;/span&gt;  &lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: normal;"&gt;Problem  with Message Consumer end&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;/li&gt;&lt;/ul&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: normal;"&gt;In a failure Message will be routed to the dead letter channel. So that it can act as a Message archive mechanism , Re router or a special channel to process the bad messages. &lt;/span&gt;&lt;/span&gt; &lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: normal;"&gt;Having a Message archive system will be useful since later a Dead message can be viewed and re-delivered to the intended end point manually by a admin console.This will be useful to identify the Configuration problems&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: normal;"&gt;Message Re-delivery is also a major part of a dead letter channel implementation. If we take a  normal scenario like simple DB quarries or web-service calls some times a message will fail  because of the endpoint have a higher load or some other temporary issues with the endpoint . So simply re -delivering the message after a certain time interval will cause message to be delivered successfully.    &lt;/span&gt;&lt;/span&gt; &lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: normal;"&gt;Apache Synapse is a Open source esb and a message Mediation framework that support several Enterprise application integration patterns. For this summer(2010) Google Summer of code program I applied for the proposal of Implementing A Dead Letter Channel for Apache synapse. This is the &lt;a href="http://socghop.appspot.com/gsoc/student_proposal/show/google/gsoc2010/charith/t127030145826"&gt;link&lt;/a&gt; to my proposal .&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5788585182362034570-2524887329033551529?l=charithwiki.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://charithwiki.blogspot.com/feeds/2524887329033551529/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5788585182362034570&amp;postID=2524887329033551529' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/2524887329033551529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/2524887329033551529'/><link rel='alternate' type='text/html' href='http://charithwiki.blogspot.com/2010/04/dead-letter-channel-enterprise.html' title='Dead Letter Channel Enterprise Application Integration Pattern'/><author><name>CharithWiki</name><uri>http://www.blogger.com/profile/11621891184662231243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SbpO7BJKblI/AAAAAAAAADo/inO_nIjM-Pg/S220/me2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5788585182362034570.post-7481389889701806771</id><published>2009-12-22T20:18:00.000-08:00</published><updated>2009-12-22T20:49:00.220-08:00</updated><title type='text'>Invoking WebServices using Axis2 SMS Transport</title><content type='html'>In a previous &lt;a href="http://charithwiki.blogspot.com/2009/06/axis2-sms-transport.html"&gt;blog&lt;/a&gt; I have explained the overview design of the Axis2 SMS Transport. Since Last week Axis2 Transport team announced &lt;a href="http://ws.apache.org/commons/transport/"&gt;Axis2 Transport 1.0 release&lt;/a&gt; in which SMS transport got released. I think its time to give some examples on how to use the SMS transport.&lt;p&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;SMS Transport currently have two SMS implementations  &lt;/p&gt;  &lt;ol&gt;&lt;li&gt;&lt;p style="margin-bottom: 0in;"&gt;SMPP protocol implementation   &lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0in;"&gt;GSM implementation&lt;/p&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p style="margin-bottom: 0in;"&gt;where SMPP protocol implementation allow you to connect the axis2 to a SMSC and get messages form it. And GSM implementation allow you to connect a simple GSM modem to the computer that Axis2 is running and use that to send receive SMS form Axis2( its recommended not to use GSM implementation when your message traffic is higher than 6msgs per min).&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;SMS Transport allow Axis2 users to do following&lt;/p&gt; &lt;ol&gt;&lt;li&gt;&lt;p style="margin-bottom: 0in;"&gt;Invoke  a in only Web Service  operation using a SMS&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0in;"&gt;Invoke a in out Web service  operation and receive a reply&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0in;"&gt;Use Axis2 client and send messages  out as a SMS&lt;/p&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p style="margin-bottom: 0in;"&gt;In this blog I 'll discuss how to use SMS Transport to invoke a simple a Web Service using a  RPC type SMS  via GSM implementation&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;Environment :&lt;br /&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;OS: Ubuntu 9.04&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;JDK : 1.6.0&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Axis2 Version : 1.5.1   &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Modem : Huawei E220&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;Following are the Steps that need to be taken&lt;/p&gt;  &lt;ol&gt;&lt;li&gt;&lt;p style="margin-bottom: 0in;"&gt;Add Runtime Libs to Axis2 to Start  with SMS Transport&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0in;"&gt;Configure Axis2&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0in;"&gt;Deploy our Simple service&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0in;"&gt;Start Axis2   &lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0in;"&gt;invoke service using a SMS.&lt;/p&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p style="margin-bottom: 0in;"&gt;&lt;b&gt;Adding Runtime libs &lt;/b&gt; &lt;/p&gt;  &lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;add following file to the Axis2-HOME/lib directory&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;pre&gt;&lt;strong&gt;&lt;a href="http://apache.mirrors.redwire.net/ws/commons/transport/1_0_0/axis2-transport-sms-1.0.0.jar"&gt;axis2-transport-sms-1.0.0.jar&lt;/a&gt;&lt;/strong&gt;&lt;/pre&gt;  &lt;/li&gt;&lt;li&gt;&lt;pre&gt;&lt;strong&gt;&lt;a href="http://apache.mirrors.redwire.net/ws/commons/transport/1_0_0/axis2-transport-base-1.0.0.jar"&gt;axis2-transport-base-1.0.0.jar&lt;/a&gt;&lt;/strong&gt;&lt;/pre&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-weight: normal;"&gt;smslib-3.4.1.jar&lt;/span&gt;&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-weight: normal;"&gt;mail-1.4.jar&lt;/span&gt;&lt;/p&gt; &lt;/li&gt;&lt;/ul&gt; &lt;p style="margin-bottom: 0in;"&gt;   &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Now we need to add Java communication API libs needed for the SMS lib&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;go to jre home and goto lib/ext/ directory and add following files&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;p style="margin-bottom: 0in;"&gt;comm.jar&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0in;"&gt;libLinuxSerialParallel.so&lt;/p&gt;  &lt;/li&gt;&lt;li&gt;&lt;p style="margin-bottom: 0in;"&gt;libLinuxSerialParallel_g.so&lt;/p&gt; &lt;/li&gt;&lt;/ul&gt;  &lt;p style="margin-bottom: 0in;"&gt;Now we are Axis2 two is ready to start with Axis2 .&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;&lt;b&gt;Configuring Axis2&lt;/b&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Goto Axis2-HOME/conf folder where you find the axis2.xml file which is the configuration file used for Axis2 configuration.&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;Then add following to the Transport section.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;SMS Transport Receiver configuration&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre style="padding: 4px; overflow: auto; width: 600px; height: 200px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;&lt;br /&gt;&amp;lt;transportreceiver name="sms" class="org.apache.axis2.transport.sms.SMSMessageReciever"&amp;gt;&lt;br /&gt;&amp;lt;parameter name="smsImplClass"&amp;gt;org.apache.axis2.transport.sms.gsm.GSMImplManager&amp;lt;/parameter&amp;gt;&lt;br /&gt;&amp;lt;parameter name="com_port"&amp;gt;/dev/ttyUSB0&amp;lt;/parameter&amp;gt;&lt;br /&gt;&amp;lt;parameter name="gateway_id"&amp;gt;modem.ttyUSB0&amp;lt;/parameter&amp;gt;&lt;br /&gt;&amp;lt;parameter name="baud_rate"&amp;gt;115200&amp;lt;/parameter&amp;gt;&lt;br /&gt;&amp;lt;parameter name="manufacturer"&amp;gt;HUAWEI&amp;lt;/parameter&amp;gt;&lt;br /&gt;&amp;lt;parameter name="model"&amp;gt;E220&amp;lt;/parameter&amp;gt;&lt;br /&gt;&amp;lt;/transportreceiver&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;SMS Transport Sender configuration&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;pre style="padding: 4px; overflow: auto; width: 600px; height: 200px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;&lt;br /&gt;&amp;lt;transportsender name="sms" class="org.apache.axis2.transport.sms.SMSSender"&amp;gt;&lt;br /&gt;&amp;lt;parameter name="smsImplClass"&amp;gt;org.apache.axis2.transport.sms.gsm.GSMImplManager&amp;lt;/parameter&amp;gt;&lt;br /&gt;&amp;lt;parameter name="com_port"&amp;gt;/dev/ttyUSB0&amp;lt;/parameter&amp;gt;&lt;br /&gt;&amp;lt;parameter name="gateway_id"&amp;gt;modem.ttyUSB0&amp;lt;/parameter&amp;gt;&lt;br /&gt;&amp;lt;parameter name="baud_rate"&amp;gt;115200&amp;lt;/parameter&amp;gt;&lt;br /&gt;&amp;lt;parameter name="manufacturer"&amp;gt;HUAWEI&amp;lt;/parameter&amp;gt;&lt;br /&gt;&amp;lt;parameter name="model"&amp;gt;E220&amp;lt;/parameter&amp;gt;&lt;br /&gt;&amp;lt;/transportsender&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Now Axis2 is ready. Now lets write a Simple Axis2 Service&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;b&gt;Deploy Axis2 Service&lt;/b&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Following is the Sample POJO  Axis2 Service Class I wrote to demonstrate this&lt;/p&gt;&lt;br /&gt;&lt;p&gt; &lt;/p&gt;&lt;pre style="padding: 4px; overflow: auto; width: 300px; height: 300px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;&lt;br /&gt;package sample.sms.test;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public class SampleInOutService {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public String sayHello(String name) {&lt;br /&gt;&lt;br /&gt; return "Hello " + name;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Make a service archive of this POJO class and put that in the Axis2-HOME/repository/services directory.&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;&lt;b&gt;Start Axis2&lt;/b&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;Then Start Axis2 by going to Axis2-HOME/bin and executing the shell script axis2server.sh.&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;If every thing goes ok  you will see a log like this at the end&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;[INFO] Version: 3.4.1 &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;[INFO] JRE Version: 1.6.0_06 &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;[INFO] JRE Impl Version: 10.0-b22 &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;[INFO] O/S: Linux / i386 / 2.6.28-14-generic &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;[INFO] GTW: modem.ttyUSB0: Starting gateway, using Generic AT Handler. &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;[INFO] GTW: modem.ttyUSB0: Opening: /dev/ttyUSB0 @115200 &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;[INFO] GTW: modem.ttyUSB0: GSM: Registered to home network. &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;[INFO] GTW: modem.ttyUSB0: MEM: Storage Locations Found: SM &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;[INFO] GTW: modem.ttyUSB0: Gateway started. &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;[Axis2] Started in Port :/dev/ttyUSB0  &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;[INFO] [SimpleAxisServer] Started &lt;/p&gt;&lt;br /&gt;&lt;p style="margin-bottom: 0in;"&gt;Now we are done now we can invoke the sayHello operation by sending a SMS message to the modem&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;following is the SMS  &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;b&gt;SampleInOutService:sayHello:name=charith&lt;/b&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;send that SMS to the modems phone number and you will get a SMS saying Hello charith&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;  &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;You can use SMS Transport Mixing implementations. ex : send messages using SMPP and recive via GSM modem.&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;This Transport will be useful when your going to implement  your EDA (Event driven architecture) since users will be able to generate events and/or get notifications of events via SMSs&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;More details of SMS Transport can be found at &lt;a href="http://ws.apache.org/commons/transport/sms.html"&gt;SMS Transport documentation &lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5788585182362034570-7481389889701806771?l=charithwiki.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://charithwiki.blogspot.com/feeds/7481389889701806771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5788585182362034570&amp;postID=7481389889701806771' title='27 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/7481389889701806771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/7481389889701806771'/><link rel='alternate' type='text/html' href='http://charithwiki.blogspot.com/2009/12/invoking-webservices-using-axis2-sms.html' title='Invoking WebServices using Axis2 SMS Transport'/><author><name>CharithWiki</name><uri>http://www.blogger.com/profile/11621891184662231243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SbpO7BJKblI/AAAAAAAAADo/inO_nIjM-Pg/S220/me2.jpg'/></author><thr:total>27</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5788585182362034570.post-1624912530873616007</id><published>2009-10-18T07:09:00.000-07:00</published><updated>2009-10-18T07:12:47.467-07:00</updated><title type='text'>Semaphores explained -- A Java approch</title><content type='html'>&lt;p style="margin-bottom: 0in;"&gt;Semaphore can be considered as a variable or Data Structure that can be used to archive mutual exclusion in a Parallel Programming environment.&lt;/p&gt;   &lt;p style="margin-bottom: 0in;"&gt;One good real life example to explain this is the tablet mechanism that is used in old railway system. Where when a train enters a Train Station it need to get a tablet from the Station master to proceed to the next station. When the train get the tablet that means there will be no other train in the railway track till it reaches the next station. When The train arrived to the next station it must give back the tablet to the station master so that he can signal the station that train has come from that line is cleared now (line is clear ) &lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;So getting a tablet is like acquiring a lock in the train line so that other trains that are in need of acquiring the line need to wait till the train reaches the next station and release the lock ( give the tablet back).&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;This signal system still in use in Sri Lanken Railway line in some parts where there is only one rail track between two stations.&lt;/p&gt;&lt;br /&gt;&lt;img style="cursor: pointer; width: 400px; height: 226px;" src="http://3.bp.blogspot.com/_CoM8eYzbrf0/SPiBDdMbigI/AAAAAAAAEDY/2VDKy6S9KQE/s400/4371-sri-lanka-train-from-kandy-thru-tea-plantations.jpg" alt="" border="0" /&gt;&lt;br /&gt; &lt;br /&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;Above explained situation is an example for the Binary Semaphore. where it supports two operations up() and down() . A binary semaphore can have only two values 0 and 1 .(NOTE that up() , down() operations are atomic operations )&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;when someone call a up on semaphore if its value is 0 then it increment it to one and return so that execution can proceed. But if its value is 1 then that up call block the process execution till some one make the semaphore value to 0 (wait till a down call);&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;In a down call if semaphore value is 1 it decrement it  can return. If its 0 then the down call will block the process execution till the semaphore value set to one (wait till a up call).&lt;/p&gt;   &lt;p style="margin-bottom: 0in;"&gt;This little idea is extended to an idea called Counting Semaphores    there we can have more than two values for the semaphore. So that process can call multiple up s /down s till it get blocked.Which means more that one thread can pass the through before it blocked.  &lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;Now its time to look in to how this going help to solve a mutual exclusion problem.&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;Following is a famous problem in Concurrent programming text books lets see how we can solve it.&lt;br /&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0in; font-weight: normal; line-height: 100%; text-decoration: none;" align="left"&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-family:Times New Roman,serif;"&gt;&lt;span style="font-size:100%;"&gt;&lt;i&gt;Bill and Ben work in a cafe that specialises in a soup and  sandwich combination.&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in; font-weight: normal; line-height: 100%; text-decoration: none;" align="left"&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-family:Times New Roman,serif;"&gt;&lt;span style="font-size:100%;"&gt;&lt;i&gt;Bill makes two rounds of sandwiches while, at the same time,  Ben makes two bowls of soup. When the sandwiches and soup  are ready Bill and Ben each, they serve a soup and  sandwich combination to a customer. These actions are  repeated throughout the day. &lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in; font-weight: normal; line-height: 100%; text-decoration: none;" align="left"&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-family:Times New Roman,serif;"&gt;&lt;span style="font-size:100%;"&gt;&lt;i&gt;[Note: Bill cannot serve until Ben has made the soup and Ben  cannot serve until Bill has made the sandwiches.]&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0in; font-style: normal; font-weight: normal; line-height: 100%; text-decoration: none;" align="left"&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-family:Times New Roman,serif;"&gt;&lt;span style="font-size:100%;"&gt;So as the Problem explained Before Serving sandwiches and soup Bill and Ben need to sync up.  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;&lt;a style="color: rgb(255, 0, 0);" name="DDE_LINK"&gt;&lt;/a&gt;&lt;span style="color: rgb(51, 255, 51);font-size:100%;" &gt;&lt;b&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Which means there can be no two customers in the shop at any time that has only served one item.(soup/sandwich)&lt;/span&gt; &lt;/b&gt;&lt;/span&gt; &lt;/p&gt;  &lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;&lt;span style="font-size:100%;"&gt;If we model Bill and Ben as two processes that executes parallely it must be like follows&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0in; text-decoration: none;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-family:Times New Roman,serif;"&gt;&lt;span style="font-size:100%;"&gt;&lt;i&gt;&lt;b&gt;process Bill {&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in; line-height: 100%; text-decoration: none;" align="left"&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;  &lt;span style="font-family:Times New Roman,serif;"&gt;&lt;span style="font-size:100%;"&gt;&lt;i&gt;&lt;b&gt;while (true) {&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in; line-height: 100%; text-decoration: none;" align="left"&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;span style="font-family:Times New Roman,serif;"&gt;&lt;span style="font-size:100%;"&gt;&lt;i&gt;&lt;b&gt;// Bill makes sandwiches //&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in; line-height: 100%; text-decoration: none;" align="left"&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;span style="font-family:Times New Roman,serif;"&gt;&lt;span style="font-size:100%;"&gt;&lt;i&gt;&lt;b&gt;SYNCH 1;&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in; line-height: 100%; text-decoration: none;" align="left"&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;span style="font-family:Times New Roman,serif;"&gt;&lt;span style="font-size:100%;"&gt;&lt;i&gt;&lt;b&gt;// Bill delivers //&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in; line-height: 100%; text-decoration: none;" align="left"&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;  &lt;span style="font-family:Times New Roman,serif;"&gt;&lt;span style="font-size:100%;"&gt;&lt;i&gt;&lt;b&gt;}&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in; line-height: 100%; text-decoration: none;" align="left"&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-family:Times New Roman,serif;"&gt;&lt;span style="font-size:100%;"&gt;&lt;i&gt;&lt;b&gt;}&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;     &lt;/p&gt;  &lt;p style="margin-bottom: 0in; font-style: normal; text-decoration: none;"&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-family:Times New Roman,serif;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;process Ben {&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in; font-style: normal; line-height: 100%; text-decoration: none;" align="left"&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;  &lt;span style="font-family:Times New Roman,serif;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;while (true) {&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in; font-style: normal; line-height: 100%; text-decoration: none;" align="left"&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;span style="font-family:Times New Roman,serif;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;// Ben makes soup //&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in; font-style: normal; line-height: 100%; text-decoration: none;" align="left"&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;span style="font-family:Times New Roman,serif;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;SYNCH 2;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in; font-style: normal; line-height: 100%; text-decoration: none;" align="left"&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;span style="font-family:Times New Roman,serif;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;// Ben delivers //&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in; font-style: normal; line-height: 100%; text-decoration: none;" align="left"&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;  &lt;span style="font-family:Times New Roman,serif;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in; font-style: normal; line-height: 100%; text-decoration: none;" align="left"&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-family:Times New Roman,serif;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;}&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in; font-weight: normal;"&gt;&lt;span style="font-size:100%;"&gt;To implement this Processes I'll be using the Java Language. Java has inbuilt semaphore  implementation in &lt;i&gt;&lt;b&gt;java.util.concurrent.Semaphore&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0in; font-style: normal; font-weight: normal;"&gt; &lt;span style="font-size:100%;"&gt;Its a counting Semaphore implementation. For this case since we only need a binery semaphore I'll will use it with permit value 1. which means only 1 thread is permitted to acquire it at a time.&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0in; font-style: normal; font-weight: normal;"&gt; &lt;span style="font-size:100%;"&gt;I'll use the operations acquire and release operations which are smiler to up and down operations .&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0in; font-style: normal; font-weight: normal;"&gt; &lt;span style="font-size:100%;"&gt;First lets look in to the code.&lt;/span&gt;&lt;/p&gt;&lt;pre style="padding: 4px; overflow: auto; width: 395px; height: 400px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;&lt;br /&gt;&lt;br /&gt;import java.util.concurrent.Semaphore;&lt;br /&gt;&lt;br /&gt;public class Cafe {&lt;br /&gt;private  final Semaphore bill = new Semaphore(1);&lt;br /&gt;private  final Semaphore ben = new Semaphore(1);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public static void main(String[] args) throws InterruptedException {&lt;br /&gt;  //Cafe opening&lt;br /&gt;  new Cafe().openCafe();&lt;br /&gt; // Cant keep it open for long time.... :D&lt;br /&gt; Thread.sleep(1000);&lt;br /&gt; System.exit(0);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;private void openCafe () throws InterruptedException {&lt;br /&gt;  // allocating them to the work&lt;br /&gt;  bill.acquire();&lt;br /&gt;  ben.acquire();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  Thread benProcess = new Thread(new Ben());&lt;br /&gt;  Thread billProcess = new Thread(new Bill());&lt;br /&gt;  //work started&lt;br /&gt;  benProcess.start();&lt;br /&gt;  billProcess.start();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;class Bill implements Runnable {&lt;br /&gt;&lt;br /&gt;  public void run() {&lt;br /&gt;      int i=0;&lt;br /&gt;      while(true) {&lt;br /&gt;          System.out.println("[Bill] finished making 1 sandwitch");&lt;br /&gt;          System.out.println("[Bill] finished making 2 sandwitchs");&lt;br /&gt;&lt;br /&gt;          try {&lt;br /&gt;&lt;br /&gt;              //bill says i m done&lt;br /&gt;              bill.release();&lt;br /&gt;              // bill wait till ben done&lt;br /&gt;              ben.acquire();&lt;br /&gt;          } catch (InterruptedException e) {&lt;br /&gt;              System.out.println("Process interrupted....");&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;          System.out.println("[Bill Serves...Sandwitch to customer "+ ++i+" ]");&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class Ben implements Runnable {&lt;br /&gt;&lt;br /&gt;  public void run() {&lt;br /&gt;      int i=0;&lt;br /&gt;      while(true) {&lt;br /&gt;          System.out.println("[Ben] finished making 1 Soup");&lt;br /&gt;          System.out.println("[Ben] finished making 2 Soup");&lt;br /&gt;&lt;br /&gt;          try {&lt;br /&gt;&lt;br /&gt;              // ben says i m done&lt;br /&gt;              ben.release();&lt;br /&gt;              // ben waits till bill done&lt;br /&gt;              bill.acquire();&lt;br /&gt;          } catch (InterruptedException e) {&lt;br /&gt;              System.out.println("Process interrupted....");&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;          System.out.println("[Ben Serves... Soup to Customer "+ ++i+"]");&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;       So if we looked in to the code Bill and Ben are implemented as two runnable s . At the start We create a Cafe allocate Ben and Bob work and tell them to start work.  &lt;/p&gt;  &lt;p style="margin-bottom: 0in; font-style: normal; font-weight: normal;"&gt; &lt;span style="font-size:100%;"&gt;If we look in to Bill Process what it does is it creates two Sandwiches and tell that  I, m done by releasing bill semaphore and waits till Ben finished by trying to acquire  the ben semaphore.&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in; font-style: normal; font-weight: normal;"&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in; font-style: normal; font-weight: normal;"&gt; &lt;span style="font-size:100%;"&gt;And Ben does other way  around.&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0in; font-style: normal; font-weight: normal;"&gt; &lt;span style="font-size:100%;"&gt;So it guarantees  that Ben cant serve till Bill finish and Bill cant till Ben finishes.&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0in; font-style: normal; font-weight: normal;"&gt; &lt;span style="font-size:100%;"&gt;So at the end when the processors executing parallely the condition of   &lt;b&gt;there can be no two customers in the shop at any time that has only served one item.(soup/sandwich) &lt;/b&gt;is satisfied.&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0in; font-style: normal; font-weight: normal;"&gt; &lt;span style="font-size:100%;"&gt;Following is sample console out put I got &lt;/span&gt; &lt;/p&gt; &lt;span style="font-style: italic;font-size:85%;" &gt;[Ben] finished making 1 Soup&lt;br /&gt;[Ben] finished making 2 Soup&lt;br /&gt;[Bill] finished making 1 sandwitch&lt;br /&gt;[Bill] finished making 2 sandwitchs&lt;br /&gt;[Ben Serves... Soup to Customer 1]&lt;br /&gt;[Ben] finished making 1 Soup&lt;br /&gt;[Ben] finished making 2 Soup&lt;br /&gt;[Bill Serves...Sandwitch to customer 1 ]&lt;br /&gt;[Bill] finished making 1 sandwitch&lt;br /&gt;[Bill] finished making 2 sandwitchs&lt;br /&gt;[Ben Serves... Soup to Customer 2]&lt;br /&gt;[Ben] finished making 1 Soup&lt;br /&gt;[Ben] finished making 2 Soup&lt;br /&gt;[Bill Serves...Sandwitch to customer 2 ]&lt;br /&gt;[Bill] finished making 1 sandwitch&lt;br /&gt;[Bill] finished making 2 sandwitchs&lt;br /&gt;[Ben Serves... Soup to Customer 3]&lt;br /&gt;[Ben] finished making 1 Soup&lt;br /&gt;[Ben] finished making 2 Soup&lt;br /&gt;[Bill Serves...Sandwitch to customer 3 ]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;......... goes on&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can see the condition is satisfied.&lt;br /&gt;Hope this helps to improve your understanding on Semaphores...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5788585182362034570-1624912530873616007?l=charithwiki.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://charithwiki.blogspot.com/feeds/1624912530873616007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5788585182362034570&amp;postID=1624912530873616007' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/1624912530873616007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/1624912530873616007'/><link rel='alternate' type='text/html' href='http://charithwiki.blogspot.com/2009/10/semaphores-explained-java-approch.html' title='Semaphores explained -- A Java approch'/><author><name>CharithWiki</name><uri>http://www.blogger.com/profile/11621891184662231243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SbpO7BJKblI/AAAAAAAAADo/inO_nIjM-Pg/S220/me2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_CoM8eYzbrf0/SPiBDdMbigI/AAAAAAAAEDY/2VDKy6S9KQE/s72-c/4371-sri-lanka-train-from-kandy-thru-tea-plantations.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5788585182362034570.post-3629368982043231367</id><published>2009-08-19T19:01:00.000-07:00</published><updated>2009-08-19T19:47:06.376-07:00</updated><title type='text'>Executing maven test with the ant run plugin--A Real experiance.</title><content type='html'>Few days back i got a unexpected result with using the maven ant run task with a patch i submitted for the unit tests for the SMS Transport(which is my GSoC project).So i thought it would be useful if i blog my experiance and how i solved that issue.&lt;br /&gt;&lt;br /&gt;So i'll start with my   xml segment in the pom.&lt;br /&gt;&lt;pre style="padding: 4px; overflow: auto; width: 395px; height: 400px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;&lt;br /&gt;&amp;lt;plugin&amp;gt;&lt;br /&gt;      &amp;lt;groupid&amp;gt;org.apache.maven.plugins&amp;lt;/groupid&amp;gt;&lt;br /&gt;      &amp;lt;artifactid&amp;gt;maven-antrun-plugin&amp;lt;/artifactid&amp;gt;&lt;br /&gt;      &amp;lt;executions&amp;gt;&lt;br /&gt;          &amp;lt;execution&amp;gt;&lt;br /&gt;              &amp;lt;id&amp;gt;build-repo&amp;lt;/id&amp;gt;&lt;br /&gt;              &amp;lt;phase&amp;gt;test-compile&amp;lt;/phase&amp;gt;&lt;br /&gt;              &amp;lt;configuration&amp;gt;&lt;br /&gt;                  &amp;lt;tasks&amp;gt;&lt;br /&gt;                      &amp;lt;mkdir dir="target/test-resources/samples/conf"&amp;gt;&lt;br /&gt;                      &amp;lt;mkdir dir="target/test-resources/samples/repository/modules"&amp;gt;&lt;br /&gt;                      &amp;lt;mkdir dir="target/test-resources/samples/repository/services"&amp;gt;&lt;br /&gt;                      &amp;lt;mkdir dir="target/test-resources/samples/repository/services/SampleService/org/apache/axis2/transport/sms"&amp;gt;&lt;br /&gt;                      &amp;lt;mkdir dir="target/test-resources/samples/repository/services/SampleService/META-INF"&amp;gt;&lt;br /&gt;                      &amp;lt;copy file="${settings.localRepository}/org/apache/axis2/addressing/${axis2.version}/addressing-${axis2.version}.mar" tofile="target/test-resources/samples/repository/modules/addressing.mar"&amp;gt;&lt;br /&gt;                      &amp;lt;copy file="target/test-classes/org/apache/axis2/transport/sms/SimpleInOutMessageReceiver.class" tofile="target/test-resources/samples/repository/services/SampleService/org/apache/axis2/transport/sms/SimpleInOutMessageReceiver.class"&amp;gt;&lt;br /&gt;                      &amp;lt;copy file="conf/axis2.xml" tofile="target/test-resources/samples/conf/axis2.xml"&amp;gt;&lt;br /&gt;                      &amp;lt;copy file="repository/services/SampleService/META-INF/MANIFEST.MF" tofile="target/test-resources/samples/repository/services/SampleService/META-INF/MANIFEST.MF"&amp;gt;&lt;br /&gt;                      &amp;lt;copy file="repository/services/SampleService/META-INF/services.xml" tofile="target/test-resources/samples/repository/services/SampleService/META-INF/services.xml"&amp;gt;&lt;br /&gt;                  &amp;lt;/copy&amp;gt;&lt;br /&gt;              &amp;lt;/copy&amp;gt;&lt;br /&gt;              &amp;lt;goals&amp;gt;&lt;br /&gt;                  &amp;lt;goal&amp;gt;run&amp;lt;/goal&amp;gt;&lt;br /&gt;              &amp;lt;/goals&amp;gt;&lt;br /&gt;          &amp;lt;/copy&amp;gt;&lt;br /&gt;      &amp;lt;/copy&amp;gt;&lt;br /&gt;  &amp;lt;/copy&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/mkdir&amp;gt;&amp;lt;/mkdir&amp;gt;&amp;lt;/mkdir&amp;gt;&amp;lt;/mkdir&amp;gt;&amp;lt;/mkdir&amp;gt;&amp;lt;/tasks&amp;gt;&amp;lt;/configuration&amp;gt;&amp;lt;/execution&amp;gt;&amp;lt;/executions&amp;gt;&amp;lt;/plugin&amp;gt;&lt;br /&gt;&lt;/pre&gt;As you see there is only some mkdir and copy tasks listed in the test-compile phase&lt;br /&gt;&lt;br /&gt;So When I run the tests test where executed successfully(mvn clean install / mvn test)&lt;br /&gt;And also when i skip the tests with&lt;span style="font-weight: bold;"&gt; mvn clean install -Dtest=false&lt;/span&gt;  the build was successful.&lt;br /&gt;&lt;br /&gt;The problem comes when i try to skip the test with mvn clean install &lt;span style="font-weight: bold;"&gt;-Dmaven.test.skip=true&lt;/span&gt;&lt;br /&gt;when i do that follwing error appiers&lt;br /&gt;&lt;br /&gt;[ERROR] BUILD ERROR&lt;br /&gt;[INFO] ------------------------------&lt;div class="im"&gt;&lt;wbr&gt;------------------------------&lt;wbr&gt;------------&lt;br /&gt;[INFO] An Ant BuildException has occured: Warning: Could not find file /home/charith/projects/&lt;wbr&gt;transport/modules/sms/target/&lt;wbr&gt;test-classes/org/apache/axis2/&lt;wbr&gt;transport/sms/&lt;wbr&gt;SimpleInOutMessageReceiver.&lt;wbr&gt;class to copy.&lt;br /&gt;&lt;br /&gt;So If you look in to the ant run plugin the copy tasks are listed in the "&lt;span style="font-weight: bold;"&gt;test-compile&lt;/span&gt;" phase so its seems correct to assume that those tasks will not execute when we skip the tests.And it seems that assumption is correct when we use the&lt;span style="font-weight: bold;"&gt; -Dtest=false&lt;/span&gt;.But that assumption fails with we run with &lt;span style="font-weight: bold;"&gt;-Dmaven.test.skip=true&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The reason for this error is the .class file that the copy task trying to copy created after compiling the test sources.but when we use -Dmaven.test.skip=true to skip the tests it will execute the tesks that are listed in the &lt;span style="font-weight: bold;"&gt;test-compile phase &lt;/span&gt;.So it reports the Error.&lt;br /&gt;&lt;br /&gt;to overcome that case i had to add the system variable check to the task.Now it will check for the &lt;span style="font-weight: bold;"&gt;maven.test.skip&lt;/span&gt; variable before executing the test.So if it is true it will not execute the tasks in the test-compile phase.Following this the modified pom which resolved the issue.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="padding: 4px; overflow: auto; width: 395px; height: 400px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;plugin&amp;gt;&lt;br /&gt;        &amp;lt;groupid&amp;gt;org.apache.maven.plugins&amp;lt;/groupid&amp;gt;&lt;br /&gt;        &amp;lt;artifactid&amp;gt;maven-antrun-plugin&amp;lt;/artifactid&amp;gt;&lt;br /&gt;        &amp;lt;executions&amp;gt;&lt;br /&gt;            &amp;lt;execution&amp;gt;&lt;br /&gt;                &amp;lt;id&amp;gt;build-repo&amp;lt;/id&amp;gt;&lt;br /&gt;                &amp;lt;phase&amp;gt;test-compile&amp;lt;/phase&amp;gt;&lt;br /&gt;                &amp;lt;configuration&amp;gt;&lt;br /&gt;                    &amp;lt;tasks unless="maven.test.skip"&amp;gt;&lt;br /&gt;                        &amp;lt;mkdir dir="target/test-resources/samples/conf"&amp;gt;&lt;br /&gt;                        &amp;lt;mkdir dir="target/test-resources/samples/repository/modules"&amp;gt;&lt;br /&gt;                        &amp;lt;mkdir dir="target/test-resources/samples/repository/services"&amp;gt;&lt;br /&gt;                        &amp;lt;mkdir dir="target/test-resources/samples/repository/services/SampleService/org/apache/axis2/transport/sms"&amp;gt;&lt;br /&gt;                        &amp;lt;mkdir dir="target/test-resources/samples/repository/services/SampleService/META-INF"&amp;gt;&lt;br /&gt;                        &amp;lt;copy file="${settings.localRepository}/org/apache/axis2/addressing/${axis2.version}/addressing-${axis2.version}.mar" tofile="target/test-resources/samples/repository/modules/addressing.mar"&amp;gt;&lt;br /&gt;                        &amp;lt;copy file="target/test-classes/org/apache/axis2/transport/sms/SimpleInOutMessageReceiver.class" tofile="target/test-resources/samples/repository/services/SampleService/org/apache/axis2/transport/sms/SimpleInOutMessageReceiver.class"&amp;gt;&lt;br /&gt;                        &amp;lt;copy file="conf/axis2.xml" tofile="target/test-resources/samples/conf/axis2.xml"&amp;gt;&lt;br /&gt;                        &amp;lt;copy file="repository/services/SampleService/META-INF/MANIFEST.MF" tofile="target/test-resources/samples/repository/services/SampleService/META-INF/MANIFEST.MF"&amp;gt;&lt;br /&gt;                        &amp;lt;copy file="repository/services/SampleService/META-INF/services.xml" tofile="target/test-resources/samples/repository/services/SampleService/META-INF/services.xml"&amp;gt;&lt;br /&gt;                    &amp;lt;/copy&amp;gt;&lt;br /&gt;                &amp;lt;/copy&amp;gt;&lt;br /&gt;                &amp;lt;goals&amp;gt;&lt;br /&gt;                    &amp;lt;goal&amp;gt;run&amp;lt;/goal&amp;gt;&lt;br /&gt;                &amp;lt;/goals&amp;gt;&lt;br /&gt;            &amp;lt;/copy&amp;gt;&lt;br /&gt;        &amp;lt;/copy&amp;gt;&lt;br /&gt;    &amp;lt;/copy&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/mkdir&amp;gt;&amp;lt;/mkdir&amp;gt;&amp;lt;/mkdir&amp;gt;&amp;lt;/mkdir&amp;gt;&amp;lt;/mkdir&amp;gt;&amp;lt;/tasks&amp;gt;&amp;lt;/configuration&amp;gt;&amp;lt;/execution&amp;gt;&amp;lt;/executions&amp;gt;&amp;lt;/plugin&amp;gt;&lt;br /&gt;&lt;/pre&gt;As you see the only change is tasks unless="maven.test.skip" in the task element which check !(maven.test.skip)&lt;br /&gt;&lt;br /&gt;the follwing xml segment is logically equal to&lt;br /&gt;&lt;br /&gt;if(!(maven.test.skip)) {&lt;br /&gt;//execute task&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;pre style="padding: 4px; overflow: auto; width: 395px; height: 40px; background-color: rgb(160, 255, 255); color: rgb(0, 0, 0); font-family: arial; font-size: 12px; text-align: left;"&gt;&lt;br /&gt;&amp;lt;tasks unless="maven.test.skip"&amp;gt;&lt;br /&gt;&lt;/pre&gt;After this system variable check I was successful with running the tests with -Dtest=false , -Dmaven.test.skip=true.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5788585182362034570-3629368982043231367?l=charithwiki.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://charithwiki.blogspot.com/feeds/3629368982043231367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5788585182362034570&amp;postID=3629368982043231367' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/3629368982043231367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/3629368982043231367'/><link rel='alternate' type='text/html' href='http://charithwiki.blogspot.com/2009/08/executing-maven-test-with-ant-run.html' title='Executing maven test with the ant run plugin--A Real experiance.'/><author><name>CharithWiki</name><uri>http://www.blogger.com/profile/11621891184662231243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SbpO7BJKblI/AAAAAAAAADo/inO_nIjM-Pg/S220/me2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5788585182362034570.post-3554706989153347974</id><published>2009-08-17T07:14:00.000-07:00</published><updated>2009-08-17T07:24:17.127-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='music'/><title type='text'>Chandi jaisa rang hai tera- My favorite Gazal</title><content type='html'>Gazal is a beautiful Hindustan music style which have lot of great songs.the most important thing about gazal style is most of the songs can be enjoyed even without having a classical music background.Most of the gazals are written about romance.It carries "Srungara Rasa" with it.&lt;br /&gt;&lt;br /&gt;The Gazal song Chandi jaisa rang hai thera is a gazal that admire the beauty the girl that he loves.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span&gt;&lt;span style="font-family:verdana;"&gt;Chandi jaisa rang hai tera, sone jaise baal&lt;br /&gt;Ek tuhi dhanvaan hai gori, baaki sub kangaal&lt;br /&gt;Chandi jaisa rang hai tera, sone jaise baal&lt;br /&gt;Ek tuhi dhanvaan hai gori, baaki sub kangaal&lt;br /&gt;Ek tuhi dhanvaan hai gori, baaki sub kangaal&lt;br /&gt;&lt;br /&gt;Jis reste se tu gujre, voh phoolon se bhar jaye&lt;br /&gt;Jis reste se tu gujre, voh phoolon se bhar jaye&lt;br /&gt;Tere pair ki komal aahat sote bhaag jagaye&lt;br /&gt;Jo patthar choo le gori tu voh heera ban jaye&lt;br /&gt;Tu jisko mil jaye voh, tu jisko mil jaye&lt;br /&gt;Vo ho jaye malamal&lt;br /&gt;Ek tuhi dhanvaan hai gori, baaki sub kangaal&lt;br /&gt;Chandi jaisa rang hai tera, sone jaise baal&lt;br /&gt;Ek tuhi dhanvaan hai gori, baaki sub kangaal&lt;br /&gt;&lt;br /&gt;Jo be-rang ho us par kya kya rang jamate log&lt;br /&gt;Jo be-rang ho us par kya kya rang jamate log&lt;br /&gt;Tu naadaan na jane kaise roop churate log&lt;br /&gt;Nazaren bhar bhar dekhen tujhko aate jaate log&lt;br /&gt;Chail chabeeli rani thoda, Chail chabeeli rani thoda&lt;br /&gt;ghoonghat aur nikaal&lt;br /&gt;Ek tuhi dhanvaan hai gori, baaki sub kangaal&lt;br /&gt;Chandi jaisa rang hai tera, sone jaise baal&lt;br /&gt;Ek tuhi dhanvaan hai gori, baaki sub kangaal&lt;br /&gt;&lt;br /&gt;Dhanak ghata kaliyan aur tare sub hain tere roop&lt;br /&gt;Dhanak ghata kaliyan aur tare sub hain tera roop&lt;br /&gt;Ghazalen hon ya geet hon mere sub mein tera roop&lt;br /&gt;Yunhi chamakti rahe hamesha tere husn ki dhoop&lt;br /&gt;Tujhe nazar na lage kisi ki&lt;br /&gt;Tujhe nazar na lage kisi ki&lt;br /&gt;Jiye hazaron saal&lt;br /&gt;Ek tuhi dhanvaan hai gori, baaki sub kangaal&lt;br /&gt;Chandi jaisa rang hai tera, sone jaise baal&lt;br /&gt;Ek tuhi dhanvaan hai gori, baaki sub kangaal&lt;br /&gt;Chandi jaisa rang hai tera, sone jaise baal&lt;br /&gt;Ek tuhi dhanvaan hai gori, baaki sub kangaal&lt;br /&gt;Ek tuhi dhanvaan hai gori, baaki sub kangaal&lt;br /&gt;Ek tuhi dhanvaan hai gori, baaki sub kangaal&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/lTOwwpxsGNo&amp;amp;hl=en&amp;amp;fs=1&amp;amp;"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/lTOwwpxsGNo&amp;amp;hl=en&amp;amp;fs=1&amp;amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5788585182362034570-3554706989153347974?l=charithwiki.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://charithwiki.blogspot.com/feeds/3554706989153347974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5788585182362034570&amp;postID=3554706989153347974' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/3554706989153347974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/3554706989153347974'/><link rel='alternate' type='text/html' href='http://charithwiki.blogspot.com/2009/08/chandi-jaisa-rang-hai-tera-my-favorite.html' title='Chandi jaisa rang hai tera- My favorite Gazal'/><author><name>CharithWiki</name><uri>http://www.blogger.com/profile/11621891184662231243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SbpO7BJKblI/AAAAAAAAADo/inO_nIjM-Pg/S220/me2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5788585182362034570.post-5082077621883314512</id><published>2009-06-22T18:33:00.000-07:00</published><updated>2009-06-22T19:13:23.812-07:00</updated><title type='text'>Axis2 SMS Transport</title><content type='html'>Apache Axis2 is an opensource  framework for webservices which is widely used today ,and its implementation is available in both java and c. Axis2 is independent of the underlying transports which takes the Messages to it.Axis2 Engine is concentrating on the SOAP processing. Users can select transports to suite their requirement and that transports are responsible for injecting Axis2Messages to the Axis2Engine.So Axis2 Engine is dealing only with this Axis2MessageContex build from the underlying transport framework.&lt;br /&gt;&lt;br /&gt;I' m writing SMS Transport as my Google Summer of Code 2009 project  for Apache Axis2 which is a project focusing on implementing a SMPP support for Axis2java (And also it will able be used in Apache Synapse too Since Synapse uses the same axis2Transports ) by which Axis2 will be able to communicate with SMSCs (Short message service centers) or Any other Message centers that support SMPP . And also in this project it will make enable axis2 to communicate with Simple GSM modems.&lt;br /&gt;&lt;br /&gt;At the beginning of the Project I considered the Word "SMS" as a generic one where there can be many implementations.Currently it support the SMPP protocol to send receive SMS via Message Centers.The SMS transport is designed and implimented in a such a way that it can be easyly extended to use any other implimentations or to use any SMS message formats.&lt;br /&gt;&lt;br /&gt;SMPP - Short Message Peer to Peer protocal is an open, industry standard protocol&lt;br /&gt;designed to provide a flexible data communications interface for transfer of short message data between a Message Center, such as a Short Message Service Centre (SMSC), GSM&lt;br /&gt;Unstructured Supplementary Services Data (USSD) Server or other type of Message Center&lt;br /&gt;and a SMS application system, such as a WAP Proxy Server, EMail Gateway or other&lt;br /&gt;Messaging Gateway.The advantage of supporting SMPP protocol with the Axis2 SMS Transport is it can be use to send receive high volume of Short messages very fast.SMPP protocal is a Application layer protocal which can be used over TCP. There are many SMPP gateways avalilable in the world.and now almost all the Message centers support SMPP.Click is a good example of a SMPP sms gateway.&lt;br /&gt;&lt;a href="https://www.clickatell.com/"&gt;https://www.clickatell.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;SMS Transport will also support send receive SMSs using a Simple GSM modems attached to the Computer.This sms implementation can be used when the data Traffic is very  low.A Typical GSM modem can only handdle about 6 messages per minute.If a user need to have a heiger data Traffic with the Axis2 the SMPP implimentation can be used.&lt;br /&gt;&lt;br /&gt;following is an diagram of the overview of SMS Transport&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_TAP3Nzxz-vQ/SkA2CCT6wUI/AAAAAAAAAGU/Qw909hCDook/s1600-h/Design.png"&gt;&lt;img style="cursor: pointer; width: 320px; height: 246px;" src="http://1.bp.blogspot.com/_TAP3Nzxz-vQ/SkA2CCT6wUI/AAAAAAAAAGU/Qw909hCDook/s320/Design.png" alt="" id="BLOGGER_PHOTO_ID_5350335765924200770" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Extending SMS Transport&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SMS Transport was design to be a extensible one.where it provides proper interface to extend and reuse the current implementations.&lt;br /&gt;&lt;br /&gt;If we focus on Axis2 SMS Transport the Axis2 dependent Transport senders , Transport listeners , Message Builders , Message Formatters are put in the generic SMS layer. That layer will be depending on the underlying implementation layer which only focus on the current SMS implementation which will have nothing to do with Axis2. So the advantage is that the Developers who need to write another implementation need not to worry about the Axis2.They just need to rely on the provided API and focus on their Implementation logic.&lt;br /&gt;&lt;br /&gt;Other Extensible point of the SMS Transport is the Extending MessageFormatters and Message Builders.Users can write there own Message Builders and formatter to send receive any message formats they like by implementing the interfaces coming with the SMS Transport.&lt;br /&gt;&lt;br /&gt;This blog is only a overview of the Axis2 SMS Transport and there will be documentation coming explaining  the configuration , and extensibility of this Transport.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5788585182362034570-5082077621883314512?l=charithwiki.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://charithwiki.blogspot.com/feeds/5082077621883314512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5788585182362034570&amp;postID=5082077621883314512' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/5082077621883314512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/5082077621883314512'/><link rel='alternate' type='text/html' href='http://charithwiki.blogspot.com/2009/06/axis2-sms-transport.html' title='Axis2 SMS Transport'/><author><name>CharithWiki</name><uri>http://www.blogger.com/profile/11621891184662231243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SbpO7BJKblI/AAAAAAAAADo/inO_nIjM-Pg/S220/me2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_TAP3Nzxz-vQ/SkA2CCT6wUI/AAAAAAAAAGU/Qw909hCDook/s72-c/Design.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5788585182362034570.post-3810375367094380177</id><published>2009-04-25T10:37:00.000-07:00</published><updated>2009-04-25T12:14:42.597-07:00</updated><title type='text'>Spot Light  to Service Component Architecture</title><content type='html'>If we take a Normal Software application it will be consist of Many components.Where they may be developed using a same technology or different technologies.And also they may be deployed in a Same runtime ,machine or different ones and communicating with each other using a same technology or different technologies.&lt;br /&gt;&lt;br /&gt;SCA (Service component Architecture) defines how these components are created and how they are assembled together to build composites.It is a programing model build based on the SOA.&lt;br /&gt;&lt;br /&gt;According to the SCA specification SCA applications can be implemented using many technologies like Java ,Spring ,C++ etc ... SCA defines how these components built using any technology can be Assembled to built a application.&lt;br /&gt;&lt;br /&gt;A Simple example of a Component assembled to build a Application would be a Simple Java Application with few classes communicating with each other in a Single JVM.Or in a More Complex case it will be set of Web Services working together to build up a Custom Service .&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SCA Component &lt;/span&gt; is the atomic unit in a SCA application where they can be combine together in a preferable way&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.theenterprisearchitect.eu/images/component.gif"&gt;&lt;img style="cursor: pointer; width: 250px; height: 318px;" src="http://www.theenterprisearchitect.eu/images/component.gif" alt="" border="0" /&gt;&lt;/a&gt;As the Diagram shows a Component can expose services that other components (or may be the out side applications )will be able to use.And also a Component may be relying on the Services provided by other components(or by out side systems).And also a Components can have properties that will be able to initialized at the component creation.In SCA a component can be properly configured by mentiong above mentioned properties ,services etc using SCDL (service component definition language)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Composite&lt;/span&gt;s are Logical constructs that will consist of one or many components.but interestingly these components in side a Composite may be distributed in many runtimes. So it is impotent to understand that composite only define a logical construct using deferent components.It will have a logical meaning in the context of work done within the composite.But the components that the composite is build from may use different technologies.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://blogs.iona.com/ohurley/SCA_Composite.gif"&gt;&lt;img style="cursor: pointer; width: 500px; height: 200px;" src="http://blogs.iona.com/ohurley/SCA_Composite.gif" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;As u see The composites can also have Services references , properties.&lt;br /&gt;&lt;br /&gt;Following is a example of  how a composite is configured using SCDL&lt;br /&gt;&lt;br /&gt;&lt;div class="code panel" style="border-style: solid; border-width: 1px;"&gt;&lt;div class="codeHeader panelHeader" style="border-bottom-width: 1px; border-bottom-style: solid;"&gt;&lt;b&gt;sample.composite&lt;/b&gt;&lt;/div&gt;&lt;div class="codeContent panelContent"&gt;&lt;br /&gt;&lt;pre class="code-xml"&gt;&lt;span class="code-tag"&gt;&amp;lt;?xml version=&lt;span class="code-quote"&gt;"1.0"&lt;/span&gt; encoding=&lt;span class="code-quote"&gt;"UTF-8"&lt;/span&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;composite xmlns=&lt;span class="code-quote"&gt;"http://www.osoa.org/xmlns/sca/1.0"&lt;/span&gt;&lt;br /&gt;          &lt;span class="code-keyword"&gt;xmlns:burlap&lt;/span&gt;=&lt;span class="code-quote"&gt;"http://www.fabric3.org/binding/burlap/0.2"&lt;/span&gt;&lt;br /&gt;          name=&lt;span class="code-quote"&gt;"BurlapTestComposite"&lt;/span&gt;&amp;gt;&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-tag"&gt;&lt;span class="code-comment"&gt;&amp;lt;!-- Hello Client --&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-tag"&gt;&amp;lt;component name=&lt;span class="code-quote"&gt;"HelloClient"&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;       &lt;span class="code-tag"&gt;&amp;lt;implementation.java class=&lt;span class="code-quote"&gt;"org.fabric3.sample.hello.HelloClientImpl"&lt;/span&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-tag"&gt;&amp;lt;reference name=&lt;span class="code-quote"&gt;"helloService"&lt;/span&gt; target=&lt;span class="code-quote"&gt;"HelloService"&lt;/span&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-tag"&gt;&amp;lt;/component&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   &lt;span class="code-tag"&gt;&lt;span class="code-comment"&gt;&amp;lt;!-- Hello Service --&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-tag"&gt;&amp;lt;component name=&lt;span class="code-quote"&gt;"HelloService"&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;       &lt;span class="code-tag"&gt;&amp;lt;implementation.java class=&lt;span class="code-quote"&gt;"org.fabric3.sample.hello.HelloServiceImpl"&lt;/span&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;   &lt;span class="code-tag"&gt;&amp;lt;/component&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="code-tag"&gt;&amp;lt;/composite&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;These fundamentals of SCA (components and composites) are contained with in a lager construct called SCA domain.Which is normally a  Set of Systems with a common SCA runtime technology and common management(people).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Apache Tuscany ,  HydraSCA , Fabric3 are few examples of these SCA Runtimes.&lt;br /&gt;&lt;br /&gt;SCA can be seen as a programming modal that will be very useful when developing and maintaining complex business applications.Which ensure the reuse by having low coupling and componentizing  . The modal that SCA is trying to bring in is not a new concept to the domain. Even the Spring frame work has same concepts that shears with the SCA.These evelutions happening are showing some bright lights of the Pinnacle we are seeking in the Computer Science.&lt;br /&gt;&lt;br /&gt;references : &lt;a href="http://www.osoa.org/display/Main/Service+Component+Architecture+Home"&gt;http://www.osoa.org/display/Main/Service+Component+Architecture+Home&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5788585182362034570-3810375367094380177?l=charithwiki.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://charithwiki.blogspot.com/feeds/3810375367094380177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5788585182362034570&amp;postID=3810375367094380177' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/3810375367094380177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/3810375367094380177'/><link rel='alternate' type='text/html' href='http://charithwiki.blogspot.com/2009/04/spot-light-to-service-component.html' title='Spot Light  to Service Component Architecture'/><author><name>CharithWiki</name><uri>http://www.blogger.com/profile/11621891184662231243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SbpO7BJKblI/AAAAAAAAADo/inO_nIjM-Pg/S220/me2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5788585182362034570.post-7432918008777068034</id><published>2009-03-29T19:38:00.000-07:00</published><updated>2009-03-29T19:56:53.391-07:00</updated><title type='text'>Configuring Apache Synapse - Spring With IDE support</title><content type='html'>Apache Synapse uses its own XML based DSL for Configuration.At the Synapse Initialising phase Synapse reads the XML file and Build the Synapse Configuration Object Structure.&lt;br /&gt;It takes time to new users to be familiar with the Synapse Configuration language.Some times they may have to look in to the synapse configuration factories to know the all the configuration parameters.&lt;br /&gt;&lt;br /&gt;Spring-DSL for synapse project enable users who are familiar with Spring syntax to configure synapse in Spring (both underlying Axis2 instence and Synapse)&lt;br /&gt;&lt;br /&gt;One of the main advantages here is users being able to configure synapse using IDE support . Following are few Screen shots taken from the comming tutorial on Spring DSL for Synapse&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SdAztKugc8I/AAAAAAAAAEI/ffp7OT7maHY/s1600-h/one.png"&gt;&lt;img style="cursor: pointer; width: 432px; height: 270px;" src="http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SdAztKugc8I/AAAAAAAAAEI/ffp7OT7maHY/s400/one.png" alt="" id="BLOGGER_PHOTO_ID_5318808010991104962" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SdAztxhlBlI/AAAAAAAAAEQ/XbNZuaNxYY4/s1600-h/four.png"&gt;&lt;img style="cursor: pointer; width: 426px; height: 266px;" src="http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SdAztxhlBlI/AAAAAAAAAEQ/XbNZuaNxYY4/s400/four.png" alt="" id="BLOGGER_PHOTO_ID_5318808021405861458" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SdAzt-gxzPI/AAAAAAAAAEY/LKF_pVMHHac/s1600-h/eight.png"&gt;&lt;img style="cursor: pointer; width: 422px; height: 264px;" src="http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SdAzt-gxzPI/AAAAAAAAAEY/LKF_pVMHHac/s400/eight.png" alt="" id="BLOGGER_PHOTO_ID_5318808024892165362" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5788585182362034570-7432918008777068034?l=charithwiki.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://charithwiki.blogspot.com/feeds/7432918008777068034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5788585182362034570&amp;postID=7432918008777068034' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/7432918008777068034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/7432918008777068034'/><link rel='alternate' type='text/html' href='http://charithwiki.blogspot.com/2009/03/configuring-apache-synapse-spring-with.html' title='Configuring Apache Synapse - Spring With IDE support'/><author><name>CharithWiki</name><uri>http://www.blogger.com/profile/11621891184662231243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SbpO7BJKblI/AAAAAAAAADo/inO_nIjM-Pg/S220/me2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SdAztKugc8I/AAAAAAAAAEI/ffp7OT7maHY/s72-c/one.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5788585182362034570.post-1925896807996489913</id><published>2009-03-07T07:11:00.000-08:00</published><updated>2009-03-07T07:54:44.238-08:00</updated><title type='text'>Guardian-Mobile become handy when your mobile got stolen(personal experience)</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_TAP3Nzxz-vQ/SbKPNRFPDlI/AAAAAAAAADg/txDwd2IrbZE/s1600-h/config1.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 168px; height: 224px;" src="http://1.bp.blogspot.com/_TAP3Nzxz-vQ/SbKPNRFPDlI/AAAAAAAAADg/txDwd2IrbZE/s400/config1.jpg" alt="" id="BLOGGER_PHOTO_ID_5310464368709668434" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I lost my mobile yesterday night while i m on the way home in a train.Its about 10:30 pm when that happen.since its late night there were only few people in the train.This happen when the train stopped at the Bulugahagoda(between Gampaha and Ragama).&lt;br /&gt;I was holding the phone because i got a phone call just before that happen.Suddenly one from the back grabbed my phone and run away and jump from the Train.I was fraction of a second late from catching him.&lt;br /&gt;The reason i m blogging now is to explain how the &lt;a href="http://www.guardian-mobile.com"&gt;Guardian-Mobile&lt;/a&gt; which is installed in my mobile helping me and the police to track the guy who is using it.&lt;br /&gt;&lt;br /&gt;&lt;span id="ctl00_body_Label2"&gt;Guardian is an &lt;b&gt;Advanced Antitheft Software&lt;/b&gt; for Mobile devices, it provides unique and powerful features:&lt;br /&gt;    - Sim Changed notification through &lt;b&gt;Invisible&lt;/b&gt; sms&lt;br /&gt;    - &lt;b&gt;Password Protection&lt;/b&gt; of messaging, gallery, contacts or every other      application&lt;br /&gt;    - &lt;b&gt;GPS Localization&lt;/b&gt; and &lt;b&gt;Tracking&lt;/b&gt; through GoogleMaps&lt;br /&gt;    - optimized for &lt;b&gt;Low Memory&lt;/b&gt; and &lt;b&gt;Battery&lt;/b&gt; consumption&lt;br /&gt;    - and MUCH more...[1]&lt;br /&gt;&lt;br /&gt;I have registered my sim as the user sim in that software.So when some one change the sim in my mobile , my mobile send a SMS from my mobile to a pre-configured no(In my case its my brothers no).&lt;br /&gt;&lt;br /&gt;That SMS contains following details&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ol&gt;&lt;li&gt;&lt;span id="ctl00_body_Label2"&gt;phone NO: phone number of the currrent user&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span id="ctl00_body_Label2"&gt;IMEI : International mobile euipment identity&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span id="ctl00_body_Label2"&gt;IMSI : International Mobile Subscriber Identity&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span id="ctl00_body_Label2"&gt;GSM CELL ID  &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span id="ctl00_body_Label2"&gt;GSM AREA ID&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span id="ctl00_body_Label2"&gt;GSM COUNTRY ID&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;Now i'm getting updates from my mobile about the SIM changes containing above info.I have provided that information to the police So they can get the user information form the service provider.&lt;br /&gt;&lt;br /&gt;IMEI can also used to track a user.&lt;br /&gt;&lt;br /&gt;IMEI is a unique number for a given mobile device.when that device try to do any data transfer it sends it IMIE to the service provider (Which get logged) even a service provider can reject any data transfers from a given IMEI.So we can use this to track the device and also to make is useless to the user.&lt;br /&gt;&lt;br /&gt;IMSI is a unique no for a given SIM&lt;br /&gt;&lt;br /&gt;cell id and area id are GSM network specific details which can be used to track the mobile location.&lt;br /&gt;&lt;br /&gt;I have already given up in finding my mobile but i hope at least police will be able to track the guy or the gang who did this which is finally  good for the Country.&lt;br /&gt;&lt;br /&gt;IMHO even the Gardian free edition is good for general use.&lt;br /&gt;&lt;br /&gt;[1]http://www.guardian-mobile.com&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5788585182362034570-1925896807996489913?l=charithwiki.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://charithwiki.blogspot.com/feeds/1925896807996489913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5788585182362034570&amp;postID=1925896807996489913' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/1925896807996489913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/1925896807996489913'/><link rel='alternate' type='text/html' href='http://charithwiki.blogspot.com/2009/03/guardian-mobile-become-handy-when-your.html' title='Guardian-Mobile become handy when your mobile got stolen(personal experience)'/><author><name>CharithWiki</name><uri>http://www.blogger.com/profile/11621891184662231243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SbpO7BJKblI/AAAAAAAAADo/inO_nIjM-Pg/S220/me2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_TAP3Nzxz-vQ/SbKPNRFPDlI/AAAAAAAAADg/txDwd2IrbZE/s72-c/config1.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5788585182362034570.post-2350352081914028621</id><published>2009-01-22T03:22:00.001-08:00</published><updated>2009-01-22T03:47:15.661-08:00</updated><title type='text'>Its time to Stop Forwarding junk mails</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_TAP3Nzxz-vQ/SXhXK4z7eKI/AAAAAAAAACo/tMJalerLc2I/s1600-h/network.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 282px;" src="http://1.bp.blogspot.com/_TAP3Nzxz-vQ/SXhXK4z7eKI/AAAAAAAAACo/tMJalerLc2I/s400/network.gif" alt="" id="BLOGGER_PHOTO_ID_5294077206534518946" border="0" /&gt;&lt;/a&gt;With the fast growth of internet facilities and lot of free space given in mail accounts.Now People used to forward some mails that contain&lt;br /&gt;&lt;br /&gt;Wishes , Beautiful Pictures ,etc....&lt;br /&gt;They are using it as a  good way of keeping touch with friends.&lt;br /&gt;&lt;br /&gt;But if we see the size of those mails with attachments.and the way they are transfered between people its a great waste of resources.each and every mail we send use the processing power of every node in its path.Processing time of those nodes means power.&lt;br /&gt;&lt;br /&gt;I think its time for us to sit back and think about the big process happening behind before we forward a another mail.  &lt;br /&gt;&lt;br /&gt;according to the Butterfly effect "Small variations of the initial condition of a dynamical system may produce large variations in the long term behavior of the system."&lt;br /&gt;&lt;br /&gt;Lets make that Small variation for the betterment of the globe.&lt;br /&gt;So lets try do minimize the unwanted data transfers through networks.And save some resources of the globe.&lt;br /&gt;&lt;br /&gt;As a conclusion  i remember a great saying "Earth has more than enough resources to fulfill mans needs but not his unlimited desires"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5788585182362034570-2350352081914028621?l=charithwiki.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://charithwiki.blogspot.com/feeds/2350352081914028621/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5788585182362034570&amp;postID=2350352081914028621' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/2350352081914028621'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/2350352081914028621'/><link rel='alternate' type='text/html' href='http://charithwiki.blogspot.com/2009/01/its-time-to-stop-forwarding-junk-mails.html' title='Its time to Stop Forwarding junk mails'/><author><name>CharithWiki</name><uri>http://www.blogger.com/profile/11621891184662231243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SbpO7BJKblI/AAAAAAAAADo/inO_nIjM-Pg/S220/me2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_TAP3Nzxz-vQ/SXhXK4z7eKI/AAAAAAAAACo/tMJalerLc2I/s72-c/network.gif' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5788585182362034570.post-42332845232992936</id><published>2009-01-06T04:21:00.000-08:00</published><updated>2009-01-06T05:16:35.133-08:00</updated><title type='text'>Apache Synapse Spring Mediator -(Feel the  power of Apache Synapse) </title><content type='html'>&lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;Apache Synapse is&lt;/span&gt;&lt;span style="font-size:100%;"&gt; a Ligh&lt;/span&gt;&lt;span style="font-size:100%;"&gt;t weight ESB from Apache which supports XML webservies. And also it is a very extendible project[1].&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;Massage mediation is a core mode in Synapse. When in massage mediation mode Synapse act as a transparent proxy for clients. And also if Synapse receives a massage that does not belongs to any of the proxy services it will go through massage mediation[2] defined.&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;Synapse has Components named as Mediators witch can perform mediation action on the Message(MessageContext).Mediators get the full control over the message that is passing through it. Mediator can modify and inspect message or do something by looking at the message body. Since Synapse supports writing custom mediators the possibilities of usage of Mediators become unlimited.&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;"&gt;Synapse Spring Mediator&lt;/span&gt; is a Mediator which enables Spring users to expose their Spring Beans as Mediators in Synapse.&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;Following is a example of how to use Spring Mediator&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;First thing we have to do is write a simple Bean that extends org.apache.synapse.mediators.AbstractMediator (AbstractMediator class can be found in Synapse core). &lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;Eg:&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;package demo.hello;&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;import .....&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;public class HelloMediator  extends AbstractMediator  {&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;	private String name;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;	public void setName(String name){&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;		this.name=name;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;	}&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;	public String getName(){&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;		return name;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;	}&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;	public boolean mediate(MessageContext synCtx) {&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;		System.out.println(“Messsage Id: ”+ synCtx.getMessageID());&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;		System.out.println(“Hello ”+name);&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;		return true;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;	}&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;}  &lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;then put that class in to a Jar file and put it in the lib directory in Synapse installation directory(SYNAPSE_HOME). &lt;/span&gt; &lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;Then we should write a xml file for that Spring Bean&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;ex: springsample.xml&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_TAP3Nzxz-vQ/SWNSMvEg1yI/AAAAAAAAACg/Yxhp03wbVX8/s1600-h/springxml.JPG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 131px;" src="http://4.bp.blogspot.com/_TAP3Nzxz-vQ/SWNSMvEg1yI/AAAAAAAAACg/Yxhp03wbVX8/s400/springxml.JPG" alt="" id="BLOGGER_PHOTO_ID_5288160766210397986" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;  	&lt;meta equiv="CONTENT-TYPE" content="text/html; charset=utf-8"&gt; 	&lt;title&gt;&lt;/title&gt; 	&lt;meta name="GENERATOR" content="OpenOffice.org 2.4  (Linux)"&gt; 	&lt;style type="text/css"&gt; 	&lt;!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } 	--&gt; 	&lt;/style&gt;  &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;and then we must write a  SynapseConfiguration to use this. For that edit the Synapse.xml file in SYNAPSE_HOME/repository/conf/ as follows&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SWNRpeUMegI/AAAAAAAAACQ/8JWJ8BtGG54/s1600-h/synapsexml.JPG"&gt;&lt;img style="cursor: pointer; width: 491px; height: 124px;" src="http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SWNRpeUMegI/AAAAAAAAACQ/8JWJ8BtGG54/s400/synapsexml.JPG" alt="" id="BLOGGER_PHOTO_ID_5288160160417348098" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;  	&lt;meta equiv="CONTENT-TYPE" content="text/html; charset=utf-8"&gt; 	&lt;title&gt;&lt;/title&gt; 	&lt;meta name="GENERATOR" content="OpenOffice.org 2.4  (Linux)"&gt; 	&lt;style type="text/css"&gt; 	&lt;!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } 	--&gt; 	&lt;/style&gt;  &lt;p style="margin-bottom: 0in;"&gt;  &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;put the springsample.xml in repository/conf/ directory of the Synapse installation directory.&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;Then Start the Synapse and try sending a message through synapse (you can use the client and server that is used in Synapse sample 0).&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;Above example shows how we can use the Synapse Spring Mediator to make Spring Bean a Mediator.&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;Now lets Look at the Power of this usage of Spring mediator. Since a mediator gives the total control over the message passing through it  and the Spring supports  Inject dependencies  to the Spring bean  using a XML configuration file,using a Spring Bean as a Mediator gives  Spring users unlimited degree  of freedom over the Message passing through the  Spring bean.&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;One possibility came across my mind is Spring Users can use the Spring Mediator as a Bridge to pass a the Message to their own project.Using the inversion of control capability given  by Spring .Spring users can make that very effective and flexible.&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SWNRijPHWnI/AAAAAAAAACI/xiAHNEP61ek/s1600-h/SpringMed.JPG"&gt;&lt;img style="cursor: pointer; width: 422px; height: 316px;" src="http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SWNRijPHWnI/AAAAAAAAACI/xiAHNEP61ek/s400/SpringMed.JPG" alt="" id="BLOGGER_PHOTO_ID_5288160041479133810" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;  	&lt;meta equiv="CONTENT-TYPE" content="text/html; charset=utf-8"&gt; 	&lt;title&gt;&lt;/title&gt; 	&lt;meta name="GENERATOR" content="OpenOffice.org 2.4  (Linux)"&gt; 	&lt;style type="text/css"&gt; 	&lt;!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } 	--&gt; 	&lt;/style&gt;  &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;As image shows Spring Bean Mediator can be used as a bridge to pass the  Messsage context to a project,And using the Spring XML file user can define appropriate dependencies that can be used to process the message without changing the code or changing Synapse Configuration. The main advantage here is Spring users do not have to have the knowledge on Synapse configuration. Once they have configure the synapse to use the the Spring Mediator they can use and change the Spring XML file to inject dependencies that can be used to use/change the message context.&lt;/span&gt;&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;And also I think Spring Mediator can be used to make a Wrapper Software project around synapse(As the same way synapse is wrapped around axis2) and Spring XML file can be used as a configuration file for that software.    &lt;/span&gt; &lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;  &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;[1] -http://synapse.apache.org/Synapse_Extending.html&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;[2]-http://synapse.apache.org/Synapse_Configuration_Language.html&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;title&gt;&lt;/title&gt; 	&lt;meta name="GENERATOR" content="OpenOffice.org 2.4  (Linux)"&gt; 	&lt;style type="text/css"&gt; 	&lt;!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } 	--&gt;&lt;/style&gt;&lt;p style="margin-bottom: 0in;"&gt;   	&lt;meta equiv="CONTENT-TYPE" content="text/html; charset=utf-8"&gt; 	&lt;title&gt;&lt;/title&gt; 	&lt;meta name="GENERATOR" content="OpenOffice.org 2.4  (Linux)"&gt; 	&lt;style type="text/css"&gt; 	&lt;!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } 	--&gt; 	&lt;/style&gt;  &lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;/span&gt; &lt;/p&gt;&lt;br /&gt;&lt;p style="margin-bottom: 0in;"&gt;   &lt;span style="font-size:100%;"&gt; &lt;/span&gt; &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;    &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;span style="font-size:100%;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5788585182362034570-42332845232992936?l=charithwiki.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://charithwiki.blogspot.com/feeds/42332845232992936/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5788585182362034570&amp;postID=42332845232992936' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/42332845232992936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/42332845232992936'/><link rel='alternate' type='text/html' href='http://charithwiki.blogspot.com/2009/01/apache-synapse-spring-mediator-feel.html' title='Apache Synapse Spring Mediator -(Feel the  power of Apache Synapse) '/><author><name>CharithWiki</name><uri>http://www.blogger.com/profile/11621891184662231243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SbpO7BJKblI/AAAAAAAAADo/inO_nIjM-Pg/S220/me2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_TAP3Nzxz-vQ/SWNSMvEg1yI/AAAAAAAAACg/Yxhp03wbVX8/s72-c/springxml.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5788585182362034570.post-8810278811364626587</id><published>2008-10-22T08:25:00.000-07:00</published><updated>2008-10-22T08:42:06.819-07:00</updated><title type='text'>Lenovo 3000 N200 sound card problem solved</title><content type='html'>My Laptop is a lenovo 3000 N200.After i installed Ubuntu 8.04 my sound car was not detected by the system.&lt;br /&gt;And also there were no software to test my finger print reader.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;To fix the sound card problem in Lenovo 3000 N200&lt;/span&gt; what i did was&lt;br /&gt;&lt;br /&gt;1. open alsa-base file in the /etc/modprobe.d directory using a text editor&lt;br /&gt;&lt;br /&gt;eg: $sudo vim  /etc/modprobe.d/alsa-base&lt;br /&gt;&lt;br /&gt;2 .then add following line to the end of that file&lt;br /&gt;&lt;br /&gt;options snd-hda-intel model=lenovo&lt;br /&gt;(and saved the file)&lt;br /&gt;&lt;br /&gt;3.Open a empty text space and add the same line to that and save it as modprobe.conf in /etc/ directory and /etc/modutils/ directory&lt;br /&gt;&lt;br /&gt;then i saved the files and restart the machine&lt;br /&gt;&lt;br /&gt;finally i heard the sweeeeeeet Ubuntu starting sound........Cooooool&lt;br /&gt;My next step is to find a fingerprint reader software for my fp reader....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5788585182362034570-8810278811364626587?l=charithwiki.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://charithwiki.blogspot.com/feeds/8810278811364626587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5788585182362034570&amp;postID=8810278811364626587' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/8810278811364626587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/8810278811364626587'/><link rel='alternate' type='text/html' href='http://charithwiki.blogspot.com/2008/10/lenovo-3000-n200-sound-card-problem.html' title='Lenovo 3000 N200 sound card problem solved'/><author><name>CharithWiki</name><uri>http://www.blogger.com/profile/11621891184662231243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SbpO7BJKblI/AAAAAAAAADo/inO_nIjM-Pg/S220/me2.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5788585182362034570.post-7571184823782146640</id><published>2008-10-18T09:18:00.000-07:00</published><updated>2008-10-18T09:44:09.512-07:00</updated><title type='text'>Dialog HSPA modem in Linux /Ubantu</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SPoPxJgOQKI/AAAAAAAAAAo/KcMEFAWjS0U/s1600-h/Screenshot-1.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SPoPxJgOQKI/AAAAAAAAAAo/KcMEFAWjS0U/s320/Screenshot-1.png" alt="" id="BLOGGER_PHOTO_ID_5258532851947552930" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Finally i managed to use my &lt;span style="font-weight: bold;"&gt;Dialog HSPA modem in &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Ubantu 8.04&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;.It is a &lt;span style="font-weight: bold;"&gt;Huawi e220&lt;/span&gt; modem i used to connect.I didn't successful in using&lt;span style="font-weight: bold;"&gt; wvdial&lt;/span&gt; in this case.&lt;br /&gt;So what i did is update the ubanu network manager by adding some src url to my update list file&lt;br /&gt;this is the steps i followed&lt;br /&gt;&lt;br /&gt;1. go to /etc/apt&lt;br /&gt;&lt;br /&gt;2. open  source.list file in a text editor (you must set the R/W active to the file before that)&lt;br /&gt;&lt;br /&gt;3 Add following two lines to the end of the file&lt;br /&gt;&lt;br /&gt;deb http://ppa.launchpad.net/network-manager/ubuntu hardy main&lt;br /&gt;deb-src http://ppa.launchpad.net/network-manager/ubuntu hardy main&lt;br /&gt;&lt;br /&gt;and save the file&lt;br /&gt;&lt;br /&gt;4. type apt-get update in the terminal (Better do it as the root)&lt;br /&gt;&lt;br /&gt;5.Then update manager will appier in the task bar( its a arrow directing down direction to indicate download)&lt;br /&gt;&lt;br /&gt;6.DO the update and restart the machine with modem connected.&lt;br /&gt;&lt;br /&gt;7.go to system-&gt;preferences -&gt; network configuration to configure the connection&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if you do not have a internet connection ,&lt;br /&gt;use following url to download network manager&lt;br /&gt;http://packages.ubuntu.com/gutsy/i386/network-manager-pptp/download&lt;br /&gt;&lt;br /&gt;But what I did was i net worked my machine with windows machine and use my dialog modem to connect to the internet using that machine and share the net connection so that i can update Ubuntu online&lt;br /&gt;&lt;br /&gt;have fun.......&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5788585182362034570-7571184823782146640?l=charithwiki.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://charithwiki.blogspot.com/feeds/7571184823782146640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5788585182362034570&amp;postID=7571184823782146640' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/7571184823782146640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/7571184823782146640'/><link rel='alternate' type='text/html' href='http://charithwiki.blogspot.com/2008/10/dialog-hspa-modem-in-linux-ubantu.html' title='Dialog HSPA modem in Linux /Ubantu'/><author><name>CharithWiki</name><uri>http://www.blogger.com/profile/11621891184662231243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SbpO7BJKblI/AAAAAAAAADo/inO_nIjM-Pg/S220/me2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SPoPxJgOQKI/AAAAAAAAAAo/KcMEFAWjS0U/s72-c/Screenshot-1.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5788585182362034570.post-8629929327295865047</id><published>2008-09-08T01:00:00.000-07:00</published><updated>2008-09-16T14:00:30.305-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MObie Train Time table'/><title type='text'>Mobile Train TimeTable for Srilanka</title><content type='html'>For my Level 3 programming project I did a train time table management system which enables the Users to view train details through mobile phone and a web interface.while the train staff is able to keep the train time table upto date by adding ,removing,editing ,posting delays ect..&lt;br /&gt;&lt;br /&gt;This was a solution provided for a current Sri Lanken problem where no existing solutions are there.&lt;br /&gt;It is a extendible system which was designed and implemented using MVC architecture.As a result of that the system is easily convertible to the new technologies.&lt;br /&gt;&lt;br /&gt;you can read the Final Report of the project from&lt;br /&gt;&lt;a href="http://rapidshare.com/files/143558563/Final_Report.pdf.html"&gt;http://rapidshare.com/files/143558563/Final_Report.pdf.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;you can download mobile application source from&lt;br /&gt;&lt;a href="http://www.4shared.com/dir/9174953/943469c2/MeelangaDumriya.html"&gt;http://www.4shared.com/dir/9174953/943469c2/MeelangaDumriya.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Enjoy&lt;br /&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="color: rgb(192, 192, 192);"&gt;&lt;span style="color: rgb(204, 204, 204);"&gt;MOBILE MOBILE MOBILE MOBILE MOBILE MOBILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204);"&gt;CHARITH CHARITH CHARITH CHARITH CHARITH&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5788585182362034570-8629929327295865047?l=charithwiki.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://charithwiki.blogspot.com/feeds/8629929327295865047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5788585182362034570&amp;postID=8629929327295865047' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/8629929327295865047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5788585182362034570/posts/default/8629929327295865047'/><link rel='alternate' type='text/html' href='http://charithwiki.blogspot.com/2008/09/mobile-train-timetable-for-srilanka.html' title='Mobile Train TimeTable for Srilanka'/><author><name>CharithWiki</name><uri>http://www.blogger.com/profile/11621891184662231243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='21' src='http://3.bp.blogspot.com/_TAP3Nzxz-vQ/SbpO7BJKblI/AAAAAAAAADo/inO_nIjM-Pg/S220/me2.jpg'/></author><thr:total>8</thr:total></entry></feed>
