org.springframework.beans.factory
Interface InitializingBean

All Known Implementing Classes:
AbstractDataFieldMaxValueIncrementer, AbstractJndiLocator, AbstractPrototypeTargetSource, BurlapClientInterceptor, CronTriggerBean, DatabaseStartupValidator, DataSourceTransactionManager, FreeMarkerConfigurationFactoryBean, FreeMarkerConfigurer, HessianClientInterceptor, HibernateAccessor, HibernateDaoSupport, HibernateTransactionManager, JaxRpcPortClientInterceptor, JdbcDaoSupport, JdbcTemplate, JdoAccessor, JdoDaoSupport, JdoTransactionManager, JobDetailBean, JtaTransactionManager, ListFactoryBean, LocalJaxRpcServiceFactoryBean, LocalPersistenceManagerFactoryBean, LocalSessionFactoryBean, MapFactoryBean, MethodInvokingFactoryBean, MethodInvokingJobDetailFactoryBean, MethodInvokingTimerTaskFactoryBean, PreferencesPlaceholderConfigurer, PropertiesFactoryBean, PropertiesMethodNameResolver, RdbmsOperation, RemoteExporter, RmiClientInterceptor, RmiServiceExporter, SchedulerFactoryBean, SetFactoryBean, SimpleTriggerBean, SqlMapClientDaoSupport, SqlMapClientFactoryBean, SqlMapFactoryBean, TimerFactoryBean, TransactionInterceptor, TransactionProxyFactoryBean, TransactionTemplate, VelocityConfigurer, VelocityEngineFactoryBean

public interface InitializingBean

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.

Version:
$Revision: 1.5 $
Author:
Rod Johnson
See Also:
BeanNameAware, BeanFactoryAware, BeanFactory, RootBeanDefinition.getInitMethodName(), ApplicationContextAware

Method Summary
 void afterPropertiesSet()
          Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 

Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.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.

Throws:
java.lang.Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.


Copyright (C) 2003-2004 The Spring Framework Project.