On Fri, Jan 20, 2012 at 4:01 PM, Millies, Sebastian
<[email protected]> wrote:
>>From: Simon Laws [mailto:[email protected]]
>>Sent: Friday, January 20, 2012 11:57 AM
>>To: [email protected]
>>Subject: Re: Performance optimization of binding.sca ?
>>
>>On Fri, Jan 20, 2012 at 8:10 AM, Millies, Sebastian 
>><[email protected]> wrote:
>>>Hello there,
>>>
>>>I have a question about the performance optimization of binding.sca in 
>>>Tuscany 1.6.
>>>Suppose I manually create and start two nodes in the same JVM, as follows:
>>>
>>>SCANodeFactory factory = SCANodeFactory.newInstance();
>>>SCANode node_1 = factory.createSCANode( composite_1, contributions_1 );
>>>SCANode node_2 = factory.createSCANode( composite_2, contributions_2 );
>>>node_1.start();
>>>node_2.start();
>>>
>>>Suppose further that component A in composite 1 references a service of 
>>>component B in
>>>composite 2, and both the reference and service expose <binding.sca/> .
>>>
>>>Will there be any internal emulation of a remote call, SOAP parsing etc? Or 
>>>will Tuscany make
>>>a direct call, perhaps using Java reflection?
>>>
>>> -- Sebastian
>>>
>>Hi Sebastien.
>>
>>The idea was that an optimization would be used in that scenario where data 
>>is serialized across class loaders but without the requirement for a full 
>>remote protocol transformation. While we can detect the scenario I don't 
>>think the optimization is in place.
>>
>>Regards
>>
>>Simon
>
> Can you say something about HOW to detect that scenario and WHERE to apply 
> the optimization?
> In due course I might have occasion to look at implementing that.
>
> -- Sebastian
> IDS Scheer Consulting GmbH
> Geschäftsführer/Managing Directors: Kamyar Niroumand, Ivo Totev
> Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken, Germany - 
> Registergericht/Commercial register: Saarbrücken HRB 19681
> http://www.softwareag.com
>

Apologies for the delayed response Sebastien.

The place to start is the SCA Binding provider on the reference side.
You can see code here that is deciding whether it thinks the target is
remote or not. In the case that that target isn't remote we'd then
need to think about the optimization. I.e. can we detect the situation
where the target component is in the same VM but in a different
classloader say. For a target component that is in the same VM but has
a remotable interface there is some code that enforces pass by value
semantics (I think by serializing the arguments using the databinding
layer). Have a look in the code where the PassByValueInterceptor [2]
is set up

Simon

[1] 
http://svn.apache.org/repos/asf/tuscany/sca-java-1.x/trunk/modules/binding-sca/src/main/java/org/apache/tuscany/sca/binding/sca/impl/RuntimeSCAReferenceBindingProvider.java
[2] 
http://svn.apache.org/repos/asf/tuscany/sca-java-1.x/trunk/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/PassByValueInterceptor.java

-- 
Apache Tuscany committer: tuscany.apache.org
Co-author of a book about Tuscany and SCA: tuscanyinaction.com

Reply via email to