Sunday, May 11, 2008

ECLIPSE RAP

Eclise RAP


Eclipse as many people knows is about defining bundles (plugins) and extending the system. With OSGI it goes one step further and allows to add bundles to system at run time. This is what adds value to its architecture. You can add bundle to system, you can stop it, you can redeploy it and many more. This means no restart. This will sound familiar to J2EE developer. Containers supports similar kind of feutures. But difference with OSGI you can redeploy changes in class files without restart which otherwise may need restart on J2EE container.

Eclipse Rich client Ajax platform is platform which allows developers to create rich ajax ui application using their knowledge SWT development and (J2EE) servlet technologies.
Actually j2ee details is mostly encapsulated by underlying RAP framework bundles.

So thing here is that you can develop application working on AJAX, coded in JAVA SWT and runs in browser.

Commucation of SWT code to html is done by underlying RWT framework and qooxdoo framework. Developer actually codes in RWT which has same interface as of SWT and qooxdoo is javascript library which handles user events on browser and communicates with widgets on server side.

I just went into code to find how it serves the request. This is what i understood about them.

It started with url : http://localhost:8080/rapdemo/rap.
Where I have deployed one web application with context path “rapdemo”. And one servlet mapped to path /rap.

Rap application has lauch configuration file where we can specify servlet name.

Eclipse-equinox bridge receives request from client on server. This is also one bundle which is like ActionServlet in struts as it receives http request and then passes control to eclipse bundles. Deployed war file has required bundles. Based on alias “rap” in request control is transferred to proper UI with default entrypoint.

RWTDelegate is the servlet which receives request for rap applications. This servlet is mapped to path “/rap”. This servlet transfers control to RWTLifeCycleServiceHandlerSync. Here you can find more on RWTLifeCycle: http://wiki.eclipse.org/WidgetToolkit. This is about lifecycle thread that is started for this web application. This is the thread that serves user requests.

Interesting thing about RWT as mentioned in this article is:

"Render: is where the markup or javascript assignments are created, which will be sent to the browser. During the actual rendering no changes of the widget-tree will happen - neither creation or addition of new widgets nor changing of attributes of existing ones. The AJaX-rendering-mode only creates assignments of those widget-attributes that were changed during the request-processing. This results in a minimal amount of information that needs to be exchanged between server and client."

No comments: