<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Java on Dejan Bosanac</title>
    <link>/categories/java/</link>
    <description>Recent content in Java on Dejan Bosanac</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    
    <lastBuildDate>Mon, 18 Jan 2010 00:00:00 +0000</lastBuildDate><atom:link href="/categories/java/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Jettison 1.2 Released</title>
      <link>/posts/2010-01-18-jettison-12-released/</link>
      <pubDate>Mon, 18 Jan 2010 00:00:00 +0000</pubDate>
      
      <guid>/posts/2010-01-18-jettison-12-released/</guid>
      <description>&lt;p&gt;Jettison version 1.2 has been released. The highlights of this release are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Refactored MappedXMLStreamWriter - which solved many issues with serializing arrays&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Plugable type converters and support for 64-bit long conversion&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;You can find the full change log for this release on the &lt;a href=&#34;http://jettison.codehaus.org/Download&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Download&lt;/a&gt; page. Enjoy&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Python messaging: ActiveMQ and RabbitMQ</title>
      <link>/posts/2009-10-20-python-messaging-activemq-and-rabbitmq/</link>
      <pubDate>Tue, 20 Oct 2009 00:00:00 +0000</pubDate>
      
      <guid>/posts/2009-10-20-python-messaging-activemq-and-rabbitmq/</guid>
      <description>&lt;p&gt;I found myself recently with a task of testing various Python messaging clients. In this article I&amp;rsquo;ll present my findings regarding performance and scalability on two Python clients connecting to &lt;a href=&#34;http://activemq.apache.org&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;ActiveMQ&lt;/a&gt; and &lt;a href=&#34;http://www.rabbitmq.com/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;RabbitMQ&lt;/a&gt; message brokers.&lt;/p&gt;&#xA;&lt;p&gt;For ActiveMQ Python client, I used &lt;a href=&#34;http://code.google.com/p/pyactivemq/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;pyactivemq&lt;/a&gt; library version 0.1.0. It&amp;rsquo;s basically a Python wrapper for &lt;a href=&#34;http://activemq.apache.org/cms/index.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;ActiveMQ-CPP&lt;/a&gt; library, allowing Python clients to communicate with the broker using both &lt;a href=&#34;http://activemq.apache.org/openwire.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;OpenWire&lt;/a&gt; (ActiveMQ specific binary protocol) and &lt;a href=&#34;http://activemq.apache.org/stomp/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Stomp&lt;/a&gt; (Simple text-oriented protocol) protocols. Since it uses ActiveMQ-CPP, installation requires special attention and some of those details you can find in a related &lt;a href=&#34;http://www.nighttale.net/activemq/pyactivemq-on-ubuntu.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;blog post&lt;/a&gt;.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>XML to JSON</title>
      <link>/posts/2009-09-21-xml-to-json/</link>
      <pubDate>Mon, 21 Sep 2009 00:00:00 +0000</pubDate>
      
      <guid>/posts/2009-09-21-xml-to-json/</guid>
      <description>&lt;p&gt;While working on &lt;a href=&#34;http://jettison.codehaus.org/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Jettison&lt;/a&gt;, I often have need to convert XML to JSON. Here&amp;rsquo;s a simple method that uses &lt;a href=&#34;http://xstream.codehaus.org/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;XStream&lt;/a&gt; and &lt;a href=&#34;http://jettison.codehaus.org/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Jettison&lt;/a&gt; to do this conversion.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight-wrapper&#34;&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;import java.io.StringReader;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;import java.io.StringWriter;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;import com.thoughtworks.xstream.io.HierarchicalStreamReader;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;import com.thoughtworks.xstream.io.HierarchicalStreamWriter;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;import com.thoughtworks.xstream.io.copy.HierarchicalStreamCopier;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;import com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;import com.thoughtworks.xstream.io.xml.XppReader;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;public class Test {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;public static void main(String[] args) throws Exception {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;String xml = &amp;#34;ToveJaniReminder&amp;#34; +&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&#x9;&#x9;&amp;#34;Don&amp;#39;t forget me this weekend!&amp;#34;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        HierarchicalStreamReader sourceReader = new XppReader(new StringReader(xml));&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        StringWriter buffer = new StringWriter();&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        JettisonMappedXmlDriver jettisonDriver = new JettisonMappedXmlDriver();&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        jettisonDriver.createWriter(buffer);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        HierarchicalStreamWriter destinationWriter = jettisonDriver.createWriter(buffer);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        HierarchicalStreamCopier copier = new HierarchicalStreamCopier();&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        copier.copy(sourceReader, destinationWriter);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        System.out.println(buffer.toString());&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xA;&lt;p&gt;All conversion problems, like lists representation are handled by Jetttison. This example uses Mapped convention, but of course, BadgerFish notation can be used as well.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>pyactivemq on Ubuntu</title>
      <link>/posts/2009-07-07-pyactivemq-on-ubuntu/</link>
      <pubDate>Tue, 07 Jul 2009 00:00:00 +0000</pubDate>
      
      <guid>/posts/2009-07-07-pyactivemq-on-ubuntu/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://code.google.com/p/pyactivemq/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;pyactivemq&lt;/a&gt; is a Python library that enables Python clients to communicate with &lt;a href=&#34;http://activemq.apache.org&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;ActiveMQ&lt;/a&gt; using both OpenWire and Stomp protocols. To do that it wraps &lt;a href=&#34;http://activemq.apache.org/cms/index.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;ActiveMQ-CPP&lt;/a&gt; library, so it involves some compiling to make it all work. While building instructions for both ActiveMQ-CPP and pyactivemq and clear and concise, I found some additional steps were need to make it all work on Ubuntu box. I&amp;rsquo;ll post it here for my future reference and hopefully it can be useful to other folks.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>ActiveMQ OSGi integration</title>
      <link>/posts/2009-06-10-activemq-osgi-integration/</link>
      <pubDate>Wed, 10 Jun 2009 00:00:00 +0000</pubDate>
      
      <guid>/posts/2009-06-10-activemq-osgi-integration/</guid>
      <description>&lt;p&gt;OSGi containers are becoming a deployment platform of choice for many developers these days. That&amp;rsquo;s why nearly all server-side Java software is packaged as OSGi bundles and ActiveMQ is not an exception. I wrote &lt;a href=&#34;http://activemq.apache.org/osgi-integration.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;an article&lt;/a&gt; that goes into the details on how to deploy and use ActiveMQ broker and web console in &lt;a href=&#34;http://felix.apache.org/site/apache-felix-karaf.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Apache Karaf&lt;/a&gt; (and &lt;a href=&#34;http://servicemix.apache.org/home.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;ServiceMix&lt;/a&gt;) OSGi environments. I hope you&amp;rsquo;ll enjoy reading it.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Jettison 1.1 released</title>
      <link>/posts/2009-04-23-jettison-11-released/</link>
      <pubDate>Thu, 23 Apr 2009 00:00:00 +0000</pubDate>
      
      <guid>/posts/2009-04-23-jettison-11-released/</guid>
      <description>&lt;p&gt;Jettison 1.1 has been released. New features in this release are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;DOM API&lt;/li&gt;&#xA;&lt;li&gt;Type converters&lt;/li&gt;&#xA;&lt;li&gt;OSGi bundle packaging&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;You can find the full change log for this release on the &lt;a href=&#34;http://jettison.codehaus.org/Download&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Download page&lt;/a&gt;. Enjoy!&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Jettison in practice</title>
      <link>/posts/2008-09-17-jettison-in-practice/</link>
      <pubDate>Wed, 17 Sep 2008 00:00:00 +0000</pubDate>
      
      <guid>/posts/2008-09-17-jettison-in-practice/</guid>
      <description>&lt;p&gt;Joel Confino of Chariot Solutions, LLC wrote an &lt;a href=&#34;http://www.infoq.com/articles/First-Cup-Web-2.0-Joel-Confino&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;article&lt;/a&gt; on building Web 2.0 Web applications using jQuery, Spring MVC, and XStream/Jettison. It&amp;rsquo;s good to see &lt;a href=&#34;http://jettison.codehaus.org&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Jettison&lt;/a&gt; in practice :)&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Jettison 1.0.1 released</title>
      <link>/posts/2008-06-09-jettison-101-released/</link>
      <pubDate>Mon, 09 Jun 2008 00:00:00 +0000</pubDate>
      
      <guid>/posts/2008-06-09-jettison-101-released/</guid>
      <description>&lt;p&gt;We&amp;rsquo;re proud to present &lt;a href=&#34;http://jettison.codehaus.org/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Jettison&lt;/a&gt; 1.0.1 release. This is just a bugfix release, while new features (such as new APIs (DOM and SAX) and type converters) are planed for 1.1 release (which is expected soon). Download 1.0.1 from the &lt;a href=&#34;http://jettison.codehaus.org/Download&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Download&lt;/a&gt; section and refer to the &lt;a href=&#34;http://jettison.codehaus.org/User%27s&amp;#43;Guide&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;User&amp;rsquo;s Guide&lt;/a&gt; for more information.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Indexing repositories</title>
      <link>/posts/2008-03-31-indexing-repositories/</link>
      <pubDate>Mon, 31 Mar 2008 00:00:00 +0000</pubDate>
      
      <guid>/posts/2008-03-31-indexing-repositories/</guid>
      <description>&lt;p&gt;Dependency management was always one of the crucial Java project management tasks. It&amp;rsquo;s where tools such as &lt;a href=&#34;http://maven.apache.org/&#34; title=&#34;Maven&#34; target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Maven&lt;/a&gt; and &lt;a href=&#34;http://ant.apache.org/ivy/&#34; title=&#34;Ivy&#34; target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Ivy&lt;/a&gt; make all the difference and allow developers to maintain their project dependencies in an easy way. There are two important elements for this to happen:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Centralized repositories - containing library JARs&lt;/li&gt;&#xA;&lt;li&gt;Metadata - describing those JARs and creating repository structure&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;This is something we have for years thanks to the Maven developers. But if you ever tried to manage dependencies manually in your project, you know how tedious this task can be:&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Customizing Enums</title>
      <link>/posts/2008-02-11-customizing-enums/</link>
      <pubDate>Mon, 11 Feb 2008 00:00:00 +0000</pubDate>
      
      <guid>/posts/2008-02-11-customizing-enums/</guid>
      <description>&lt;p&gt;Enumerated types (enums) are a way to define fixed set of constants, so helpful in many areas of software development. In the most common case, in your Java code written for Java 5 or newer, you will use enums for &lt;code&gt;int&lt;/code&gt; constants and replace chunks of code that look like this&lt;/p&gt;&#xA;&lt;div class=&#34;highlight-wrapper&#34;&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    public static final int DIRECTION_NORTH     = 0;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    public static final int DIRECTION_SOUTH     = 1;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    public static final int DIRECTION_EAST      = 2;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    public static final int DIRECTION_WEST      = 3;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xA;&lt;p&gt;with something like this&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Jettison 1.0 RC3 Snapshot</title>
      <link>/posts/2008-02-06-jettison-10-rc3-snapshot/</link>
      <pubDate>Wed, 06 Feb 2008 00:00:00 +0000</pubDate>
      
      <guid>/posts/2008-02-06-jettison-10-rc3-snapshot/</guid>
      <description>&lt;p&gt;For those who can&amp;rsquo;t wait for 1.0 RC3 to be released (with fixed behavior for &lt;a href=&#34;http://jira.codehaus.org/browse/JETTISON-18&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;converting nested lists and maps from XStream&lt;/a&gt;), you can download patched snapshot from &lt;a href=&#34;http://www.nighttale.net/download/jettison-1.0-RC3-SNAPSHOT.jar&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;here&lt;/a&gt;&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Dealing with large code bases</title>
      <link>/posts/2008-01-02-dealing-with-large-code-bases/</link>
      <pubDate>Wed, 02 Jan 2008 00:00:00 +0000</pubDate>
      
      <guid>/posts/2008-01-02-dealing-with-large-code-bases/</guid>
      <description>&lt;p&gt;If you haven&amp;rsquo;t already, be sure to read &lt;a href=&#34;http://steve-yegge.blogspot.com/2007/12/codes-worst-enemy.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Steve Yegge&amp;rsquo;s post&lt;/a&gt; on his experience of dealing with large code bases (it&amp;rsquo;s a bit long post but an excellent read).&lt;/p&gt;&#xA;&lt;p&gt;He explains the maintenance nightmare of his 500.000 lines of code game written in Java and quite correctly concludes that code size is a crucial problem for big software projects.&lt;/p&gt;&#xA;&lt;blockquote&gt;&lt;p&gt;My minority opinion is that a mountain of code is the worst thing that can befall a person, a team, a company. I believe that code weight wrecks projects and companies, that it forces rewrites after a certain size, and that smart teams will do everything in their power to keep their code base from becoming a mountain. Tools or no tools. That&amp;rsquo;s what I believe.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Extension methods proposals</title>
      <link>/posts/2007-12-05-extension-methods-proposals/</link>
      <pubDate>Wed, 05 Dec 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-12-05-extension-methods-proposals/</guid>
      <description>&lt;p&gt;There&amp;rsquo;s a quite interesting discussion in the blogosphere about proposed &lt;em&gt;extension methods&lt;/em&gt; feature for Java 7. The problem tackled by this proposal is how to extend an API (interface) with new methods without breaking existing implementations. The example used in a discussion is a &lt;code&gt;List&lt;/code&gt; interface and the &lt;code&gt;sort()&lt;/code&gt; method. In order to add another method to the existing interface, Java developers today create static utility functions. Take for example the &lt;a href=&#34;http://java.sun.com/j2se/1.5.0/docs/api/java/util/Collections.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;&lt;code&gt;java.util.Collections&lt;/code&gt;&lt;/a&gt; class, which is a set of static helper methods for working with collections. Among them is of course the aforementioned &lt;code&gt;sort&lt;/code&gt; method. Here&amp;rsquo;s a simple example:&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Multiple Apache instances on Gentoo box</title>
      <link>/posts/2007-11-27-multiple-apache-instances-on-gentoo-box/</link>
      <pubDate>Tue, 27 Nov 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-11-27-multiple-apache-instances-on-gentoo-box/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve started looking how to enable both PHP4 and PHP5 on our (relatively) new dev box running &lt;a href=&#34;http://www.gentoo.org/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Gentoo&lt;/a&gt;. The box is already running PHP4 so the task was to add PHP5 support as well.&lt;/p&gt;&#xA;&lt;p&gt;The official &lt;a href=&#34;http://www.gentoo.org/proj/en/php/php4-php5-configuration.xml&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;guide&lt;/a&gt; is rich in options you can use to achieve this. I didn&amp;rsquo;t want any CGI since we use PHP vhost configurations extensively and I didn&amp;rsquo;t want to deal with suPHP as well. Since it is a dev box, it is totally OK to have two instances with similar configurations running on two different ports. Unfortunately, it is the part of the official docs that is not as complete as other parts and not working as advertised. So, here&amp;rsquo;s a mental note (for me) and perhaps a few hour saver for others.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Groovy StAX builder</title>
      <link>/posts/2007-11-26-groovy-stax-builder/</link>
      <pubDate>Mon, 26 Nov 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-11-26-groovy-stax-builder/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve always loved &lt;a href=&#34;http://groovy.codehaus.org/Builders&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Groovy builders concept&lt;/a&gt; for handling (mostly creating) hierarchical documents. On the other hand I find &lt;a href=&#34;http://stax.codehaus.org/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;StAX&lt;/a&gt;, pull-based processing API, to be one of my favorite methods for dealing with simple XML processing. It&amp;rsquo;s simple and fast, so what more can I ask for? Additionally, thanks to the &lt;a href=&#34;http://jettison.codehaus.org/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Jettison project&lt;/a&gt; you can also use the StAX API to handle JSON documents. So, basically we can use one simple (standard) API to handle both XML and JSON documents in the same manner. The next logical step is to merge these two great pieces of technology into one.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>XStream and Spring OXM (Object/XML Mapping framework)</title>
      <link>/posts/2007-11-16-xstream-and-spring-oxm-objectxml-mapping-framework/</link>
      <pubDate>Fri, 16 Nov 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-11-16-xstream-and-spring-oxm-objectxml-mapping-framework/</guid>
      <description>&lt;p&gt;It all started when I tried to find a solution for customizing an &lt;a href=&#34;http://xstream.codehaus.org/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;XStream&lt;/a&gt; instance for my &lt;a href=&#34;http://activemq.apache.org/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;ActiveMQ&lt;/a&gt; XStream message transformer that would be better than currently used (extending a base transformer and providing a custom factory method that will do things like alias, converter, annotation, etc. settings). I wanted an easy solution to configure XStream instance in a Spring xml configuration file used in my application and provide that instance to all beans that need it (message transformer among others).&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Future of Java</title>
      <link>/posts/2007-11-06-future-of-java/</link>
      <pubDate>Tue, 06 Nov 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-11-06-future-of-java/</guid>
      <description>&lt;p&gt;Tomorrow, on Wednesday 7th, there will be a panel at &lt;a href=&#34;http://ijtc.firstport.ie&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;IJTC&lt;/a&gt; with Joel Spolsky and James Strachan discussing the future of Java. It sounds very compiling to me and I hope to meet you there.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Multi-Language VM</title>
      <link>/posts/2007-10-17-multi-language-vm/</link>
      <pubDate>Wed, 17 Oct 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-10-17-multi-language-vm/</guid>
      <description>&lt;p&gt;OpenJDK community has a new project, &lt;em&gt;Multi-Language VM&lt;/em&gt; (or just &lt;em&gt;mlvm&lt;/em&gt;). It is announced by John Rose, from Sun, on the &lt;a href=&#34;http://mail.openjdk.java.net/pipermail/announce/2007-October/000016.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;announcement list&lt;/a&gt;. The focus of the project will be to prototype JVM features beneficial for dynamic languages and remove &amp;ldquo;pain points&amp;rdquo; that current dynamic language developers have with standard JVM.&lt;/p&gt;&#xA;&lt;p&gt;Here&amp;rsquo;s the snippet from the announcement:&lt;/p&gt;&#xA;&lt;blockquote&gt;&lt;p&gt;This project will be open for prototyping JVM features aimed at efficiently supporting languages other than Java.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Scripting with Balance in Design and Performance</title>
      <link>/posts/2007-09-21-scripting-with-balance-in-design-and-performance/</link>
      <pubDate>Fri, 21 Sep 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-09-21-scripting-with-balance-in-design-and-performance/</guid>
      <description>&lt;p&gt;java.net has published an article titled &lt;a href=&#34;http://today.java.net/pub/a/today/2007/09/20/scripting-balance-design-performance.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Scripting with Balance in Design and Performance&lt;/a&gt;&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Scripting API for everyone</title>
      <link>/posts/2007-09-12-scripting-api-for-everyone/</link>
      <pubDate>Wed, 12 Sep 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-09-12-scripting-api-for-everyone/</guid>
      <description>&lt;p&gt;I definitely think that dynamic languages for Java platform is an &lt;a href=&#34;http://www.scriptinginjava.net&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;important topic&lt;/a&gt;. In that context, a &lt;a href=&#34;http://java.sun.com/javase/6/docs/technotes/guides/scripting/index.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Scripting API&lt;/a&gt; as a standardized scripting framework has its own role for Java developers. It is definitely a good thing it is included in JDK 6, but the lack of proper support for earlier JDK&amp;rsquo;s, in my opinion, slows down its wider adoption.&lt;/p&gt;&#xA;&lt;p&gt;Why is this important? On one side, there are developers that work on &amp;ldquo;in-house&amp;rdquo; applications and solutions. Although it may seem that JDK (or JRE) upgrade process in such environments is not a big deal, it is usually a process that is pretty inertial. Many arguments are used in discussions, from compatibility issues and testing needs to &amp;ldquo;don&amp;rsquo;t fix it if it ain&amp;rsquo;t broken&amp;rdquo;, but also the inertia factor could be often associated to plain laziness.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Daily Snapshots</title>
      <link>/posts/2007-07-27-daily-snapshots/</link>
      <pubDate>Fri, 27 Jul 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-07-27-daily-snapshots/</guid>
      <description>&lt;p&gt;From today on, continuous integration process is set up for JQR and daily snapshots are available in the &lt;a href=&#34;http://www.sensatic.org/mvn-snapshot/org/sensatic/jqr/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;repository&lt;/a&gt;.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Asynchronous job execution</title>
      <link>/posts/2007-07-18-asynchronous-job-execution/</link>
      <pubDate>Wed, 18 Jul 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-07-18-asynchronous-job-execution/</guid>
      <description>&lt;p&gt;In software development we are often encouraged to decouple things in order to achieve greater flexibility in our code. So we decouple model objects from views, interfaces from their implementation, etc.&lt;/p&gt;&#xA;&lt;p&gt;Here, I would like to write about different kind of decoupling, front-end from back-end. In many cases, projects tend to depend on resources that are either unreliable or overloaded. For example, besides your &amp;ldquo;main&amp;rdquo; database, you may need to write data to some LDAP server that is overloaded or you need to provide some data to the resources over the unreliable network connection. In most of these use cases, these operations are triggered by users through the user interface (web or stand-alone application). It is totally unnecessary (and usually unacceptable) to have your users wait a few minutes for operation to complete or in worse case to have dysfunctional system just because one resource is unavailable.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>JQR 1.2.0 released</title>
      <link>/posts/2007-06-29-jqr-120-released/</link>
      <pubDate>Fri, 29 Jun 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-06-29-jqr-120-released/</guid>
      <description>&lt;p&gt;Sensatic JQR 1.2.0 has been &lt;a href=&#34;http://www.sensatic.org/jqr/Download&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;released&lt;/a&gt;.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Eclipse Europa</title>
      <link>/posts/2007-06-15-eclipse-europa/</link>
      <pubDate>Fri, 15 Jun 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-06-15-eclipse-europa/</guid>
      <description>&lt;p&gt;On 29 June, Eclipse community will be richer for the new &lt;a href=&#34;http://www.eclipse.org/europa/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Europa release&lt;/a&gt;. It is a coordinate release of &lt;a href=&#34;http://www.eclipse.org/europa/projects.php&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;21 Eclipse Foundation projects&lt;/a&gt;. The main component of this release is certainly new 3.3 version of the &lt;a href=&#34;http://www.eclipse.org/platform/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Eclipse Platform&lt;/a&gt;. Others include prominent projects from domains of administration, modeling, development and tools, such as &lt;a href=&#34;http://www.eclipse.org/ecf/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Eclipse Communications Framework (ECF)&lt;/a&gt;, &lt;a href=&#34;http://www.eclipse.org/modeling/emf/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Eclipse Modeling Framework Project (EMF)&lt;/a&gt;, &lt;a href=&#34;http://www.eclipse.org/dltk/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Dynamic Languages Tool Kit (DLTK)&lt;/a&gt; and &lt;a href=&#34;http://www.eclipse.org/birt/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Business Intelligence Reporting Tools (BIRT)&lt;/a&gt;. This is definitely an important Eclipse release and a good news for all Eclipse users.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Integrating ActiveMQ Web Console</title>
      <link>/posts/2007-06-07-integrating-activemq-web-console/</link>
      <pubDate>Thu, 07 Jun 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-06-07-integrating-activemq-web-console/</guid>
      <description>&lt;p&gt;If you build an application that integrates &lt;a href=&#34;http://activemq.apache.org&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;ActiveMQ&lt;/a&gt; broker, it makes sense that you want to integrate its &lt;a href=&#34;http://activemq.apache.org/web-console.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;web console&lt;/a&gt; as well. It provides your users with basic monitoring and management operations. One road you can take is to integrate it as a WAR archive, but as you already have a whole lot of ActiveMQ integrated, you probably want to include just necessary subset of libraries and files and always have most up to date version of it.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>JQR 1.1.0 released</title>
      <link>/posts/2007-06-02-jqr-110-released/</link>
      <pubDate>Sat, 02 Jun 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-06-02-jqr-110-released/</guid>
      <description>&lt;p&gt;Sensatic JQR 1.1.0 has been &lt;a href=&#34;http://www.sensatic.org/jqr/Download&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;released&lt;/a&gt;.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>(Not yet)Commons SSL</title>
      <link>/posts/2007-05-30-not-yetcommons-ssl/</link>
      <pubDate>Wed, 30 May 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-05-30-not-yetcommons-ssl/</guid>
      <description>&lt;p&gt;If you ever tried to work with SSL Socket connections in Java, you probably know that Java, by default, supports its own JKS and PKCS12 certificate formats. For those who need to work with &lt;a href=&#34;http://www.openssl.org/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;OpenSSL&lt;/a&gt; it is usually suggested to convert keys and certificates to PKCS12 and then import them in the keystore using the &lt;code&gt;keytool&lt;/code&gt; command provided with the JDK.&lt;/p&gt;&#xA;&lt;p&gt;While all this is not a big deal for most of the applications, there should be a better solution for projects that rely heavily on SSL. &lt;a href=&#34;http://juliusdavies.ca/commons-ssl/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Not-yet-commons-ssl&lt;/a&gt; project, called liked this because it is still in the &lt;a href=&#34;http://wiki.apache.org/incubator/CommonsSSLProposal&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Apache incubation process&lt;/a&gt;, aims to simplify Java and SSL integration.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>XStream 1.2.2</title>
      <link>/posts/2007-05-25-xstream-122/</link>
      <pubDate>Fri, 25 May 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-05-25-xstream-122/</guid>
      <description>&lt;p&gt;XStream 1.2.2 is released with &lt;code&gt;JettisonMappedXmlDriver&lt;/code&gt; used for serialization and deserialization from JSON. It is the driver first presented in &lt;a href=&#34;http://www.oreillynet.com/onjava/blog/2007/01/java_and_json.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Java and JSON&lt;/a&gt; post. All modifications are submitted to Jettison and XStream projects respectfully and documented in an appropriate tutorial (&lt;a href=&#34;http://xstream.codehaus.org/json-tutorial.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;http://xstream.codehaus.org/json-tutorial.html&lt;/a&gt;). From now on, XStream has a full support for JSON serialization. Enjoy.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Can Servlet containers scale?</title>
      <link>/posts/2007-04-04-can-servlet-containers-scale/</link>
      <pubDate>Wed, 04 Apr 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-04-04-can-servlet-containers-scale/</guid>
      <description>&lt;p&gt;Filip Hanik of Covalent Technologies wrote an &lt;a href=&#34;http://blog.covalent.net/roller/covalent/entry/20070308&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;excellent article&lt;/a&gt; in which he describes his series of performance/scalability tests of the new NIO connector that has been added to Tomcat 6. In tests he also includes Jetty and Glassfish containers. The article contains very good explanation of challenges in adapting NIO environment to blocking IO requirements. The good news is that the answer to the question from the title is yes, servlet containers can scale, led by Tomcat 6 that handled 16000 concurrent connections without problems.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Velocity 1.5</title>
      <link>/posts/2007-03-21-velocity-15/</link>
      <pubDate>Wed, 21 Mar 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-03-21-velocity-15/</guid>
      <description>&lt;p&gt;As you all have probably heard, &lt;a href=&#34;http://velocity.apache.org/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Velocity&lt;/a&gt; 1.5 was released last week. It is the first release of this project in last three years. This is certainly a long release cycle and it is not unusual that some people considered it a &amp;ldquo;dead project&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;I have some projects that use Velocity as a template engine of choice and over the time I&amp;rsquo;ve collected a &amp;ldquo;wish list&amp;rdquo; of features that I missed. Due to lack of new releases, I&amp;rsquo;ve considered switching to other template engines, such as &lt;a href=&#34;http://freemarker.sourceforge.net/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;FreeMarker&lt;/a&gt; and &lt;a href=&#34;http://www.webmacro.org/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;WebMacro&lt;/a&gt;, but actually never found time to do that.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>New Date/Time and Rest APIs for Java</title>
      <link>/posts/2007-02-22-new-datetime-and-rest-apis-for-java/</link>
      <pubDate>Thu, 22 Feb 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-02-22-new-datetime-and-rest-apis-for-java/</guid>
      <description>&lt;p&gt;There has been some very interesting activity in JCP land lately, namely acceptance of new &lt;a href=&#34;http://jcp.org/en/jsr/detail?id=310&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Date and Time API&lt;/a&gt; (JSR 310) and proposal of the &lt;a href=&#34;http://jcp.org/en/jsr/detail?id=311&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;JavaTM API for RESTful Web Services&lt;/a&gt; (JSR 311).&lt;/p&gt;&#xA;&lt;p&gt;Usual first reactions to the JSR 310 that I saw on the web were &amp;ldquo;finally&amp;rdquo; or &amp;ldquo;too late&amp;rdquo;, but I think that &amp;ldquo;better late then never&amp;rdquo; should be applied in this case. People behind this specification are developers of &lt;a href=&#34;http://joda-time.sourceforge.net/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Joda time&lt;/a&gt; and this API will be heavily based on Joda time, which has been an excellent replacement for traditional Java date/calendar API (and must-have tool in your toolbox) for years. Beside the initial goal, to provide lightweight and simple API, one of the area of interest will be interoperability with JDBC. The general attitude toward this spec is maybe best described by the Google&amp;rsquo;s voting comment: &lt;em&gt;On 2007-01-30 Google Inc. voted Yes with the following comment: We are thrilled to see this happen!&lt;/em&gt; Hopefully, this specification will be included in Java 7.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Tuning Derby</title>
      <link>/posts/2007-01-31-tuning-derby/</link>
      <pubDate>Wed, 31 Jan 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-01-31-tuning-derby/</guid>
      <description>&lt;p&gt;OnJava has published an article titled &lt;a href=&#34;http://www.onjava.com/pub/a/onjava/2007/01/31/tuning-derby.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Tuning Derby&lt;/a&gt;&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Singletons and lazy loading</title>
      <link>/posts/2007-01-26-singletons-and-lazy-loading/</link>
      <pubDate>Fri, 26 Jan 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-01-26-singletons-and-lazy-loading/</guid>
      <description>&lt;p&gt;Probably the first design pattern that every software developer learns is Singleton and lazy loading of Singleton classes.&lt;/p&gt;&#xA;&lt;p&gt;The usual example, goes something like this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight-wrapper&#34;&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;public class Singleton {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; static Singleton instance;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  public static synchronized Singleton getInstance() {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    if (instance == null)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      instance == new Singleton();&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    return instance;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xA;&lt;p&gt;The problem with this solution is that synchronized method &lt;code&gt;getInstance()&lt;/code&gt; is called every time, while synchronization is actually needed only for the first call of the method (which introduces performance overhead in your application). There were attempts to tackle this problem by using Double-checked locking pattern, which although great in theory &lt;a href=&#34;http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;didn&amp;rsquo;t work in practice&lt;/a&gt;.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Java and JSON</title>
      <link>/posts/2007-01-12-java-and-json/</link>
      <pubDate>Fri, 12 Jan 2007 00:00:00 +0000</pubDate>
      
      <guid>/posts/2007-01-12-java-and-json/</guid>
      <description>&lt;p&gt;It seems that &lt;a href=&#34;http://ajaxian.com/archives/json-vs-xml-the-debate&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;JSON vs. XML&lt;/a&gt; debate was one of the hot topics for this winter. Again, I think that &amp;ldquo;vs.&amp;rdquo; part is sufficient and that both XML and JSON should have their place in overall technology landscape. One of the obvious JSON advantages is that it can be directly evaluated in JavaScript. And for the Ajax-world we live in, it is not a small thing.&lt;/p&gt;&#xA;&lt;p&gt;For one project, I started looking for a library that would enable me easy transformations between Java and JSON data. &lt;a href=&#34;http://www.json.org/java/index.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;JSON in Java&lt;/a&gt; looks nice, but what I really want is a more automated and configurable library like those we have for XML processing. My first thought was &lt;a href=&#34;http://xstream.codehaus.org/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;XStream&lt;/a&gt; since I like its simple API, extensible architecture, powerful converters and support for annotations. After first check I found that from version 1.2 on there is a partial support for JSON (which was logical thing to expect). So, currently you can serialize your Java objects to JSON format. Here&amp;rsquo;s a little example:&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Apache XML-RPC 3.0 - No thanks</title>
      <link>/posts/2006-12-01-apache-xml-rpc-30-no-thanks/</link>
      <pubDate>Fri, 01 Dec 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-12-01-apache-xml-rpc-30-no-thanks/</guid>
      <description>&lt;p&gt;I have this project that started years ago and still uses old Apache 1.1 version of the XML-RPC library. A few days ago I needed to add an extra functionality to the services it exposes. The underlying API for the new service works a lot with array of objects which is not friendly with that version of XML-RPC library.&lt;br&gt;&#xA;The thing is that up until version 3.x of Apache library, &lt;code&gt;Vector&lt;/code&gt; and &lt;code&gt;Hashtable&lt;/code&gt; were only Java classes that could be used for &lt;a href=&#34;http://ws.apache.org/xmlrpc/xmlrpc2/types.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;transferring collections&lt;/a&gt; (&lt;code&gt;&amp;lt;array&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;struct&amp;gt;&lt;/code&gt; XML-RPC types respectively). So naturally, I thought this was an ideal opportunity to upgrade to 3.x version, which is &lt;a href=&#34;http://ws.apache.org/xmlrpc/types.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;much better&lt;/a&gt; in handling various Java constructs (&lt;code&gt;Object[]&lt;/code&gt; among them) as XML-RPC types. This is where surprises started to pop up.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Playing with XFire</title>
      <link>/posts/2006-11-17-playing-with-xfire/</link>
      <pubDate>Fri, 17 Nov 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-11-17-playing-with-xfire/</guid>
      <description>&lt;p&gt;Every once in a while I get some WSDL file and a task to create a Java client (and a service for testing purposes) that will use a defined service. I&amp;rsquo;ve tried &lt;a href=&#34;http://xfire.codehaus.org&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;XFire&lt;/a&gt; a couple of times before (version was 1.1 in those days). But it never actually managed to create stub client and servers classes from &amp;ldquo;my&amp;rdquo; WSDL files. So, without much time left to investigate I usually decided to give it a bit more time and fallback to good old &lt;a href=&#34;http://ws.apache.org/axis/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Axis&lt;/a&gt;. But, a few weeks ago everything changed. I got a definition file and decided to try XFire again. This time I found an &lt;a href=&#34;http://xfire.codehaus.org/Eclipse&amp;#43;Plugin&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Eclipse plugin&lt;/a&gt; for it, which does exactly what I needed to do. It needs Java 5 and Eclipse 3.2 &amp;hellip; checked and checked &amp;hellip; I ran the wizard that plugin provides, entered some basic facts (location of the file, package and the location for the generated sources) and that was all. I was up and running in under five minutes. Excellent. But that is not the end of the story. The real surprise came when I browsed the generated code. It was much more &amp;ldquo;elegant&amp;rdquo; (readable) then equivalent Axis stub. With a heavy use of annotations it will be much easier to maintain in the coming years. Also, support for XBeans and Spring definitely makes my life much easier with XFire. I didn&amp;rsquo;t have time to verify whether it is &lt;a href=&#34;http://xfire.codehaus.org/Performance&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;as efficient as people say&lt;/a&gt;, but it doesn&amp;rsquo;t matter for me at this moment. And with all good coding that has been put into that project, I don&amp;rsquo;t see how it could be any different. So with all modern features, elegant stub classes and &amp;ldquo;probably&amp;rdquo; good performance, I think that I will stick to the XFire for my future SOAP coding.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Retrotranslator</title>
      <link>/posts/2006-11-02-retrotranslator/</link>
      <pubDate>Thu, 02 Nov 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-11-02-retrotranslator/</guid>
      <description>&lt;p&gt;Reading &lt;a href=&#34;http://java.sun.com/developer/technicalArticles/Interviews/elliott_qa.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;this interview&lt;/a&gt; with Jean Elliott, director of product marketing for the Java SE platform at Sun Microsystems, got me into thinking about adoption of Java platform editions among developers (and plain users). I think that 1.4 is still very widely deployed runtime environment out there and that it is the main reason why many developers still hesitate to use Java 5 syntax and features in their projects.&lt;/p&gt;&#xA;&lt;p&gt;There are three kinds of projects that we can differentiate:&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Spring and Flex</title>
      <link>/posts/2006-10-27-spring-and-flex/</link>
      <pubDate>Fri, 27 Oct 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-10-27-spring-and-flex/</guid>
      <description>&lt;p&gt;In &lt;a href=&#34;http://coenraets.org/flex-spring&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;this excellent article&lt;/a&gt; Christophe Coenraets gives few examples of how you can use &lt;a href=&#34;http://www.adobe.com/products/flex/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Adobe Flex&lt;/a&gt; as a presentation layer for your &lt;a href=&#34;http://www.springframework.org&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Spring&lt;/a&gt; applications.&lt;/p&gt;&#xA;&lt;p&gt;It is good to see that my Spring middle-layer classes could be reused with one more presentation technology. I like to have options.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Cross-Domain Ajax support for ActiveMQ</title>
      <link>/posts/2006-10-18-cross-domain-ajax-support-for-activemq/</link>
      <pubDate>Wed, 18 Oct 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-10-18-cross-domain-ajax-support-for-activemq/</guid>
      <description>&lt;p&gt;In this post I will try to summarize a case-study for implementing Cross-Domain Ajax support for ActiveMQ.&lt;/p&gt;&#xA;&#xA;&lt;h3 class=&#34;relative group&#34;&gt;Use Case&#xA;    &lt;div id=&#34;use-case&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#use-case&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h3&gt;&#xA;&lt;p&gt;In the current implementation of Ajax support for ActiveMQ, you can use JavaScript to consume and send messages, but only directly in your application. This stands mostly due to &amp;ldquo;same-domain&amp;rdquo; restriction of the &lt;code&gt;XmlHttpRequest&lt;/code&gt; calls.&lt;/p&gt;&#xA;&lt;p&gt;This makes impossible to use those messages in &amp;ldquo;trusted&amp;rdquo; applications and make them all use the same underlying mechanism. For example, you might want to create an embeddable Ajax message browser that could be used in various related applications to allow &amp;ldquo;operators&amp;rdquo; (non-technical people) to work with messages in certain queues and topics.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Jetty 6 and XBean</title>
      <link>/posts/2006-10-12-jetty-6-and-xbean/</link>
      <pubDate>Thu, 12 Oct 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-10-12-jetty-6-and-xbean/</guid>
      <description>&lt;p&gt;As you probably know, &lt;a href=&#34;http://jetty.mortbay.org/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Jetty&lt;/a&gt; is a web server (and servlet container) written purely in Java. Because it is small, fast and has a well designed configuration API it is often used as a embedded server in various Java applications (&lt;a href=&#34;http://maven.apache.org/continuum/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Continuum&lt;/a&gt;, &lt;a href=&#34;http://www.cenqua.com/fisheye/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;FishEye&lt;/a&gt;, …).&lt;/p&gt;&#xA;&lt;p&gt;Of course, when you use Jetty in a &lt;a href=&#34;http://www.springframework.org&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Spring&lt;/a&gt;-based application, you will want to configure it as you configure the rest of your application (as a Spring bean). Since it has a well defined configuration API, this is not a problem to achieve.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Multiple table generator in Hibernate3</title>
      <link>/posts/2006-09-26-multiple-table-generator-in-hibernate3/</link>
      <pubDate>Tue, 26 Sep 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-09-26-multiple-table-generator-in-hibernate3/</guid>
      <description>&lt;p&gt;Some time ago I needed a unique identifier generator that will look up a value in a simple name-value kind of database table. Project’s database layer was based on Hibernate2 and since I couldn’t find such a solution I have implemented a MultiTableGenerator which I have blogged about &lt;a href=&#34;http://www.oreillynet.com/onjava/blog/2004/06/hibernate_tablegenerator.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The project was finished and I moved on. Since then, many people reported that my solution was not compatible with Hibernate3 but unfortunately I never found time to fix it. Luckily, I was recently reported that Hibernate team introduced this functionality in Hibernate3. The class is called &lt;code&gt;org.hibernate.id.MultipleHiLoPerTableGenerator&lt;/code&gt;. As I can see, it is not documented in the latest version of the reference documentation yet, but you can find a description in a &lt;a href=&#34;http://www.hibernate.org/hib_docs/v3/api/org/hibernate/id/MultipleHiLoPerTableGenerator.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;JavaDoc documentation&lt;/a&gt;.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Stomp and JSON</title>
      <link>/posts/2006-09-18-stomp-and-json/</link>
      <pubDate>Mon, 18 Sep 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-09-18-stomp-and-json/</guid>
      <description>&lt;p&gt;As I said in the previous post, one of my main intentions is to use Stomp to send map messages from PHP to Java. So in &lt;a href=&#34;/download/stomp.zip&#34; &gt;this iteration&lt;/a&gt;, I have added support for JSON encoding/decoding of message content.&lt;/p&gt;&#xA;&lt;p&gt;Before I dig deeper into new functionalities and changes, let me explain which JSON libraries (PHP and Java) I have used and why.&lt;/p&gt;&#xA;&#xA;&lt;h3 class=&#34;relative group&#34;&gt;Dependencies&#xA;    &lt;div id=&#34;dependencies&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#dependencies&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h3&gt;&#xA;&lt;p&gt;Even though since version 5.2.0, &lt;a href=&#34;http://www.php.net/manual/en/ref.json.php&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;PHP has native support for JSON&lt;/a&gt;, I have used &lt;a href=&#34;http://mike.teczno.com/json.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;pure PHP&lt;/a&gt; implementation from Michal Migurski. I did this for only one reason: There is no any restriction to use it in PHP4.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>PHP Stomp client</title>
      <link>/posts/2006-09-14-php-stomp-client/</link>
      <pubDate>Thu, 14 Sep 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-09-14-php-stomp-client/</guid>
      <description>&lt;h3 class=&#34;relative group&#34;&gt;Download&#xA;    &lt;div id=&#34;download&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#download&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h3&gt;&#xA;&lt;p&gt;This work is based on Hiram Chirino&amp;rsquo;s excellent &lt;a href=&#34;http://stomp.codehaus.org/PHP&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;library&lt;/a&gt;. It would be great if this &amp;ldquo;extended&amp;rdquo; version become part of that project too, but for now you can grab it from &lt;a href=&#34;/download/stomp.zip&#34; &gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;While the original library is well written, there were few things that prevented me to use it in my project. I started by fixing those things, but then gone too far and now it is quite different from the original, so I&amp;rsquo;m putting it here.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Tomcat 5.x, Commons Logging and Log4J</title>
      <link>/posts/2006-08-29-tomcat-5x-commons-logging-and-log4j/</link>
      <pubDate>Tue, 29 Aug 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-08-29-tomcat-5x-commons-logging-and-log4j/</guid>
      <description>&lt;p&gt;First of all, I never use &lt;a href=&#34;http://jakarta.apache.org/commons/logging/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Jakarta Commons Logging&lt;/a&gt; (JCL) directly in my applications (&lt;a href=&#34;http://logging.apache.org/log4j/docs/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Log4J&lt;/a&gt; is my tool of choice for logging tasks), but as you probably know many frameworks and libraries do all of their logging through JCL. In most cases you will want to catch some of these log messages, so that you can better monitor your application. For example, you will probably want to log all SQL queries that Hibernate issues, at least in the early development phase, so that you can have a better perspective of what is going on.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Will we have closures in Java 1.7?</title>
      <link>/posts/2006-08-21-will-we-have-closures-in-java-17/</link>
      <pubDate>Mon, 21 Aug 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-08-21-will-we-have-closures-in-java-17/</guid>
      <description>&lt;p&gt;It seems like growing interest in dynamic languages will finally move Java syntax toward local functions and closures. Gilad Bracha, Neal Gafter, James Gosling and Peter von der Ah&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Java open-source roadmap</title>
      <link>/posts/2006-08-15-java-open-source-roadmap/</link>
      <pubDate>Tue, 15 Aug 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-08-15-java-open-source-roadmap/</guid>
      <description>&lt;p&gt;It&amp;rsquo;s finally here. According to &lt;a href=&#34;http://news.com.com/Sun&amp;#43;expands&amp;#43;open-source&amp;#43;Java&amp;#43;plan/2100-7252_3-6105601.html?tag=nefd.top&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;news&lt;/a&gt; and &lt;a href=&#34;http://blogs.zdnet.com/BTL/?p=3493&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;blogs&lt;/a&gt;, Sun announced that it will open source Java ME platform and some components of the SE platform by the end of the year. Sun plans to open source &lt;em&gt;javac&lt;/em&gt; compiler and &lt;em&gt;HotSpot&lt;/em&gt; virtual machine, two crucial components of the Java SE platform, by the end of the year. The rest of the SE platform should be open sourced during the next year.&lt;/p&gt;&#xA;&lt;p&gt;They will use some of the proven OSI licenses, but the particular license and governance model is yet to be settled. You can visit the &lt;a href=&#34;http://community.java.net/jdk/opensource/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;official site&lt;/a&gt; for this project and make your contribution to these discussions in the &lt;a href=&#34;http://forums.java.net/jive/forum.jspa?forumID=97&amp;amp;start=0&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;forum&lt;/a&gt;.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Handling ADO.NET DataSets with Axis</title>
      <link>/posts/2006-08-14-handling-adonet-datasets-with-axis/</link>
      <pubDate>Mon, 14 Aug 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-08-14-handling-adonet-datasets-with-axis/</guid>
      <description>&lt;p&gt;First of all, SOAP is not my web service protocol of choice since I think it is overkill for the most of applications. I prefer the simplest possible solution for the problem, but when the service that you need is only available through SOAP, you don&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>On Derby&amp;#8230;</title>
      <link>/posts/2006-07-27-on-derby/</link>
      <pubDate>Thu, 27 Jul 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-07-27-on-derby/</guid>
      <description>&lt;p&gt;There were a lot of discussions lately about inclusion of Derby (aka JavaDB) in the Sun JDK. First of all, I personally think that it will not really change anything.&lt;/p&gt;&#xA;&lt;p&gt;I&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Parsing form-data multiparts</title>
      <link>/posts/2006-06-28-parsing-form-data-multiparts-2/</link>
      <pubDate>Wed, 28 Jun 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-06-28-parsing-form-data-multiparts-2/</guid>
      <description>&lt;p&gt;If you ever needed to parse form-based multipart data, you are probably aware of the Jakarta Commons FileUpload library. But while this library is primarily intended to parse data directly from HttpRequest objects and thus handle uploading of files in your web application, it could be used to parse an arbitrary InputStream and extract multiparts from it too.&lt;/p&gt;&#xA;&lt;p&gt;As you can probably guess, the part of the library that is related to handling file uploads is well documented, but for the low-level API you can only find the broken example in the JavaDocs. I know that this funcionality is rarely needed, but still it deserves a working example, so here it is.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Syntax support for collections?</title>
      <link>/posts/2006-06-05-syntax-support-for-collections/</link>
      <pubDate>Mon, 05 Jun 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-06-05-syntax-support-for-collections/</guid>
      <description>&lt;p&gt;It is common to use &lt;code&gt;final static&lt;/code&gt; fields to define constants in your Java applications. For example, you will often find the code similar to this in various Java APIs&lt;/p&gt;&#xA;&lt;div class=&#34;highlight-wrapper&#34;&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;public class Example {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  public static int one = 1;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xA;&lt;p&gt;which is used in the following manner&lt;/p&gt;&#xA;&lt;div class=&#34;highlight-wrapper&#34;&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;System.out.println(Example.one);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xA;&lt;p&gt;Of course, Java supports more complex initialization of static properties through &lt;em&gt;static initializer blocks&lt;/em&gt;. One of the most common usages for these blocks is initialization of static collections with known values.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>XAP proposal in Apache incubator</title>
      <link>/posts/2006-05-26-xap-proposal-in-apache-incubator/</link>
      <pubDate>Fri, 26 May 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-05-26-xap-proposal-in-apache-incubator/</guid>
      <description>&lt;p&gt;There is an interesting Ajax-related proposal in &lt;a href=&#34;http://wiki.apache.org/incubator/XapProposal&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Apache incubator&lt;/a&gt;, named XAP (eXtensible Ajax Platform). It is a project donated by Nexaweb Technologies Inc and represents XML-based declarative framework for building rich internet applications based on Ajax. You can find more information about this project on &lt;a href=&#34;http://www.nexaweb.com/open/xap/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Nexaweb site&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;In the proposal there is the following paragraph:&lt;/p&gt;&#xA;&lt;blockquote&gt;&lt;p&gt;Although these toolkits ease development of Ajax-powered web applications, there are still significant development and maintenance challenges, mainly associated with writing, debugging and maintaining JavaScript code. In particular, some developers would prefer not to use JavaScript.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Spring MVC: Exposing cookies to the view</title>
      <link>/posts/2006-05-01-spring-mvc-exposing-cookies-to-the-view/</link>
      <pubDate>Mon, 01 May 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-05-01-spring-mvc-exposing-cookies-to-the-view/</guid>
      <description>&lt;p&gt;Recently I needed to display some information on the web page according to the value of a cookie. I think that this is one of the common web application functionalities that have been around for a decade. If you have ever used Spring MVC you know that view resolvers could be instructed to expose request and session attributes as view variables. It is done through the&lt;/p&gt;&#xA;&lt;div class=&#34;highlight-wrapper&#34;&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&amp;lt;property name=&amp;#34;exposeSessionAttributes&amp;#34;&amp;gt;&amp;lt;value&amp;gt;true&amp;lt;/value&amp;gt;&amp;lt;/property&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&amp;lt;property name=&amp;#34;exposeRequestAttributes&amp;#34;&amp;gt;&amp;lt;value&amp;gt;true&amp;lt;/value&amp;gt;&amp;lt;/property&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xA;&lt;p&gt;properties in the appropriate view resolver configuration. I wonder why there is no similar functionality for cookies, such as:&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>DWR 2.0</title>
      <link>/posts/2006-04-12-dwr-20/</link>
      <pubDate>Wed, 12 Apr 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-04-12-dwr-20/</guid>
      <description>&lt;p&gt;I just saw the &lt;a href=&#34;http://getahead.ltd.uk/dwr/changelog/dwr20m1&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;release note&lt;/a&gt; for DWR 2.0 milestone 1. It introduces many new features, but the most interesting is certainly &amp;ldquo;Reverse Ajax&amp;rdquo;, which allows Java code to asynchronously call JavaScript code in the browser.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve used DWR on few projects in the past and I find it to be a very good AJAX implementation for Java. Also, I can think of some very good use-cases for these new features, so I will certainly put my hands on this new release soon. How about you? What is your experience with DWR and what do you think of these new capabilities?&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Apache XML-RPC adapter continued</title>
      <link>/posts/2006-04-07-apache-xml-rpc-adapter-continued/</link>
      <pubDate>Fri, 07 Apr 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-04-07-apache-xml-rpc-adapter-continued/</guid>
      <description>&lt;p&gt;In the previous &lt;a href=&#34;http://www.oreillynet.com/onjava/blog/2006/03/apache_xmlrpc_adapter_for_spri.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;post&lt;/a&gt; I showed how you can make a Spring wrapper around the &lt;code&gt;WebServer&lt;/code&gt; object and thus configure it easily in Spring-based applications. This solution is good for standalone applications that use Spring as a configuration mechanism. But if you are using Spring MVC to develop web applications you probably don&amp;rsquo;t want to start another web server to handle XML-RPC calls. Instead, we have to find a way to configure XML-RPC to work with the web server that hosts our application and again to use our beans as XML-RPC handlers.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Advanced Configuration of the Spring MVC Framework</title>
      <link>/posts/2006-03-24-advanced-configuration-of-the-spring-mvc-framework/</link>
      <pubDate>Fri, 24 Mar 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-03-24-advanced-configuration-of-the-spring-mvc-framework/</guid>
      <description>&lt;p&gt;OnJava published an article titled &lt;a href=&#34;http://www.oreillynet.com/pub/a/onjava/2006/03/22/advanced-spring-configuration.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Advanced Configuration of the Spring MVC Framework&lt;/a&gt;&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Apache XML-RPC Adapter for Spring</title>
      <link>/posts/2006-03-20-apache-xml-rpc-adapter-for-spring/</link>
      <pubDate>Mon, 20 Mar 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-03-20-apache-xml-rpc-adapter-for-spring/</guid>
      <description>&lt;p&gt;I tend to use XML-RPC to implement simple requirements for connecting applications. The reason is that it is a simple, straighforward remote-procedure protocol that has good-enough performance for most of such applications. Also, it is very wide-spread so you can find a stable implementation for whatever platform you need it (for example you can use it to connect Java and PHP applications).&lt;/p&gt;&#xA;&lt;p&gt;When it comes to Java, I use the Apache XML-RPC library (&lt;a href=&#34;http://ws.apache.org/xmlrpc/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;http://ws.apache.org/xmlrpc/&lt;/a&gt;). Reasons: it&amp;rsquo;s been long time in development, it&amp;rsquo;s stable and I never had any problems with it.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Proper handling of database-related exceptions</title>
      <link>/posts/2006-03-10-proper-handling-of-database-related-exceptions/</link>
      <pubDate>Fri, 10 Mar 2006 00:00:00 +0000</pubDate>
      
      <guid>/posts/2006-03-10-proper-handling-of-database-related-exceptions/</guid>
      <description>&lt;p&gt;This is the issue that I keep running into on various projects, so even if it seems obvious I think it is worth spending a post on it.&lt;/p&gt;&#xA;&lt;p&gt;Some OR mapping frameworks tend to use batch update operations when dealing with the database. The &amp;ldquo;problem&amp;rdquo; that this approach introduces is that if any problem occurs during the update, a &lt;code&gt;java.sql.BatchUpdateException&lt;/code&gt; exception will be thrown instead of the regular &lt;code&gt;java.sql.SQLException&lt;/code&gt;. If we don&amp;rsquo;t handle &lt;code&gt;BatchUpdateException&lt;/code&gt; properly the message it will give us will not be very useful.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>SMS-Powered applications</title>
      <link>/posts/2004-06-09-sms-powered-applications/</link>
      <pubDate>Wed, 09 Jun 2004 00:00:00 +0000</pubDate>
      
      <guid>/posts/2004-06-09-sms-powered-applications/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://www.oreillynet.com/pub/a/onjava/2004/06/09/sms.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;onJava.com&lt;/a&gt; published an article on texting with Java&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Hibernate MulitpleTableGenerator</title>
      <link>/posts/2004-06-06-hibernate-mulitpletablegenerator/</link>
      <pubDate>Sun, 06 Jun 2004 00:00:00 +0000</pubDate>
      
      <guid>/posts/2004-06-06-hibernate-mulitpletablegenerator/</guid>
      <description>&lt;p&gt;This key generator is designed to enable &lt;a href=&#34;http://www.hibernate.org&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Hibernate&lt;/a&gt; to generate unique keys using the table structure like this one&lt;/p&gt;&#xA;&lt;p&gt;&lt;figure&gt;&lt;img&#xA;    class=&#34;my-0 rounded-md&#34;&#xA;    loading=&#34;lazy&#34;&#xA;    decoding=&#34;async&#34;&#xA;    fetchpriority=&#34;low&#34;&#xA;    alt=&#34;&#34;&#xA;    src=&#34;../Images/table.gif&#34;&#xA;    &gt;&lt;/figure&gt;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;The keys that you get from database can be used directly or with HiLo algorithm (use MultipleTableHiLoGenerator class in that case).&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Job Scheduling in Java</title>
      <link>/posts/2004-03-10-job-scheduling-in-java/</link>
      <pubDate>Wed, 10 Mar 2004 00:00:00 +0000</pubDate>
      
      <guid>/posts/2004-03-10-job-scheduling-in-java/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://www.onjava.com/pub/a/onjava/2004/03/10/quartz.html&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;onJava.com&lt;/a&gt; published article on job scheduling with Java and Quartz&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Quartz recent jobs patch</title>
      <link>/posts/2003-12-01-quartz-recent-jobs-patch-2/</link>
      <pubDate>Mon, 01 Dec 2003 00:00:00 +0000</pubDate>
      
      <guid>/posts/2003-12-01-quartz-recent-jobs-patch-2/</guid>
      <description>&lt;h4 class=&#34;relative group&#34;&gt;Introduction&#xA;    &lt;div id=&#34;introduction&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#introduction&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h4&gt;&#xA;&lt;p&gt;This patch is made for &lt;a href=&#34;http://www.quartzscheduler.org&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Quartz 1.2.3&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Java job scheduler and it extends original Scheduler interface with getExecutedJobs() method that returns list of recently executed jobs. Size of the list is configurabile with &lt;em&gt;org.quartz.scheduler.executedJobsListSize&lt;/em&gt; parameter in property file (quartz.properties). It could be also turned off by specifying value 0 or by deleteing this entry from the property file. This patch works even for volatile Jobs and Triggers and doesn&amp;rsquo;t use database.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Quartz recent jobs patch</title>
      <link>/posts/2003-12-01-quartz-recent-jobs-patch/</link>
      <pubDate>Mon, 01 Dec 2003 00:00:00 +0000</pubDate>
      
      <guid>/posts/2003-12-01-quartz-recent-jobs-patch/</guid>
      <description>&lt;p&gt;This patch is made for &lt;a href=&#34;http://www.quartzscheduler.org&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Quartz 1.2.3&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Java job scheduler and it extends original Scheduler interface with getExecutedJobs() method that returns list of recently executed jobs. Size of the list is configurabile with &lt;em&gt;org.quartz.scheduler.executedJobsListSize&lt;/em&gt; parameter in property file (quartz.properties). It could be also turned off by specifying value 0 or by deleteing this entry from the property file. This patch works even for volatile Jobs and Triggers and doesn&amp;rsquo;t use database.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Introduction to Version Control with CVS</title>
      <link>/posts/2003-11-12-introduction-to-version-control-with-cvs/</link>
      <pubDate>Wed, 12 Nov 2003 00:00:00 +0000</pubDate>
      
      <guid>/posts/2003-11-12-introduction-to-version-control-with-cvs/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://www.phparchitect.com/issue.php?mid=18&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;php|architect&lt;/a&gt; published introductory article on version control with CVS&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Quartz XML-RPC plugin</title>
      <link>/posts/2003-11-01-quartz-xml-rpc-plugin/</link>
      <pubDate>Sat, 01 Nov 2003 00:00:00 +0000</pubDate>
      
      <guid>/posts/2003-11-01-quartz-xml-rpc-plugin/</guid>
      <description>&lt;p&gt;Quartz is a powerful job scheduling system for Java. Here you can find a XML-RPC plugin that can enable you to use the Quartz as a web service using XML-RPC protocol. You can use this plugin for accessing Quartz API from other languages than Java, such as PHP for example. Also, you can use it from your distributed Java application if you find this way more appropriate than RMI.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Introduction to Bug Management</title>
      <link>/posts/2003-09-08-introduction-to-bug-management/</link>
      <pubDate>Mon, 08 Sep 2003 00:00:00 +0000</pubDate>
      
      <guid>/posts/2003-09-08-introduction-to-bug-management/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://www.phparch.com/issue.php?mid=14&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;php|architect&lt;/a&gt; published introductory article on Bug management&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Scripting the enterprise</title>
      <link>/posts/2003-07-08-scripting-the-enterprise/</link>
      <pubDate>Tue, 08 Jul 2003 00:00:00 +0000</pubDate>
      
      <guid>/posts/2003-07-08-scripting-the-enterprise/</guid>
      <description>&lt;h4 class=&#34;relative group&#34;&gt;In the beginning &amp;hellip;&#xA;    &lt;div id=&#34;in-the-beginning-&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#in-the-beginning-&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h4&gt;&#xA;&lt;p&gt;PHP was designed as scripting language used to develop Web based applications. Because of its flexibility, extensibility and ease of use it became widely popular among developers, and pretty fast the large community was created. As time was passing, people wanted to develop more complex applications with it, but PHP was designed for page centric architecture with very limited support for object-oriented programming. Also, there was no system support for transactions, caching, software components and all the other things that developers of the enterprise applications have used to have. There was no application container that would take care of all the system staff that we need in our applications, so that we can focus on business requirements. As applications are getting larger and more complex scalability becomes a new issue. PHP does not scale well and there is no easy and standard way to make a cluster to achieve better scalability. So, PHP applications (with respectable exceptions) were left in the area of small and middle complex web applications.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Arno</title>
      <link>/posts/2003-06-05-arno/</link>
      <pubDate>Thu, 05 Jun 2003 00:00:00 +0000</pubDate>
      
      <guid>/posts/2003-06-05-arno/</guid>
      <description>&lt;h4 class=&#34;relative group&#34;&gt;Introduction&#xA;    &lt;div id=&#34;introduction&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#introduction&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h4&gt;&#xA;&lt;p&gt;This is version 0.1 of small application that demonstrates how to use EJB technology and &lt;a href=&#34;http://jakarta.apache.org/struts/&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;Struts&lt;/a&gt; web development framework together. It is a personal organizer that let&amp;rsquo;s its users to manage their tasks and events. Don&amp;rsquo;t expect high usability of this software (in some future versions it will be considered) because it is only ment to be a demo.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>Apache XMLRPC 1.1 authentication patch</title>
      <link>/posts/2002-12-31-apache-xmlrpc-11-authentication-patch/</link>
      <pubDate>Tue, 31 Dec 2002 00:00:00 +0000</pubDate>
      
      <guid>/posts/2002-12-31-apache-xmlrpc-11-authentication-patch/</guid>
      <description>&lt;p&gt;When you are using XML RPC, you often want to have some security mechanism that will protect your system from malicious users.&lt;/p&gt;&#xA;&lt;p&gt;One mechanism that could be used is basic HTTP authorization. When this approach is used username and password from the client are sent as a plain text in the HTTP header of the request. If authorization is valid, server will process the request or send response with status code 401 which means that client has not been successfully authorized. You may argue that plain text as a transport is not secure enough, but you can always use this mechanism with SSL what will give you more secure system.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>PHP Iterator</title>
      <link>/posts/2002-11-11-php-iterator/</link>
      <pubDate>Mon, 11 Nov 2002 00:00:00 +0000</pubDate>
      
      <guid>/posts/2002-11-11-php-iterator/</guid>
      <description>&lt;p&gt;PHP arrays are generally very powerful object container. But still, we can easily add a little more fuel to them. Imagine Iterator object that is a kind of wrapper around our arrays. What we will try to accomplish here is to create unique interface for traversing arrays and to add a little more control over how our objects are created and finally, to support lazy loading.&lt;/p&gt;</description>
      
    </item>
    
  </channel>
</rss>
