Welcome to another installment of This Week in Spring! This roundup is put together by aggregating lots of great content from all around the web. If you have content suggestions, or if you simply want a direct line to some of the content that we post, check us out on Twitter, and Google+. As usual, we've got a lot to go over, so let's dive into it.
- Up first this week, there is a lot of new content available on the SpringSource Dev YouTube channel. The video from Spring Data Neo4J lead Michael Hunger's excellent webinar introducing Spring Data Neo4j is also available. The video from VMWare engineer Jerry Kuch's webinar providing an update on the new features in RabbitMQ is also available. Finally, the video from the webinar that Ken Rimple, Srini Penchikala, and I did introducing how to more fully exploit Spring Roo's interactive add-on mechanism is available.
- Spring Security OAuth lead Dr. David Syer has announced that Spring Security OAuth 1.0.0.RC2 is now available.
- Remember our pal Tobias Trelle? He's got another fantastic article that's been published on InfoQ called Spring Data - One API to Rule Them All?
- Stephen Chin, the Oracle JavaFX evangelist, has posted an initial blog and a slide deck on the work he's done to integrate Spring and Java FX based on a talk he's done at the Dallas Spring User Group. Nice work, Stephen! I'm looking forward to the subsequent blog posts he's promised us!
- Zemian Deng has a nice post on how to use the TimeMachine scheduler with Spring.
- The Java Code Geeks blog is at it again, this time with a post on how to measure the execution time of a method call using the Spring StopWatch class. Note that this sort of code is ideal for delivery as a AOP Aspect.
- René van Wijk has a nice post on how to integrate Spring's Hibernate support with the JBoss AS 7-specific integration for Hibernate.
- This blog looks at how to use the
HibernateTemplateto work with Hibernate's lazy initialization feature. It's a nice post, but it's worth mentioning that the
HibernateTemplate's no longer the preferred way of working with Hibernate. Instead, simply create a
HibernateTransactionManagerinstance, and build a
LocalSessionFactoryBean(available for both Hibernate 3 and Hibernate 4) and then you're done. For a good example, check out this sample application which demonstrates Hibernate 4. You can use the Hibernate thread-local session API (which has been available since later iterations of Hibernate 3.x). To specifically handle lazy initialization, look at
- Spring's configuration support is very rich, and handily supports declaring many convenience objects. This blog introduces how to configure lists and maps using the Spring XML namespace support. Convenient!
- The Pables64 blog has a nice post on how to use the SpringSource Tool Suite Spring MVC template to build a Spring MVC-based web application in no time flat.
- This post enumerates some of the open source projects that themselves embed or rely on the Spring framework. This list is by no means comprehensive, but it is very interesting!
- Blogger zws1987211 has an interesting post on how to use Spring with ActiveMQ. A lot of the confusion comes from reading the ActiveMQ documentation and articles. Using Spring with JMS (and ActiveMQ in particular) is quite straight forward.
JmsTemplatemakes it quite simple to
receivemessages using JMS. If you want to asynchronously receive messages, then you should consider the
MessageListenerContainerimplementations. If you're going to use
JmsTemplateto receive messages outside of a Java EE application server (which typically provide connection factory pooling), consider using the
CachingConnectionFactoryimplementations to wrap the raw JMS connection factories. By default the
JmsTemplatehandles all the tedious resource acquisition and destruction logic involved in working with the JMS API. This includes shutting down connection factories and sessions, which can be expensive if the resources are actually closed, and not simply returned to a pool where they're subsequently reused. You know what I love the most about this post, though? Not only does the post articulate the correct strategies for working with Spring, but the blogger even went to the Apache Wiki's and corrected them where appropriate! Nice job, great post, and even greater initiative!
- Boris Lam has a nice post on using the Spring Expression language for convenient, annotation-driven security constraint declarations in Spring Security. Nice job!
- Blogger Brian has an introduction to building RESTful web services with Spring MVC. The post introduces how Spring's REST support builds on top of core Spring MVC.