Save This Page
Home » Spring-Framework-090522 » org.springframework » beans » factory » [javadoc | source]
org.springframework.beans.factory
public interface: InitializingBean [javadoc | source] Interface to be implemented by beans that need to react once all their properties have been set by a BeanFactory: for example, to perform custom initialization, or merely to check that all mandatory properties have been set.

An alternative to implementing InitializingBean is specifying a custom init-method, for example in an XML bean definition. For a list of all bean lifecycle methods, see the BeanFactory javadocs.

Method from org.springframework.beans.factory.InitializingBean Summary:
afterPropertiesSet
Method from org.springframework.beans.factory.InitializingBean Detail:
 public  void afterPropertiesSet() throws Exception
    Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

    This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.