Building Java Applications with Windows Azure

Looking for a place to host my own home grown apps, I came across an interesting presentation about using Windows Azure cloud to run Tomcat and a JVM in the Microsoft cloud solution. See Building Java Applications with Windows Azure

The presentation basically says Azure can run any native code, which means java.exe and tomcat.  Native programs that runs off a batch file with no specific registry key or lowlevel system dependencies or installers are more likely to run in Azure.

Azure has worker roles and web roles.  Web roles are used for hosted apps with .net/php and IIS and not used here, however the worker role is used to run native code.  It can be bound to a network port (ie port 80)

The Microsoft support comes in with an Eclipse plugin to access your resources in the cloud from within Eclipse.  There is a jar that wraps up the RESTful interface to Azure that your app would normally use to access the clouds resources with Java helper classes and provides some other .NET helper classes.

It also comes with some helper stuff to setup Tomcat – ‘Tomcat Solution Accelerator’ – to configure Tomcat to make it very light in terms of OS dependencies.  It also has monitoring of Tomcat to let Azure know to restart the app if it fails and also help indicate to MS there is a problem with the particular server that instance in their cloud is perhaps not working as it should.

I do like that you get to choose the versions of Tomcat and Java you want, and there doesn’t seem to be much of a reason you couldn’t apply this to other languages and appserver environments.  (Grails/Jetty? – and hopefully Glassfish, but that may need a bit more config work to pack it up and install on the cloud).  That last point sounds a bit negative, you could probably get a service on a VM linux host that means you dont have to fudge around so much, but still the novelty polyglot value of having JVM and .NET in the same cloud environment may actually outweigh the negative of the DIY setup.  The presentation explains how the Tomcat is packaged and shows the contents of the packaging scripts to give you an understanding of how to do the same for another appserver.

One nice thing about the Azure platform itself is that you have production and staging slots – you can have a production app in the cloud, and also a staging version too – and swap them over when you are happy with Staging.

The other aspect is the queues/worker facility to allow for concurrency when running your app across multiple nodes, asynchronous architectures and scalability.

To try it out, you’ll get free access to Azure while its in CTP status (till Jan 09), and then MS will start asking for money. Apparently, Dominoes pizza is testing out their next version of their ordering webapp on the platform, if you wanted a vote of confidence too

Azure Java SDK available here:

Bertrand Meyer, ETM, Java Byte Code, Eiffel

Bertrand Meyer is the author of a classic software development book Object-Oriented Software Construction.  He is also the father of the Eiffel language.  I have a lot of respect for his work, it was quite heavily plugged when I was at Monash.

In looking for a Bertrand Meyer home page, I came across Betrand Meyer’s ETM homepage.  ETM is where he was working during mid 2007 when the page was written.  He plays a part in co-teaching many of the subjects there (lucky students!).

There are many pieces of gold linked to his site, though these two subjects seemed of most interest to me.

+ “Languages in Depth” series: Java programming, with Manuel Oriol (bachelor’s/master’s) Java

The lectures about the class loading and bytecode were very informative.

+ “Languages in Depth” series: C# programming, with Lisa (Ling) Liu (bachelor’s/master’s) C#

You can also find a link the ECMA Eiffel language specification.

In addition, there are a few interesting tools linked to from this page, as well as a few from the Dept of Computer Sciences download page.

Autotest is a tool that generates tests automatically by looking at the source code, in particular, the way that Design by Contract is used, gives a lot away about what a human tester would be writing, but also tries to make up for the shortfalls that would not normally be apparent in the source code and the fact that developers aren’t perfect to begin with.

The text for the next lot appears directly from the school’s download page.

Contract Wizard 3.0
Description: Regrettably Design by Contract is still a specificity of the Eiffel programming language. Contract Wizard 3.0 is a GUI application that enables adding contracts (preconditions, postconditions, and class invariants) to any .NET assembly, whatever .NET language it was initially written in.

The Pattern Library contains patterns that are usable as components. For the patterns that could not be turned into components the download contains the Pattern Wizard, that let’s you generate the patterns according to your input.

Eiffel library to generate Java bytecodes

Description: This Eiffel library is able to generate Java class files that can be executed by a Java Virtual Machine. A simple language with a corresponding compiler that uses the library as backend was created to test this library and also to give examples of how to use the framework. This language is similar to the Java language, but much simpler.

Funnily enough, the java references I mention in this blog all make reference to the following sites:

The universe is telling to learn about the bytecode behind the JVM…  javap My.class