1 16 17 package org.springframework.dao.support; 18 19 import org.apache.commons.logging.Log; 20 import org.apache.commons.logging.LogFactory; 21 22 import org.springframework.beans.factory.BeanInitializationException; 23 import org.springframework.beans.factory.InitializingBean; 24 25 36 public abstract class DaoSupport implements InitializingBean { 37 38 39 protected final Log logger = LogFactory.getLog(getClass()); 40 41 42 public final void afterPropertiesSet() throws IllegalArgumentException , BeanInitializationException { 43 checkDaoConfig(); 45 46 try { 48 initDao(); 49 } 50 catch (Exception ex) { 51 throw new BeanInitializationException("Initialization of DAO failed", ex); 52 } 53 } 54 55 61 protected abstract void checkDaoConfig() throws IllegalArgumentException ; 62 63 70 protected void initDao() throws Exception { 71 } 72 73 } 74 | Popular Tags |