org.springframework.osgi.extensions.annotation
Class ServiceReferenceInjectionBeanPostProcessor

java.lang.Object
  extended by org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
      extended by org.springframework.osgi.extensions.annotation.ServiceReferenceInjectionBeanPostProcessor
All Implemented Interfaces:
BeanClassLoaderAware, BeanFactoryAware, BeanPostProcessor, InstantiationAwareBeanPostProcessor, SmartInstantiationAwareBeanPostProcessor, BundleContextAware

public class ServiceReferenceInjectionBeanPostProcessor
extends InstantiationAwareBeanPostProcessorAdapter
implements BundleContextAware, BeanFactoryAware, BeanClassLoaderAware

BeanPostProcessor that processed annotation to inject Spring-DM managed OSGi services.

Author:
Andy Piper

Constructor Summary
ServiceReferenceInjectionBeanPostProcessor()
           
 
Method Summary
protected  ServiceReference hasServiceProperty(PropertyDescriptor propertyDescriptor)
           
 Object postProcessAfterInitialization(Object bean, String beanName)
          process FactoryBean created objects, since these will not have had services injected.
 PropertyValues postProcessPropertyValues(PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName)
           
 void setBeanClassLoader(ClassLoader classLoader)
           
 void setBeanFactory(BeanFactory beanFactory)
           
 void setBundleContext(BundleContext context)
          Set the BundleContext that this bean runs in.
 
Methods inherited from class org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter
determineCandidateConstructors, getEarlyBeanReference, postProcessAfterInstantiation, postProcessBeforeInitialization, postProcessBeforeInstantiation, predictBeanType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceReferenceInjectionBeanPostProcessor

public ServiceReferenceInjectionBeanPostProcessor()
Method Detail

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Specified by:
setBeanClassLoader in interface BeanClassLoaderAware

postProcessAfterInitialization

public Object postProcessAfterInitialization(Object bean,
                                             String beanName)
                                      throws BeansException
process FactoryBean created objects, since these will not have had services injected.

Specified by:
postProcessAfterInitialization in interface BeanPostProcessor
Overrides:
postProcessAfterInitialization in class InstantiationAwareBeanPostProcessorAdapter
Parameters:
bean -
beanName -
Throws:
BeansException

postProcessPropertyValues

public PropertyValues postProcessPropertyValues(PropertyValues pvs,
                                                PropertyDescriptor[] pds,
                                                Object bean,
                                                String beanName)
                                         throws BeansException
Specified by:
postProcessPropertyValues in interface InstantiationAwareBeanPostProcessor
Overrides:
postProcessPropertyValues in class InstantiationAwareBeanPostProcessorAdapter
Throws:
BeansException

hasServiceProperty

protected ServiceReference hasServiceProperty(PropertyDescriptor propertyDescriptor)

setBundleContext

public void setBundleContext(BundleContext context)
Description copied from interface: BundleContextAware
Set the BundleContext that this bean runs in. Normally this can be used to initialize an object.

Specified by:
setBundleContext in interface BundleContextAware
Parameters:
context - the BundleContext object to be used by this object

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
                    throws BeansException
Specified by:
setBeanFactory in interface BeanFactoryAware
Throws:
BeansException


Copyright © 2006-2009 Spring Framework. All Rights Reserved.