[jboss-dev] Re: jbossas -beans.xml opt

Ales Justin ales.justin at gmail.com
Thu May 14 04:42:37 EDT 2009


http://www.jboss.org/index.html?module=bb&op=viewtopic&t=154873

Jaikiran Pai wrote:
> Is there any place (forum or wiki or anything else) where i can read 
> about its usage or more about where these kind of lazy beans would come 
> in handy?
> 
> -Jaikiran
> Ales Justin wrote:
>>> What are the SomeBeanProxy and OtherBeanProxy in these examples? 
>>
>> Those are the lazy proxies generated by <lazy/>.
>>
>> We try to use the best lazy mechanism available.
>> (1) Javassist (allows for class exposure in a proxy)
>> (2) JBossAOP (although currently if this exists, (1) should too)
>> (3) JDK dynamic proxies (needs interfaces)
>>
>> I would need to check if we can avoid the explicit injection,
>> and use lazy nested directly:
>>
>> <property name="someProp"><lazy bean"SomeBean"/></property>
>>
>>> And when exactly are these "lazy" beans installed?
>>
>> They have a dependency on the "bean", at Not_Installed state.
>> Meaning the minute "bean" is installed in MC, you can have lazy proxy 
>> for it.
>>
>>> -Jaikiran
>>> Ales Justin wrote:
>>>> Aha, another thing you can use to optimize things.
>>>> It's the lazy install of OnDemand beans.
>>>>
>>>> e.g.
>>>> <bean name="SomeBean" class="org.jboss.acme.Acme" mode="On Demand"/>
>>>>
>>>> <lazy bean="SomeBean">
>>>>    <interface>org.jboss.acme.IAcme<interface>
>>>> </lazy>
>>>>
>>>> <bean name="DependantBean" class="org.jboss.foobar.Foobar">
>>>>    <constructor>
>>>>       <parameter><inject bean="SomeBeanProxy"></parameter>
>>>>    <constructor>
>>>> </bean>
>>>>
>>>> If the bean doesn't have interfaces:
>>>>
>>>> <bean name="OtherBean" class="org.jboss.acme.Acme" mode="On Demand"/>
>>>>
>>>> <lazy bean="OtherBean" exposeClass="true"/>
>>>>
>>>> <bean name="DependantBean" class="org.jboss.foobar.Foobar">
>>>>    <constructor>
>>>>       <parameter><inject bean="OtherBeanProxy"></parameter>
>>>>    <constructor>
>>>> </bean>
>>>> _______________________________________________
>>>> jboss-development mailing list
>>>> jboss-development at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/jboss-development
>>>
>>> _______________________________________________
>>> jboss-development mailing list
>>> jboss-development at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/jboss-development
>>>
>> _______________________________________________
>> jboss-development mailing list
>> jboss-development at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/jboss-development
> 
> _______________________________________________
> jboss-development mailing list
> jboss-development at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jboss-development
> 



More information about the jboss-development mailing list