This Week in Spring - 27 November, 2012

Engineering | Josh Long | November 28, 2012 | ...

Welcome back to another installment of This Week in Spring! If you're in the states, then I hope you're well rested from a hopefully very pleasant holiday weekend, because we've got a lot to cover this week!

I hope you find this roundup useful. If you should ever want to peruse previous weeks' roundups, we've recently created a This Week in Spring hash tag for the blog archives.

Anyway, we've got a lot to cover this week, so let's get on with it!

  1. Chris Beams has announced that the Spring Framework 3.2 RC2 has been released, consisting largely of bugfixes and refactoring as the project nears GA.
  2. Andy Wilkinson has announced the release and availability of the Spring Migration Analyzer, a command-line utility that analyzes enterprise Java applications and produces a report describing the application and how it can be migrated to Spring. Input an EAR file, get a migration effort report. It supports WebLogic, WebSphere, Java EE and JBoss in the milestone release, but we are looking for community support to make it better for GA!
  3. Catch the latest in the Spring Data webinar series on Dec 13th -- Data Access and Processing with Spring Data, Hadoop, Batch, Integration. We are also have a webinar on Spring Data Gemfire on Dec 6th: The Data Renaissance: Going in-Memory with VMWare vFabric GemFire 7.0 and Spring.
  4. If you have missed the other webinars in the Spring Data Webinar series, check out the SpringSource Dev Youtube channel for recently published replays on: Data Access with Spring -- Getting the most out of JPA, JDBC and REST and Introducing Spring for Apache Hadoop.
  5. Gary Russell has announced that Spring Integration 2.2.0.RC3 has been released.
  6. Spring Social 1.1.0 has been released. The new release includes easier XML and Java configuration, tighter adherence to the latest OAuth 2 specification drafts, including HTTP Basic client authentication and support for Resource Owner Credentials Grant and Client Credentials Grant, and updates to the Facebook and Twitter API bindings.
  7. Jens Schauder has a nice post on creating new Spring beans on demand using the singleton scope.
  8. The Java How to Program blog has a nice roundup on
      <a href="http://www.hubberspot.com/2012/10/how-to-use-component-annotation-for.html">How to use <CODE>@Component</CODE> 
      annotation to automatically configure Spring beans</a>.
    
  9. This is a nice post on how to implement the chain-of-responsibility pattern using Spring and @Autowired (or alternatively @Inject).
  10. Viral Patel's back at it again, this time with a post on Spring 3 MVC interceptors.
  11. The Mkyong blog has another nice post up on Spring and Java threading example using the Spring thread scope.
  12. DZone has a nice post up on easy integration testing with Spring and the JUnit 4 support.
  13. I recently wrote up a version of a tutorial on getting started with SpringSource Tool Suite and Spring for beginners.

Introducing Spring Migration Analyzer

Engineering | Andy Wilkinson | November 27, 2012 | ...

It's my pleasure to announce that we've released the first milestone of Spring Migration Analyzer (SMA), a command-line utility that analyzes enterprise Java applications and produces a report describing the application and how it can be migrated to Spring.

Why migrate an application to Spring?

We see two main reasons when people choose to use Spring. Firstly, Spring offers the greatest range of deployment options including cloud and PaaS, allowing you to deploy your application to lighter-weight runtimes with lower operating costs. Secondly, as Adrian recently explained Spring provides access to a host of technologies that are at the forefront of enterprise Java.

When it comes to considering the migration of an existing application to Spring, it's typically the deployment flexibility that motivates the move as it can significantly reduce the application's operating costs.

Using SMA to analyze an application

To get started with SMA, download the distribution. Once it's downloaded, unzip it:
unzip spring-migration-analyzer-1.0.0.M1-dist.zip

With JAVA_HOME set, you can then run the migration-analysis script to…

Dependency analysis in Scripted

Engineering | Kris De Volder | November 20, 2012 | ...

Scripted, a JavaScript editor from VMWare was announced on this blog last month. In this article we'll take a look under the hood at Scripted's Dependency Analysis Engine. But before diving into the details, lets motivate why we need it.

Main Motivation: Cross-file Content Assist

To provide a great JavaScript editing experience, Scripted needs to provide accurate suggestions about the functions, methods or identifiers you can use in your current editor context.

[caption id="attachment_12178" align="aligncenter" width="533" caption="Cross-file Content Assist"][/caption]

Two components work together to achieve this goal:

  • a fine-grained type inference analysis engine
  • a coarse-grained dependency analysis engine
The inference engine parses your code and walks every declaration, statement and expression. This allows it to determine what identifiers are valid in a given context, and make good guesses about the kinds of things that may be stored in these variables. This information is then used to make content assist suggestions.

If you wanted to simply put all your code into one big file, then a good quality inferencer alone would be sufficient to provide some pretty good content assist. In reality, projects will be divided…

This Week in Spring - 20 November, 2012

Engineering | Josh Long | November 20, 2012 | ...

Wow! Guys, can you believe we are again staring down the end of the year? Time sure flies! In the US, this is the week of Thanksgiving, a holiday where we're supposed to take a moment and reflect upon the things for which we're grateful. I am (and I'm sure I speak for the team in saying that we are..) eternally grateful for you guys, the wonderful, vibrant and engaging community surrounding Spring, RabbitMQ and Cloud Foundry that makes putting together this roundup such a pleasure every week.

With that, let's get on with the news:

  1. Thomas Risberg has announced that the Cloud Foundry Maven plugin 1.0.0.M4 is now available.
    </Li>
     <LI>Did you miss out at <A href="http://springone2gx.com/conference/washington/2012/10/home">SpringOneOne2GX 2012  in Washington D.C.</a>?  Don't fret. We'll release 2 sessions every week on <a href="http://www.springsource.org/SpringOne2012Recordings">springsource.org</a>. We've already released Day 1 and 2 Keynotes. Available now:  a talk from Rossen Stoyanchev on "What's New in Spring Mvc 3.2" and a talk from Roy Clarkson and Craig Walls on "Extending Spring Mvc With Spring Mobile and Javascript."
    	Awesome. 
    	
    	</li>
    <LI> Our friend Tobias Trelle is at it again! This week, he's   <A…

This Week in Spring - 13 November, 2012

Engineering | Josh Long | November 14, 2012 | ...

Welcome back to another installment of This Week in Spring! I started this week back in the lovely Sofia, Bulgaria for the Cloud Foundry Open Tour event, talking to a packed audience about building Spring applications on Cloud Foundry. Now, I'm in Antwerp, Belgium, at the Devoxx conference where I'll present on what's new in Spring 3.2, Cloud Foundry and more. If you're here, I invite you to come visit the SpringSource booth and see some of the talks on Spring that I - and others - will be giving.

  1. 		Roy Clarkson has announced not one, but two releases of Spring  Mobile this week! 
    

    Spring Android 1.0.1 has been released. This release includes a change to support BlackBerry 10 mobile devices. BlackBerry 10 mobile devices are now resolved as a mobile device when using the LiteDeviceResolver. Then, he released the
    1.1.0.M1 release, which folds in the 1.0.1 support as well as tablet support in site preference handling and site switching, support for Java-based container configuration, and support for servlet based configurations.

  2. Thomas Risberg has announced the GA release of Spring Data JDBC extensions with QueryDSL and Advanced Oracle support.
  3. There's a lot of interesting…

Spring Framework 3.2 RC1: Spring MVC Test Framework

Engineering | Rossen Stoyanchev | November 12, 2012 | ...

[callout title=Update Dec 19, 2012] The final Spring Framework reference documentation contains guidance on migration as well as a complete section on Spring MVC Test. [/callout]

Last week Juergen Hoeller announced the release of Spring Framework 3.2 RC1 and Sam Brannen discussed exciting additions in its spring-test module such as support for WebApplicationContext's and upcoming plans for loading a hierarchy of contexts. Today I will continue this subject and describe another exciting spring-test addition. In 3.2 RC1 we've added first class support for testing Spring MVC applications both…

Spring Framework 3.2 RC1: New Testing Features

Engineering | Sam Brannen | November 07, 2012 | ...

As Juergen Hoeller mentioned in his post announcing the release of Spring Framework 3.2 RC1, the Spring Team has introduced some exciting new features in terms of testing support. Most importantly, we've added first-class support for testing web applications. [1]

      Please note: this is a cross post from my Swiftmind company blog.

In this post we'll first take a look at some of the general new testing features in the Spring Framework, and then we'll go into detail regarding support for testing with a WebApplicationContext as well as request and session scoped beans. We'll close with a look at support for ApplicationContextInitializers and a brief discussion of the road map for testing with application context hierarchies.

Rossen Stoyanchev will later follow up with a detailed post on the new Spring MVC Test framework that provides first-class support for testing Spring MVC applications. So be sure to stay tuned for that as well, since it builds on the basic web testing support discussed later in this post.



General New Features and Updates


Build and Dependencies

The spring-test module now builds against and supports JUnit 4.10 and TestNG 6.5.2, and spring-test now depends on the junit:junit-dep Maven artifact instead of junit:junit which means that you have full control over your dependencies on Hamcrest libraries (e.g., hamcrest-core, hamcrest-all, etc.).

Generic Factory Methods

Generic factory methods are methods that implement the Factory Method Design Pattern using Java Generics. Here are some example signatures of generic factory methods:


public static <T> T mock(Class<T> clazz) { ... }

public static <T> T proxy(T obj) { ... }

The use of generic factory methods in Spring configuration is by no means specific to testing, but generic factory methods such as EasyMock.createMock(MyService.class) or Mockito.mock(MyService.class) are often used to create dynamic mocks for Spring beans in a test application context. For example, prior to Spring Framework 3.2 the following configuration could fail to autowire the OrderRepository into the OrderService. The reason is that, depending on the order in which beans are initialized in the application context, Spring would potentially infer the type of the orderRepository bean to be java.lang.Object instead of com.example.repository.OrderRepository.


<beans>

  <!-- OrderService is autowired with OrderRepository -->
  <context:component-scan base-package="com.example.service"/>

  <bean id="orderRepository" class="org.easymock.EasyMock…

This Week in Spring - 6 November, 2012

Engineering | Josh Long | November 06, 2012 | ...

Welcome back to another installment of This Week in Spring! We've got a lot to cover, so let's get to it!

  1. Did you guys miss SpringOne2GX 2012? I'm not going to lie to you - you really missed out! However, don't despair! Two of my absolute favorite talks from the show are now available online - the keynotes! Both were amazing, but if you're looking for an amazing introduction to the trends underlying next generation of web applications, and a great (amazing!) tour of RabbitMQ, check out the day 2 keynote!
    	More sessions will be posted on that page, so check back often.</LI>
     <LI> Spring 3.2 is drawing ever nearer!   The H  has some 
    	<a href  ="http://www.h-online.com/open/news/item/Spring-Framework-3-2-nears-with-release-candidate-1744277.html">nice coverage of the new features  in the framework</a>.
     </LI>
     <LI> Chris Beams  has announced the latest maintenance release, <A href="http://www.springsource.org/node/3720">Spring 3.1.3 - the third in the 3.1 line, has been released</a>! 
    
  2. Guys, I'm so excited to tell you that SpringOne is coming to India! Register now!
  3. Does your PaaS support your workloads? If you're using Cloud Foundry, then chances are good that it does!
  4. Michael Isvy has put together a nice post on Spring MVC and the view layer
  5. The Spring Framework TestContext framework now supports session/request scoped beans for integration testing
  6. The first milestone of Spring Data SOLR has been released!
  7. Jonathan Brisbin has announced the 1.2 release of the Spring REST Shell. The new release features SSL, basic auth, dotrc support, an updated Homebrew install formula, HATEOAS and hypermedia.
  8. Check out Costin Leau's webinar introducing Spring Data Hadoop this Thursday!
  9. RabbitMQ developer advocate Alvaro Videla linked to a great post on visualizing RabbitMQ topologies.
  10. Spring Data Batch and Spring Security OAuth ninja and Cloud Foundry UAA committer Dr. David Syer has written a really fantastic post on using Cloud Foundry's UAA agents OAuth2 endpoint. This has scarce little to do with Spring, except that Dr. Syer's posts are very educational and helped me tremendously in understanding the problems that Spring Security OAuth solves.

A Groovy DSL For Spring Integration

Engineering | David Turanski | November 06, 2012 | ...

Spring Integration implements Enterprise Integration Patterrns using the Spring programming model to enable messaging in Spring-based applications. Spring Integration also provides integration with external systems using declarative adapters supporting jms, http, amqp, tcp, ftp(s), smtp, and so on. Currently, configuring message flows is primarily done via Spring XML and Spring Integration supports several namespaces to make this as succinct as possible. Earlier this year, SpringSource released a Scala DSL for Spring Integration. Now, we are pleased to announce the first milestone release…

Spring Framework 3.2 RC1 released

Engineering | Juergen Hoeller | November 05, 2012 | ...

Dear Spring community,

I'm pleased to announce that the first Spring Framework 3.2 release candidate is now available.

This generation of the core framework is a straightforward next step after last year's Spring Framework 3.1, continuing several well-established themes. Key features in Spring Framework 3.2 include:

  • A new Gradle-based framework build, making it easier than ever to contribute to the Spring Framework project on GitHub
  • Inlined CGLIB 3.0 and ASM 4.0, fully supporting Java 7 byte code and making CGLIB-based functionality available without explicit declaration of a CGLIB dependency
  • Allowing for @Autowired and @Value to be used as meta-annotations, e.g. to build custom injection annotations in combination with specific qualifiers
  • Support for custom @Bean definition annotations in @Configuration classes, e.g. in combination with specific qualifiers, @Lazy, @Primary, etc
  • Asynchronous MVC processing on Servlet 3.0

Get the Spring newsletter

Stay connected with the Spring newsletter

Subscribe

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Tanzu Spring offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all