org.kuali.rice.core.util
Class GRLServiceInjectionPostProcessor
java.lang.Object
org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
org.kuali.rice.core.util.GRLServiceInjectionPostProcessor
- All Implemented Interfaces:
- org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor, org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor
public class GRLServiceInjectionPostProcessor
- extends org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
This bean postprocessor initializes fields which are marked with the RiceService
annotation
and are null after property injection and prior to init call, with a named Rice service obtained
from a specified (or global) resource loader.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
Methods inherited from class org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter |
determineCandidateConstructors, getEarlyBeanReference, postProcessAfterInitialization, postProcessAfterInstantiation, postProcessBeforeInstantiation, postProcessPropertyValues, predictBeanType |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOG
private static final org.apache.log4j.Logger LOG
classMetadata
private Map<Class<?>,List<GRLServiceInjectionPostProcessor.AnnotatedMember>> classMetadata
GRLServiceInjectionPostProcessor
public GRLServiceInjectionPostProcessor()
postProcessBeforeInitialization
public Object postProcessBeforeInitialization(Object bean,
String beanName)
throws org.springframework.beans.BeansException
- Specified by:
postProcessBeforeInitialization
in interface org.springframework.beans.factory.config.BeanPostProcessor
- Overrides:
postProcessBeforeInitialization
in class org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
- Throws:
org.springframework.beans.BeansException
lookupRiceService
protected Object lookupRiceService(RiceService annotation)
findClassMetadata
private List<GRLServiceInjectionPostProcessor.AnnotatedMember> findClassMetadata(Class<? extends Object> clazz)
- Helper method to scan the properties of the bean and find members that need service injection.
- Parameters:
clazz
- the bean class
- Returns:
- list of
RiceService
-annotated members
addIfPresent
private void addIfPresent(List<GRLServiceInjectionPostProcessor.AnnotatedMember> metadata,
AccessibleObject ao)
- Adds an AnnotatedMember for the member if it is actually annotated.
- Parameters:
metadata
- the class metadataao
- the particular member (field or method)
Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.