Useful Bash snippets(Public)— Having to work on different Linux boxes that are locked down and often lack common utilities, I like to keep around a few snippets for inclusion in .bashrc or .bash_profile. E.g., here are a couple, to make searching easier and to convert DOS-formatted files when the dos2unix binary is missing. Labels: technical, linux, bash, shell-scripting
jmock me(Public)— In hindsight, it seems like a particularly painful experience. Whenever I would need to mock or stub out an interface, I would do it myself. Either using dynamic proxies or an anonymous inner class in the form of Labels: spring, testing, java, technical
Bean startup using Lifecycle(Public)— Working with Spring, I have noticed that developers have a hard time creating and starting a container correctly. Often, the startup class will consist of a ClassPathXmlApplicationContext with a base context file to digest. The problem lies in the fact that most do not pay attention to the Lifecycle interface, and proceed to mix initialization and on-start behavior using either the InitializingBean or the explicitly declared init-method. Labels: technical, java, spring, jms
Using ActiveMQ with embedded broker for JMS testing(Public)— When unit testing code with JMS you'll typically want to avoid the overhead of running separate proceses; plus you'll want to increase startup time as fast as possible as you tend to run unit tests often and want immediate feedback. Labels: activemq, jms, testing
Injecting objects, not object factories(Public)— While I'm not certain since when Spring has supported the factory-method, its certainly present in version 2.5. Its a handy way to inject the desired class as opposed to the factory managing it into the target class. Labels: spring, java, technical
Using Saxons S9API Interface(Public)— Saxon is an integrated XML processor that offers tree based XML representation, schema validation, XPath and XQuery evaluation and XSLT processing. Its new s9api interface provides simple, integrated access to all Saxon's XML processing capabilities in a uniform way, taking advantage of the type safety offered by generics in Java 5. Labels: xml, xpath, saxon, xquery
MarkLogic Training(Public)— MarkLogic is an industry leading XML Server, designed and optimized for XML content. It provides capabilities to store, manage, enrich, search, navigate, and dynamically deliver content. We recently had the opportunity to attend a 3-day basic training on MarkLogic. Labels: marklogic, xpath, xquery, xml
Thread Death & UncaughtExceptionHandler(Public)— While working on the previous post, I came across an interesting issue. How to propagate exceptions across thread boundaries? In the first iteration, I called the custom runnable's template method to rethrow the exception. The downside was that the logic was rerun in entirety. Tinkering with the code to improve the responsibilities, the test cases started to fail as the AssertionError was being swallowed. Labels: technical, java
Unpacking Resources for Program Execution in Maven(Public)— While using Maven, its often necessary to unpack dependencies in order to execute a program or to run some test cases. Typically its because some resource or data files needs to be extracted to the file system. Labels: maven
Accessing Bean Properties in Drools(Public)— In Drools, the data against which rules are evaluated are Java Beans instances. The Rule Language syntax allows you to access properties of these beans while declaring rule conditions in the rule file (drl file). Labels: drools
Ideal Domain Object Model in Drools(Public)— The Drools Rule Language allows you to access nested properties directly while declaring rule conditions in the rule file (drl file). However, there are few things about nested properties and domain object model that Drools developer should understand. Labels: drools
Document Object Models for XML(Public)— There are several competing document object models that can be used in order to load XML into memory. These include W3C standardized DOM, JDOM, dom4j, XOM and Saxon XDM. Labels: xml, dom, jdom, dom4j, xom, saxon
Aggregating and Viewing multiple service logs(Public)— Most developers quickly realize that the ability to look and query a central log file that contains log errors from all system services is of great help in debugging and tracing how requests get handled. So is a Graphical UI tool that displays log events. This can all be achieved using Apache Log4j framework and companion application Chainsaw. Labels: log4j, chainsaw, technical