Event Programming with Google Guava EventBus

Tweet It’s a given in any software application there are objects that need to share information in order to get work done. In Java applications, one way of achieving information sharing is to have event listeners, whose sole purpose is to take some action when a desired event occurs. For the most part this process [...]

Guava Functions & Java 8 Lambdas

Tweet I recently read Brian Goetz’s The State of the Lambda and after reading that article I wanted to try using Java 8 lambda expressions. In his article, Brian goes on to describe interfaces that have one method as “functional” interfaces. Functional interfaces are almost always used as anonymous classes, with the ActionListener being the [...]

Google Guava Cache

Tweet This Post is a continuation of my series on Google Guava, this time covering Guava Cache. Guava Cache offers more flexibility and power than either a HashMap or ConcurrentHashMap, but is not as heavy as using EHCache or Memcached (or robust for that matter, as Guava Cache operates solely in memory). The Cache interface [...]

Google Guava – Futures

Tweet This post is a continuation of my series on Google Guava, this time covering Futures. The Futures class is a collection of static utility methods for working with the Future/ListenableFuture interface. A Future is a handle to an asynchronous task, either a Runnable or Callable, that was submitted to an ExecutorService. The Future interface [...]

Google Guava Concurrency – ListenableFuture

Tweet In my last post I covered using the Monitor class from the com.google.common.util.concurrent package in the Guava Library. In this post I am going to continue my coverage of Guava concurrency utilities and discuss the ListenableFuture interface. A ListenableFuture extends the Future interface from the java.util.concurrent package, by adding a method that accepts a [...]

Google Guava – Synchronization with Monitor

Tweet The Google Guava project is a collection of libraries that every Java developer should become familiar with. The Guava libraries cover I/O, collections, string manipulation, and concurrency just to name a few. In this post I am going to cover the Monitor class. Monitor is a synchronization construct that can be used anywhere you [...]

Lucene Thrift and Ruby

Tweet This post is going to demonstrate thrift usage by searching a Lucene index from Ruby. Thrift In a Nutshell Essentially thrift is a serialization and RPC framework that allows you to communicate between programs that are not necessarily written in the same language. Thrift is used by defining data types and services in a [...]

JEE 6 and Spring MVC

Tweet With the release of JEE 6 and the Servlet 3.0 specification came support for asynchronous servlets. While continuations and Comet are not new, the fact that it is now part of the servlet specification, and could be “baked in” to an application, piqued my curiosity. Although I have not used plain servlets in development [...]

Learning ANTLR part I

Tweet This year one of my goals is to try and become proficient in using ANTLR. I think that learning to translate text or build an external DSL is skill that, although not used everyday, will be very useful to know. For my first attempt I settled on something fairly easy, a SQL like grammar [...]