On 23 Sep 2005, at 09:33, [EMAIL PROTECTED] wrote:
Hello

Can anybody explain me why it seems that org.jencks.JCAContainer forces initialization of non-singleton and lazy-init beans in ApplicationContext?
Maybe I'm missing something but when I declare a sample bean:


<bean id="Container" class="org.jencks.JCAContainer">
        <property name="bootstrapContext">
<bean class="org.jencks.factory.BootstrapContextFactoryBean">
                  <property name="threadPoolSize" value="25" />
            </bean>
      </property>

        <property name="resourceAdapter">
<bean id="activeMQResourceAdapter" class="org.activemq.ra.ActiveMQResourceAdapter"> <property name="serverUrl" value="tcp://localhost: 61616"/>
        </bean>
    </property>
</bean>


then all my lazy-init singletons and non-singleton beans are created - even if they are not a dependency of any other bean!
I'm a bit confused and appreciate any help.

The main issue is we need to ensure that all of the inbound connectors are created on startup (i.e. all the message inflow subscriptions are created on startup). Now maybe there's a better way of doing that in Spring, but right now we're using this code...

http://cvs.jencks.codehaus.org/jencks/src/main/java/org/jencks/ JCAContainer.java?rev=1.1.1.1&view=auto

(see the afterPropertiesSet() method and the block starting with ...

    if (!lazyLoad....

Now you can disable this if you like by setting the lazyLoad property to true. Maybe there's a better way of configuring this in spring maybe?

James
-------
http://radio.weblogs.com/0112098/

Reply via email to