Mutant World

Sunday, January 23, 2005

PNG transparency in Internet Explorer

PNG is the format of the icons we use in one of our applications.
I develop the application using Firefox, since it has a powerful plugin: the web developer.
However, the application will almost certainly be displayed in Internet Explorer, which is unable to display correctly PNG icons, in particular cannot render correctly the PNG transparency.

While surfing the internet in search of a solution, I found this site: IE7.
Quite impressive the number of features it fixes on Internet Explorer, and I'd like to know if someone has used it and what impressions has got of IE7.

We fixed the PNG transparency problem in another way, using a script present at this URL.

Thursday, January 13, 2005

The MBeanServer of a J2EE Application Server

During JavaPolis, I've had the chance to discuss with Eamonn, and he
brought to the discussion that right now there is no standard way to access the MBeanServer that is normally instantiated by a J2EE application server.

Take a servlet or a session EJB, they can only try to call

List mbeanServers = MBeanServer.findMBeanServer(null);

and guess which one of the MBeanServers contained in the List is the application server's one.
As an example, the above call returns one MBeanServer (the Application Server's) in J2SE 1.4, but returns two in J2SE 5.0 (the platform MBeanServer and the Application Server's).

We were discussing that 'something' can be registered in the naming service, say
under java:comp/env/jmx/whatever.
That 'something' can be something new, but that would require new JMX classes (or new J2EE classes): not ideal, since they will be available only in the future, and not widely adopted for a longer time.

Another solution we discussed was to register in JNDI a JMXConnector, already defined by JSR 160 and present in J2SE 5.
A J2EE specification (most likely JSR 77) may reserve a protocol, say 'j2ee', for such a JMXConnector. JMXServiceURLs would look like service:jmx:j2ee://host/jndi/whatever.

Specifying a new protocol allows the application server to have full control on the implementation, for example to filter method calls (e.g. to avoid to mess with the Application Server's MBeans).
The binding to the naming service can be defined in a new element in the J2EE deployment
descriptor, and the usual J2EE stuff can be applied with regards to security (I don't think any transaction is needed, nor any thread control, etc.).

A client application can lookup the JMXConnector, and then connect (possibly providing credentials), and then use the standard API to register, query, unregister, invoke methods on MBeans, if the application server allows that.

Using standardized classes (JSR 160 classes), standardizing the lookup mechanism (defining a java:comp/env/jmx context) and reserving the JMXServiceURL protocol are the first steps I think, but they're enough, probably, to provide a first implementation by application servers.
A maintenance release of JSR 77 can decide/standardize more, if needed.

However, application servers like Geronimo may already try to implement this solution and provide good feedback on pros and cons of this solution.

Sunday, January 02, 2005

Ennio Morricone's concert

I have enjoyed very much the concert master Ennio Morricone gave for end year's day in Rome.
I like very much soundtracks, especially from those great composers such as Ennio Morricone, Hans Zimmer, Danny Elfman, James Horner.
These 4 persons have written most of the soundtracks of the major movies around in the last 10-15 (if not more) years: quite amazing.
While listening to the concert, I was thinking of the privilege that the orchestra has to play and to be directed by the composer itself: not an interpretation, but the composer himself that tells "I want it this way".

If you like listening music during Java programming, I recommend to buy some soundtrack by those 4 guys: you won't be disappointed.

JavaPolis day 4 & 5

Garbage Collection with JRockit
Joakim Dahlstedt gave a really good session on memory management and garbage collection on modern JVMs, with particular reference to JRockit.
While I'm quite up-to-date with the JVM technologies (from the user point of view) it's always interesting to listen to the expert (that make the technology).
In particular, it is now quite amazing the level that modern JVMs have reached, especially JRockit.
One thing (among many others) that has stunned me is that JRockit can change the GC algorithm on the fly, while the JVM is running, to adapt to the system runtime load.
Their goal is to keep GC pauses below 50ms for 99.999% of the time.

Offshore Java Development
Vincent Massol (of Cactus and Maven fame) gave a very interesting session on working with offshore (in this case with India) developers in Java projects.
He stressed the importance of the communications and of creating one single team (not "us" and "they", but just "us").
Vincent also gave very practical suggestions on when it is the case to use an offshore team, and how to organize things to work with an offshore team.
Special importance on software engineering and using tools at their best: test coverage tools, bug finding tools, bug reporting tools, instant messaging, continuous integration frameworks are few he mentioned.

Saturday, January 01, 2005

JavaPolis day 3

Open Source Java Programming
Mike Cannon-Brooks of Atlassian gave a great session on using open source to develop (in particular web) applications in Java.
Often, developers tend to use the open source library as is, sticking to the default implementation the library provides.
But more often, open source libraries provide extension points that can be used to extend its behavior in a way that is more suited to developer's needs; it is just a matter of knowing at best what you're using for your daily development, since it can save a lot of time !
Checkout Atlassian's open source stuff at great stuff.

James Strachan and Dion Almaer gave a friendly introduction to Groovy.
This language is growing and certainly needs attention (despite Hani's bashing ;-).
James and Dion like to be on the stage, and are brave enough to have introduced GStrings in Groovy :-D
Jokes apart, it is quite amazing the number of uses that one can make of Groovy, so if you have some free time, go check it out.