1 24 package org.riotfamily.riot.runtime; 25 26 import org.springframework.beans.factory.config.BeanPostProcessor; 27 28 36 public class RiotRuntimeBeanPostProcessor implements BeanPostProcessor { 37 38 private RiotRuntime runtime; 39 40 public RiotRuntimeBeanPostProcessor(RiotRuntime runtime) { 41 this.runtime = runtime; 42 } 43 44 public Object postProcessBeforeInitialization(Object bean, String beanName) { 45 if (bean instanceof RiotRuntimeAware) { 46 ((RiotRuntimeAware) bean).setRiotRuntime(runtime); 47 } 48 return bean; 49 } 50 51 public Object postProcessAfterInitialization(Object bean, String beanName) { 52 return bean; 53 } 54 55 } 56 | Popular Tags |