Hi,
The use case (from a Tuscany embedder) was described in my original post.
[ I came across a scenario where multiple Nodes are created from the same
NodeFactory. For example, in an OSGi framework, we have a singleton of
NodeFactory which internally maintains the ExtensionPointRegistry. Two Nodes
(A and B) with the same domain URI are created from the NodeFactory. These
two Nodes will share the same EndpointRegistry as they have the same
domainURI and domainRegistryURI. Node A publishes an endpoint to the
EndpointRegistry and it will be seen by Node B. In this case, we cannot tell
if the endpoint from A is local or remote to B. As a result, binding.sca
cannot decide if it should handle the invocation from B to A as a local or
remote one. ]
In the above case, if the data types on the remote services are simple types
(those from the JDK), it might happen to work fine across the classloaders.
What's broken is that we have JAXB classes (say Customer) as one of the
arguments or return type, for example, an remote operation can be:
Customer getCustomer(String id);
In Node A, the Customer is loaded by classloader A while Node B expects the
Customer loaded by classloader B. As Tuscany treats it as local invocation
due to the defect in our endpoint registry code, Node A tries to pass
Customer (A) to Node B. The pass-by-value interceptor copies Customer (A)
into another Customer (A) but it won't satisfy Node B's type requirement
(Customer B).
This is the case where two Nodes are co-located on the same JVM and
binding.sca should decide how to make the cross-node call. We need to give
the binding providers the information whether the endpoint is remote, remote
co-located, or local to the endpoint reference.
Thanks,
Raymond
--------------------------------------------------
From: "ant elder" <[email protected]>
Sent: Monday, January 25, 2010 1:54 AM
To: <[email protected]>
Subject: Re: Adding domain and node URIs to RuntimeEndpoint?
On Sat, Jan 23, 2010 at 4:35 PM, Raymond Feng <[email protected]> wrote:
That's not expected in three common use cases where the nodes are running
under different classloading spaces in the same VM that shares the
Tuscany
runtime.
1. OSGi bundles
2. Web applications
3. JEE apps
Invocations across such nodes have to be handled as remote ones even
though
bindings can choose to optimize in this colocation case.
Every invocation across contributions is likely to be using different
class loaders, its not specific to just those environments. Some of
the tests and runtimes we have do do this and its working ok and
correctly using the remote sca binding, could you add a simple
testcase for your specific scenario to help understand and debug it?
...ant