Examples of BeanPostProcessor


Examples of org.springframework.beans.factory.config.BeanPostProcessor

    this.scriptBeanFactory.copyConfigurationFrom(this.beanFactory);

    // Filter out BeanPostProcessors that are part of the AOP infrastructure,
    // since those are only meant to apply to beans defined in the original factory.
    for (Iterator it = this.scriptBeanFactory.getBeanPostProcessors().iterator(); it.hasNext();) {
      BeanPostProcessor postProcessor = (BeanPostProcessor) it.next();
      if (postProcessor instanceof AopInfrastructureBean) {
        it.remove();
      }
    }
  }
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanPostProcessor

      // Register the (JDK 1.5 specific) LoadTimeWeaverAwareProcessor.
      try {
        Class ltwapClass = ClassUtils.forName(
            "org.springframework.context.weaving.LoadTimeWeaverAwareProcessor",
            AbstractApplicationContext.class.getClassLoader());
        BeanPostProcessor ltwap = (BeanPostProcessor) BeanUtils.instantiateClass(ltwapClass);
        ((BeanFactoryAware) ltwap).setBeanFactory(beanFactory);
        beanFactory.addBeanPostProcessor(ltwap);
      }
      catch (ClassNotFoundException ex) {
        throw new IllegalStateException("Spring's LoadTimeWeaverAwareProcessor class is not available");
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanPostProcessor

  /**
   * Register the given BeanPostProcessor beans.
   */
  private void registerBeanPostProcessors(ConfigurableListableBeanFactory beanFactory, List postProcessors) {
    for (Iterator it = postProcessors.iterator(); it.hasNext();) {
      BeanPostProcessor postProcessor = (BeanPostProcessor) it.next();
      beanFactory.addBeanPostProcessor(postProcessor);
    }
  }
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanPostProcessor

    this.scriptBeanFactory.copyConfigurationFrom(this.beanFactory);

    // Filter out BeanPostProcessors that are part of the AOP infrastructure,
    // since those are only meant to apply to beans defined in the original factory.
    for (Iterator it = this.scriptBeanFactory.getBeanPostProcessors().iterator(); it.hasNext();) {
      BeanPostProcessor postProcessor = (BeanPostProcessor) it.next();
      if (postProcessor instanceof AopInfrastructureBean) {
        it.remove();
      }
    }
  }
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanPostProcessor

  public Object applyBeanPostProcessorsBeforeInitialization(Object existingBean, String beanName)
      throws BeansException {

    Object result = existingBean;
    for (Iterator it = getBeanPostProcessors().iterator(); it.hasNext();) {
      BeanPostProcessor beanProcessor = (BeanPostProcessor) it.next();
      result = beanProcessor.postProcessBeforeInitialization(result, beanName);
    }
    return result;
  }
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanPostProcessor

  public Object applyBeanPostProcessorsAfterInitialization(Object existingBean, String beanName)
      throws BeansException {

    Object result = existingBean;
    for (Iterator it = getBeanPostProcessors().iterator(); it.hasNext();) {
      BeanPostProcessor beanProcessor = (BeanPostProcessor) it.next();
      result = beanProcessor.postProcessAfterInitialization(result, beanName);
    }
    return result;
  }
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanPostProcessor

      // to support styles of field injection.
      boolean continueWithPropertyPopulation = true;

      if (!mbd.isSynthetic() && hasInstantiationAwareBeanPostProcessors()) {
        for (Iterator it = getBeanPostProcessors().iterator(); it.hasNext(); ) {
          BeanPostProcessor beanProcessor = (BeanPostProcessor) it.next();
          if (beanProcessor instanceof InstantiationAwareBeanPostProcessor) {
            InstantiationAwareBeanPostProcessor ibp = (InstantiationAwareBeanPostProcessor) beanProcessor;
            if (!ibp.postProcessAfterInstantiation(bean, beanName)) {
              continueWithPropertyPopulation = false;
              break;
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanPostProcessor

    }
    // Apply SmartInstantiationAwareBeanPostProcessors to predict the
    // eventual type after a before-instantiation shortcut.
    if (!mbd.isSynthetic() && hasInstantiationAwareBeanPostProcessors()) {
      for (Iterator it = getBeanPostProcessors().iterator(); it.hasNext(); ) {
        BeanPostProcessor bp = (BeanPostProcessor) it.next();
        if (bp instanceof SmartInstantiationAwareBeanPostProcessor) {
          SmartInstantiationAwareBeanPostProcessor ibp = (SmartInstantiationAwareBeanPostProcessor) bp;
          Class processedType = ibp.predictBeanType(beanClass, beanName);
          if (processedType != null) {
            return processedType;
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanPostProcessor

   */
  protected Object applyBeanPostProcessorsBeforeInstantiation(Class beanClass, String beanName)
      throws BeansException {

    for (Iterator it = getBeanPostProcessors().iterator(); it.hasNext();) {
      BeanPostProcessor beanProcessor = (BeanPostProcessor) it.next();
      if (beanProcessor instanceof InstantiationAwareBeanPostProcessor) {
        InstantiationAwareBeanPostProcessor ibp = (InstantiationAwareBeanPostProcessor) beanProcessor;
        Object result = ibp.postProcessBeforeInstantiation(beanClass, beanName);
        if (result != null) {
          return result;
View Full Code Here

Examples of org.springframework.beans.factory.config.BeanPostProcessor

   */
  protected Constructor determineConstructorFromBeanPostProcessors(Class beanClass, String beanName)
      throws BeansException {

    for (Iterator it = getBeanPostProcessors().iterator(); it.hasNext();) {
      BeanPostProcessor beanProcessor = (BeanPostProcessor) it.next();
      if (beanProcessor instanceof SmartInstantiationAwareBeanPostProcessor) {
        SmartInstantiationAwareBeanPostProcessor ibp = (SmartInstantiationAwareBeanPostProcessor) beanProcessor;
        Constructor ctor = ibp.determineConstructor(beanClass, beanName);
        if (ctor != null) {
          return ctor;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.