Hi,

We have been discussing when we can make in-VM calls (without going through a protocol stack) between two SCA components (more precisely, an endpoint reference to an endpoint) for binding.sca. I start to realize that the criteria can be as simple as the following:

* The target endpoint of an endpoint reference has to be accessed locally (not serialized) in the endpoint registry that the client (a Node or an SCAClientFactory) connects to.

Why? Because that's the only case we can get the invocation chain of the target endpoint in-memory. If the endpoint description is serialized into the registry from another one (no matter if it's from the same JVM, a different JVM or a different machine), we cannot access the invocation chain directly without going through a protocol stack.

The in-VM invocation between the endpoint reference and endpoint can be further divided into a few cases:

1) A local interface is used. Then the source interface has to be a compatible subset of the target interface. To support the pass-by-reference semantics, all the input/output/fault types have to be compatible within the same databinding type system (for Java classes, the same classloading space).

2) A remotable interface is used.
a) If the allowsPassByReference flag is set to true, we can check to see if the source interface is a compatible subset of the target interface in the "local" way. If they can allow "pass-by-reference", we don't have to copy the data and an in-VM called can be made to flow the message from the endpoint reference invocation chain to the endpoint invocation chain. Otherwise, we need to copy the data across the type systems and make an in-VM call. b) If the allowsPassByReference flag is set to false, we need to copy the data across the type systems and make an in-VM call.

Invocations to any endpoints that are foreign (remote) to the local endpoint registry have to go through a protocol stack.

Now the algorithm to determine if we can make "in-VM" calls between the endpoint reference and endpoint should be simple: * For an endpoint with remote flag set to true (when it's deserialized), we cannot make in-VM calls. * For an endpoint with remote flag set to false (the default when it's published to the local endpoint registry), we can choose to make in-VM calls.

Thanks,
Raymond
---
Raymond Feng
Apache Tuscany PMC Member: http://tuscany.apache.org
Co-author of Tuscany In Action (A book on Tuscany SCA): http://tuscanyinaction.com/
www.enjoyjava.com
http://twitter.com/raymondfeng


Reply via email to