Friday, May 28, 2010

HTML 5 WebSocket API presentation

Good presentation slides by David Lindkvist via slideshare.com

Saturday, May 22, 2010

jWebSocket Step-By-Step

Just now i wrote a first part of the series of jWebSocket tutorials or articles that will try to write to cover everything about jWebSocket from the source.
http://blog.jwebsocket.org/2010/05/22/jwebsocket-step-by-step-part-1/

Sunday, May 9, 2010

Multiple oAuth using RPX service

I used RPX service today in one of my random web application BookTwitts that i am trying to make it just for fun. RPX is pretty cool, it's a hassle to work on that very redundant work of user sign-in, maintaining profile etc. with RPX you can use 6 of the OAuth providers for free and the setup process is super easy.

Now to handle the callback POST request from the RPX proxy with authentication token after the user is authenticated we can write a simple java code. Here's the main snippet i used. (Assuming Spring MVC controller)


Here, I used Spring MVC controller example to handle POST request from RPX with authentication token as a request parameter. Also used Gson library for serializing JSON response to the RPXResponse object.

Now here's how RpxHelper class looks like that fetches the JSON response using the token id from RPX post request.


And at last here's how the RPXResponse class and serialized profile class using JSON response.


So this is it basically, after you do this you have the basic profile data provided by RPX service.. Let me know if it doesn't work for you. Happy to help!!!

Saturday, May 1, 2010

invokedynamic on JDK7

Looks like JDK7 as per Oracle could be the next release of Java Platform. One of the most interesting addition seems to be the addition of new bytecode operation for method invocation, which is 'invokedynamic'.

invokedynamic bytecode operation which works more like 'inovkeinterface' but without the need to specify the return type and the target type of the method being invoked. This will release the lot of pressure from the developers dynamic languages that runs on JVM. Now They don't have to generate the bytecodes as per statically typed JVM because bytecode has been designed exclusively for statically typed languages, especially in its treatment of method invocation.

invokedynamic bytecode will use a linkage mechanism provided by class MethodHandle in the pacakage java.dyn, that contains the classes associated with dynamic language support in the Java platform.