geeky · java

Java concurrency – Multiple queue monitors

At work, I’ve implemented a queue monitor batch application. Due to business rule changes, it now needs to monitor two queues. Instead of creating another batch application, I really wanted to stick with the same application but just create two threads, each monitoring its own queue. However, the twist I need is to have the… Continue reading Java concurrency – Multiple queue monitors

geeky · java · rants

Grails: I will not use you

After the cijug presentation on Grails, I’ve decided I will not use it. I know Grails is hot and cool but I don’t like it. It’s probably just a personal preference. Why don’t I want to use Grails It’s built on spring and hibernate, so why not just use them directly? It’s just adding another… Continue reading Grails: I will not use you

geeky · java

Dynamically invoke methods using spring config

A business rule at work requires some flexible configurations. I attempted to fulfill the need by create different spring batch steps/tasklets to execute each requirement based on a property value. For example, step 1 will need to execute methodOne on the class Repository with the appropriate parameters. The method signature & parameters are determined by… Continue reading Dynamically invoke methods using spring config

geeky · non php code

itext page number (page x of y)

I was looking for a complete example of how to dynamically generate the page numbers when you create the pdf using iText and I couldn’t find one. This is based on the example in the iText in Action book but I added my “refactoring” if you will. I hope this helps someone. If not, it… Continue reading itext page number (page x of y)

geeky · non php code

Java instaniate an abstract class… sort of…

At work I had to create some test data for a junit test. The function I’m testing expects a super abstract class to be passed in and I need to test the same function for bunch of child classes. I wish I could just pass in the parent class but since it’s abstract I cannot… Continue reading Java instaniate an abstract class… sort of…

geeky

Java: BETTER way to traverse a map

While reviewing the findbugs report (WMI_WRONG_MAP_ITERATOR) for a new project at work, I learned a better way to traverse a map in Java. In fact, since the first day I started coding in Java, I never thought twice about how to traverse a map. You always traverse the keys and use the key to get… Continue reading Java: BETTER way to traverse a map