• Category Archives: Java

Java specific articles

Jackson 2.x javax.management.ObjectName Custom JSON Serializer

The following is the source code for a javax.management.ObjectName serializer that recursively serializes and is a good example of how to avoid circular references. This is specifically aimed at dumping the DomainRuntimeServiceMBean and the RuntimeServiceMBean servers from Weblogic 11g, but it should work with any JMX standards compliant MBServer implementations.

A Generic Object Oriented replacement for large Switch / Case and If / Else statements in Java

I saw this post on StackOverflow and thought I would whip up a quick Object Oriented solution using Generics using the Chain of Responsibility Pattern. This was a quick exercise to see how it might look. There are many other ways that this could be implemented, like using Dependency Injection to supply the implementations of… Read the full article

How to install the Offical Oracle JDK on Centos 5.5 and add select it as the default JDK

Here’s the command to install an alternative installation of Java: I installed JDK 6u22 from the executable rpm.bin file from the Oracle site. Then I ran this command to add it to the alternatives program. alternatives –install /usr/bin/java java /usr/java/jdk1.6.0_22/bin/java 99 then you just run alternatives –config java There are 3 programs which provide ‘java’.… Read the full article