Making sure a Spring Bean is properly initialised

spring

Solution

Use the following attributes of the beans tag to make sure dependency checking and the init method is called on all beans, but it rather assumes you don't call your method "innit".

<beans default-init-method="init" default-dependency-check="objects">

see link

Problem

What is the most concise way of making sure that a Spring bean has all properties set and the init method called? I'll favour answers which use setter injection and XML configuration, since that's what I'm using right now. I'm trying to evade the case where I either forget to configure a setter or call the `init-method`. In future projects I would favour skaffman's response, but I've chosen the one which suits me right now.

Original source