Added dependency injection to inject an object to a Spring bean.