On Thu, Jun 25, 2009 at 11:59 AM, Simon Laws<[email protected]> wrote:
> On Thu, Jun 25, 2009 at 11:53 AM, ant elder<[email protected]> wrote:
>>
>>
>> On Thu, Jun 25, 2009 at 10:59 AM, Simon Laws <[email protected]>
>> wrote:
>>>
>>> Can you say something about how the libs in the Tuscany webapp are
>>> provided to each of the sca webapps/applications. This would probably
>>> work OK if the endpoint registry were shipped with the tomcat hook as
>>> it would be in the common classloader. A very specific Tomcat solution
>>> and would still need to distribute the registry to include tomcat in a
>>> wider domain.
>>>
>>> Simon
>>
>>
>> When the "Tuscany runtime is shared" box has been ticked then there is a
>> single class loader for all the Tuscany jars and thats added as the parent
>> class loader for all sca contributions and sca enabled webapps. So in that
>> case it doesn't need to go in the tomcat hook as the endpoint registry
>> contents are already shared between all those as it uses static for the
>> endpoints and endpointreferences fields.
>>
>> (In fact, they don't need to be statics because now that all the Node
>> runtime stuff is moved to the NodeFactory and the NodeFactory newInstance
>> isn't actually returning a new instance but a shared instance so there is
>> only a single instance of the tuscany runtime and only a single
>> EndpointRegistry instance. Not actually sure if that is the intention, and
>> its doesn't look like it works if multiple nodes try to use different
>> configurations in the one JVM)
>>
>>    ...ant
>>
>>
>
> And is does work when the runtime is shared. It doesn't though when
> the runtime is not shared. I was referring to the non-shared case when
> I was asking about the classloaders and libs.
>
> Or are you saying that you don't think we should support the non-shared case?
>
> Simon
>

Oh ok. I guess I'd thought in the non-shared case its just like when
running in a separate standalone JVM, so we wouldn't do anything
special in the tomcat integration to help, if it wants to use the
wider domain then it would use the distributed endpoint registry using
tribes or however we have that implemented.

The following is the type of thing I had in mind:

  JVM1
     Node1
           service1

  JVM2
     Node2
           service2
     Node3
           service3 that uses service1 and service2

   JVM3
     Node4
           client that uses service3

In the JVM2 case (which could be a tomcat with tuscany integration
jvm) that should ideally use a single port, share a local endpoint
registry instance, and not make a real remote call when service3 calls
service2. And there would be some way for having a shared endpont
registry across all the Nodes using tribes or whatever.

To set that up with the current Tuscany API/SPI it would be code along
the lines of:

JVM1: NodeFactory.newInstance().createNode(new
Contribution("service1", service1Contribution.jar));

JVM2: NodeFactory.newInstance().createNode(new
Contribution("service2", service2Contribution.jar));
      NodeFactory.newInstance().createNode(new
Contribution("service3", service3Contribution.jar));

JVM3: NodeFactory.newInstance().createNode(new Contribution("client",
clientContribution.jar));

And ideally that would be it. So can we get that to work just like
that, or what is the minimum extra configuration needed? I guess
without some sort of auto discovery then each JVM needs to be told
about the other JVMs, but it seems like that should be per JVM not per
node.

   ...ant

Reply via email to