Results 1 to 2 of 2

Thread: Registering aliases for a bean with scope prototype

Hybrid View

  1. #1
    Join Date
    Jul 2009
    Posts
    7

    Default Registering aliases for a bean with scope prototype

    Hi All,

    We are migrating from spring 3.0.M3 to spring 3.0.2. We had a configuration as :--
    Code:
    <bean id="componentDataBuilder"
    	class="mvc.components.DefaultComponentDataBuilder"
    	scope="prototype">
    	<property name="componentDataConverter" ref="componentDataConverter" />
    </bean>
    
    <bean class="example.search.mvc.builders.SearchDataBuilder" parent="componentDataBuilder"	>
            <property name="searchService" ref="searchService" />
        </bean>
    The prototype bean is getting created with the default alias name. We have our own implementation of BeanPostProcessor.postProcessAfterInitialization to register a new alias(dpeneding on our business logic). For a bean with singleton scope 'postProcessAfterInitialization()' is called, but it is not being called for a bean with prototype scope.

    This configuration was working till 3.0.M3 as 'SearchDataBuilder' and we were assuming it to be prototype scope. But with adoption of 3.0.2, we realised that the "SearchDataBuilder" was having singleton scope in previous versions. I can find that this issue is fixed by SPR-3542.

    Do I need to change any of my configuration so that BeanPostProcessor.postProcessAfterInitialization will be called for prototype scope as well?
    Thanks,
    Pranay

  2. #2
    Join Date
    Jul 2009
    Posts
    7

    Default

    it seems i had posted it to the wrong group... i am moving this to Spring Community Forums > Core Spring Projects > Core Container.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •