public abstract class DaoSupport extends Object implements InitializingBean
Extended by Spring's specific DAO support classes, such as: JdbcDaoSupport, JdoDaoSupport, etc.
JdbcDaoSupport
Modifier and Type | Field and Description |
---|---|
protected Log |
logger
Logger available to subclasses.
|
Constructor and Description |
---|
DaoSupport() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Invoked by the containing
BeanFactory after it has set all bean properties
and satisfied BeanFactoryAware , ApplicationContextAware etc. |
protected abstract void |
checkDaoConfig()
Abstract subclasses must override this to check their configuration.
|
protected void |
initDao()
Concrete subclasses can override this for custom initialization behavior.
|
protected final Log logger
public final void afterPropertiesSet() throws IllegalArgumentException, BeanInitializationException
InitializingBean
BeanFactory
after it has set all bean properties
and satisfied BeanFactoryAware
, ApplicationContextAware
etc.
This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
afterPropertiesSet
in interface InitializingBean
IllegalArgumentException
BeanInitializationException
protected abstract void checkDaoConfig() throws IllegalArgumentException
Implementors should be marked as final
if concrete subclasses
are not supposed to override this template method themselves.
IllegalArgumentException
- in case of illegal configurationprotected void initDao() throws Exception
Exception
- if DAO initialization fails
(will be rethrown as a BeanInitializationException)BeanInitializationException