alt
February 21st, 2010

Embed Glassfish in an existing OSGi environment

OSGi is something that is very fashionable in the industry these days. Every big software company makes sure that its products are running inside OSGi environment. Besides the ‘cloud’, OSGi is one of the most used buzzwords today.

Glassfish is the reference implementation application sever of the Java EE specification. It is itself built of modules that are run and managed by an OSGi environment. So the question that the author of the article answers is whether it can be bundled in another OSGi framework. Equinox is used for that purpose.

The author has developed a simple bundle activator. As Glassfish is itself modularized, the task of the bundle is to walk through the modules directory, register the modules that it finds there with the OSGi runtime, find Glassfish’s main bundle and to start it.

Very interesting post for those of you, who have some experience in the OSGi bundle business.

Rich Java web applications with Apache Wind and AJAX

After last week we read an article about one of Apache’s JAX-WS libraries (Apache CXF), now IBM developers works give us ASF’s proposal for the other web services standard – JAX-RS. Apache Wink is still an incubator project, but nevertheless you can see that it works great. It provides support for both the server side part for developing the web services as well as for the client part for consuming them.

The author explains in the beginning the benefits of JAX-RS: it is easier to use and understand than JAX-WS and the format (or the payload) of the documents that are transmitted between the communicating parties, is not always XML.

The last thing is actually elaborated in more details – in the example application the data is transmitted via JSON. It is less verbose than XML and there are plenty of libraries that convert a JSON file to an object and vice versa.

The second part of the article is for developing the client side of the application. As it is a web application, you can imagine that the author builds some web pages. One of the most popular technologies here is AJAX. Through AJAX, you can execute server request from within java script code of your page without the need reload the whole page. The combination of java script code and quick response time makes the AJAX-ified web applications look and behave nearly like desktop ones.

By reading the article you will not only get hands-on experience in building REST-ful web services, but you will learn how to combine it with the JSON format and how to call the web services from AJAX.

Short introduction to XML schemas

Continuing with the web services in this blog, I present you a short introduction to one very important aspect of the JAX-WS world: the XML schemas.

These are documents that describe the order and type of the XML elements in a document. XML schema documents are very useful for both validating the XML content and also for generating objects from XML. It is a successor of the document type definition (DTD) format, which most of you should know and maybe worked with. By applying XML namespaces, you can have an XML document, which uses and conforms to several XML schemata.

If you need a quick intro and do not have the time to go through the detailed w3c schools tutorials, then this is the article for you. You can also browse Inform IT’s Java guide section for another topic that might be interesting.

Version Control Tools

Another article by Martin Fowler. Virtually all the world developers work with version control tools. You use them everywhere, even for the open source projects that you develop by yourself. If you are not using one for your project, then you should consider choosing. As the author points version control tools are used for both tracking the different versions of the code you develop and also for collaboration.

There are a lot of tools that help us in that. The author reviews three of them, but before that he mentions which are the tools, the he would never use. He classifies the good tools in two groups – with centralized repository and with distributed repository.

If you want to understand more about the differences between Subversion, Mercurial and Git, then go and read the short article.