org.kuali.rice.core.util
Class GRLServiceInjectionPostProcessor

java.lang.Object
  extended by org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
      extended by 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)

Nested Class Summary
private  class GRLServiceInjectionPostProcessor.AnnotatedMember
          Class representing Rice service injection information about an annotated field.
 
Field Summary
private  Map<Class<?>,List<GRLServiceInjectionPostProcessor.AnnotatedMember>> classMetadata
           
private static org.apache.log4j.Logger LOG
           
 
Constructor Summary
GRLServiceInjectionPostProcessor()
           
 
Method Summary
private  void addIfPresent(List<GRLServiceInjectionPostProcessor.AnnotatedMember> metadata, AccessibleObject ao)
          Adds an AnnotatedMember for the member if it is actually annotated.
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.
protected  Object lookupRiceService(RiceService annotation)
           
 Object postProcessBeforeInitialization(Object bean, String beanName)
           
 
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
 

Field Detail

LOG

private static final org.apache.log4j.Logger LOG

classMetadata

private Map<Class<?>,List<GRLServiceInjectionPostProcessor.AnnotatedMember>> classMetadata
Constructor Detail

GRLServiceInjectionPostProcessor

public GRLServiceInjectionPostProcessor()
Method Detail

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 metadata
ao - the particular member (field or method)


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.