With abstract=false (or omitted) and assuming a default of non lazy init, then 
when the Spring application context is created, it would create the STSClient 
bean immediately up front and it would always be there sucking up memory and 
such.   

With true, the definition is read, but nothing is instantiated.    We then 
create the STSClient object when we need it and then have spring "configure" 
it by doing the property injection and such based on the definition.   

Where the "false" case really becomes complex is that if you don't inject the 
STSClient bean into the place it's needed, we would still create a STSClient 
and have spring configure it like the "true" case.   Thus, there would be two 
STSClient objects hanging around.   The good news is that an unused STSClient 
object doesn't consume much.   It builds up most of itself on the first use.   

Dan


On Saturday 10 July 2010 12:03:57 pm Glen Mazza wrote:
> Hello, question about the stsclient config example at the bottom of this
> page: https://cwiki.apache.org/CXF20DOC/ws-trust.html :
> 
> <bean name="{http://cxf.apache.org/}TestEndpoint.sts-client";
>     class="org.apache.cxf.ws.security.trust.STSClient" abstract="true">
>     <property name="wsdlLocation" value="WSDL/wsdl/trust.wsdl"/>
>    ... many other properties ...
> </bean>
> 
> Question, if I remove the abstract = true for the bean and add the
> constructor arg given in the upper example on that page:
> 
> <bean name="{http://cxf.apache.org/}TestEndpoint.sts-client";
>     class="org.apache.cxf.ws.security.trust.STSClient">
>     <constructor-arg ref="cxf"/>
>     <property name="wsdlLocation" value="WSDL/wsdl/trust.wsdl"/>
>    ... many other properties ...
> </bean>
> 
> What's the effective difference?  The Eclipse debugger appears to indicate
> that they're the same.
> 
> For the lower example, I know I'm directly instantiating the STS Client and
> giving the bus value of "cxf".  For the abstract=true example, I guess
> another object is being created behind-the-scenes using the values of this
> abstract object, but can I safely assume that the bus value will be the
> same "cxf" as if I directly set it as in the lower example?  I.e., both
> examples above are indeed the same thing?
> 
> Thanks,
> Glen

-- 
Daniel Kulp
[email protected]
http://dankulp.com/blog

Reply via email to