Posted by: pureessence on: June 25, 2011
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 [...]
Posted by: pureessence on: June 8, 2011
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 [...]
Posted by: pureessence on: March 25, 2011
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 [...]
Posted by: pureessence on: November 14, 2010
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 [...]
Posted by: pureessence on: August 27, 2010
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 [...]
Posted by: pureessence on: August 25, 2010
Not really a new trick but I had to look for the syntax today to use reflection to set a private property on an object to use it in a junit test.
Posted by: pureessence on: March 12, 2010
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 [...]
Posted by: pureessence on: December 11, 2008
Eclipse has a scrapbook function that allows you to run Java code on the fly. Sometimes you just want to test out a simple piece of code without having to create another Java class, execute it in the main method or create a junit to test it out. For example, today I wanted to make [...]
SocialVibe