Category Archives: Java Today let us talk about blasphemy. Direct data inserts into databases, listening for messages on message queues, Streaming data between random sockets over custom protocols. None of this is blasphemy. However coded in an HTML page and run on a browser it is nothing less than the demonstration of darkest of dark arts. And Read More →

It is not easy, intutive or natively supported on Jboss AS 5.1 to deploy a Seam 2.2 component as a Singleton with CLUSTER scope. This requirement was an absolute must for us to ensure that a job scheduler runs on only one node in a cluster. Multiple instances of this CRON like scheduler would introduce Read More →

The parts of this post discussing Lambda expressions might not be exact to the current specification syntax under discussion.  Neither are these featured present in currently released JDKs (upto JDK7).  So it is not compilable.  Look at it only as pseudo code to discuss general notions around Lambda expressions in Java. One of the key feature Read More →

Source code discussed in this post can be freely downloaded and used in whatever way or form you want.  SVN URL is, svn checkout parallelly-read-only JDK7 provides a library solution through java.nio.file.WatchService  to the classic folder watching dilemma Java developers went through for a decade.  It defines an interface closely matching the Observable.  JDK7 also provides concrete Read More →

Source code discussed in this post can be freely downloaded and used in whatever way or form you want.  SVN URL is, svn checkout parallelly-read-only I put together couple of classes to ease testing pieces of code under concurrency load.  It is generic enough and accommodates a certain level of flexibility.  It is reusable for your specific purpose Read More →

The Ejb spec has discouraged programmers from spawning threads within session beans for a decade now.  So far, I remained a good citizen abiding by the rule – whenever needed parallelism from session beans the design would incorporate a queue backed by a message driven bean.  Thus my beans went on pleasing the JEE container. Read More →

Source code available @ svn checkout properties-dynaload Browse Source code here I have written a tool to automatically reload a property file on file change. This tool came very handy when implementing stand alone server applications that cannot resort to a server restart for refreshing properties. The class itself is a simple construct that Read More →

Some lessons are learnt the hard way.  A datamanagement library (abstracting Jackrabbit-JCR) I designed a few months back showed tremendous weakness while handling large concurrency.  My first instinct was to run for cover and make all access methods synchronized.  Since the framework was a spring managed setup (some keys beans were singleton), the synchronization short Read More →

This weekend I took some baby steps in scala.  The [ultimate] target is to learn scala and to build a cool folder synchronizer in scala that will work fast and furious in keeping remote folders in synch. code svn checkout foldersync From what I understod so far, scala is an excellent language improvement over Read More →

I am a heavy user of test driven development and the practice has paid off very well over the last few years in two important fronts. A great reduction in bugs Absolute confidence while undertaking changes to existing code base A recent discussion at a team meeting prompted me to start thinking in an interesting Read More →

Post Navigation