Spring Bean – Order of injecting properties

Problem Statement: We need to start some task, after injecting all properties. How to resolve this?

Solution: Dont / Never depend on order of injecting values into bean. It is not controlled.


import org.springframework.beans.factory.InitializingBean;

public class BeanName implements InitializingBean
{

public void afterPropertiesSet() throws Exception
  {
    System.out.println( "It will be called after completion of properties setting.");
    //do whatever is required here.
  }

}

#afterpropertiesset, #injecting-properties-order, #spring-framework