Monday, September 21, 2009

Restlet server extension based on Netty

RestletExtensionNetty is a Restlet server extension that is providing REST capabilities on top of Netty.

Restlet is a powerfull REST framework that is not relaying on Servlet specification. It allows you to develop REST servers and clients very easy. See more details at: http://www.restlet.org
Netty is is an effort to provide an asynchronous event-driven network application framework and tools for rapid development of maintainable high performance and high scalability protocol servers and clients.In other words, Netty is a NIO client server framework which enables quick and easy development of network applications such as protocol servers and clients. More information on Netty site: http://jboss.org/netty/

RestletExtensionNetty is build on top of Netty HTTP codec, providing both HTTP and HTTPS connectors to Restlet.

Current code is part of Restlet 2.0 M6

Let me know how it works for you.

Sunday, May 3, 2009

Using UmlGraph with Maven

I have used UmlGraph to generate class diagrams inside javadocs in most of the projects that I'm involved to.
Latest version available in Central Maven repository is 4.6. This is a pretty old version of UmlGraph that for me throws NullPointerException every time I'm using generics in code.
Solution that I found to be able to generate class diagrams for projects was to migrate to a new version of UmlGraph, version 5.2. UmlGraph vesion 5.2 is the latest available at the moment of writing this blog entry.
However, this latest vesion is not availble in Maven Central repository. The solution is to install it in local repository or organization remote repository.
To install locally, here is the command line:

mvn install:install-file -Dpackaging=jar -DartifactId=UmlGraph -Dversion=5.2 -Dfile=/home/{user}/opt/UmlGraph-5.2.jar -DgroupId=gr.spinellis -DgeneratePom=true


Command assume that you have downloaded the jar from UmlGraph site to /home/{user}/opt folder.

Also UmlGraph code has been re-organized and the doclet is located in org.umlgraph.doclet package. To use it in your project you have to specify the doclet as part of javadoc maven plug-in:


<plug-in>
<artifactid>maven-javadoc-plugin</artifactid>
<configuration>
<source>1.5</source>
<aggregate>true</aggregate>
<doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
<docletartifact>
<groupid>gr.spinellis</groupid>
<artifactid>UmlGraph</artifactid>
<version>5.2</version>
</docletartifact>
<additionalparam>
-all -inferrel -inferdep -quiet -hide java.*
-collpackages java.util.* -qualify
-postfixpackage -nodefontsize 9
-nodefontpackagesize 7 -outputencoding utf8
</additionalparam>
</configuration>
</plug-in>

Thursday, September 11, 2008

Java SE 6 platform provides a new API that helps you find, load, and use service providers. This API was part of the platform from version 1.3 but was not public.

There is a good introduction in this API on Sun Developer Network site - Creating Extensible Applications With the Java Platform.

Trying to get advantages of this new API in RAP based application, where service providers are developed as components and build with Maven, I found that there no hint/tip regarding how to create the Manifest information to publish the information needed by Service Loader API to find service providers in ClassPath.

Service Components that are part of RAP application are following standard Maven code organization structure. The easiest way to publish service information is to create a new folder name META-INF under src/main/resources. Under META-INF you can create the services folder. Services folder is the one that Service Loader API is using to identify service providers. The introductory tutorial mention above describe how to create the meta information for service provider.

Wednesday, January 3, 2007

Code Review tool

Recently I've looked to Google Code Review tool, Mondrian.
The author did a good presentation of the tool on Google Video.