Freitag, 19. Dezember 2008

it-rockstars became appfuse consulting provider

IT-Rockstars, the experts for project skeleton, project kick start and agile development became appfuse consulting provider.

Peter and Josip send greetings to Matt Raible :-) See you next Oktoberfest.

Mittwoch, 3. Dezember 2008

Annotation-driven transactions

Instead of programmatically implementing code or configuring Spring applicaton context xml files to manage transactions, it can simply be done by using Spring's transaction annotations. There's really not much to it. All you need to do is add the following to your Spring context:

<tx:annotation-driven />

Additionally ensure that the tx namespace is defined as per the xsi:schemaLocation

<beans xmlns="" xmlns:xsi="" xmlns:aop="" xmlns:tx="" xmlns:context=""
default-lazy-init="true" />

And now to the fun part! Add annotations to your code. I prefer to apply annotations to interfaces. That way all implementations of the interface are transactional.

...and Bob's your uncle!

New IT-Rockstars Website online

The IT-Rockstars Website has been redesigned and is now reachable at:
Check it out if you are interested in consulting services around agile, test-driven development in JAVA or .NET!

Dienstag, 25. November 2008

Spring: Get Classpath Resources with Wildcards

With Spring's Resource abstraction it is easy to load resources from the classpath, but what if you need to load many files that follow a certain naming pattern? The following code accomplishes that with the, it supports the same wildcards in the URL like the ApplicationContextLoader:

PathMatchingResourcePatternResolver patternResolver = new PathMatchingResourcePatternResolver();
Resource[] resources = patternResolver.getResources("classpath:/conf/aggregations/*_agg.xml");