You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Simon Laws <si...@googlemail.com> on 2009/03/13 14:31:27 UTC
Re: [2.x] [DISCUSS] Endpoints
> We can carry on expanding
> http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Endpoints. Not much
> there yet but am starting to add things.
>
An update on where I've got to with Endpoints and EndpointReferences.
I've updated http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Endpoints
with a model and some description of the events that cause Endpoint
and EndpointReference models to be created. I've added code to this
effect in parallel with the existing code. I've got to the stage now
where I can't do any more in parallel and need to do some ripping and
replacing.
In particular I have the following TODOs
Use of EndpointReference2 and Endpoint2 in place of the current
EndpointReference
Separate out the Endpoint/EndpointReference creation and resolution
code from the builders so that it's pluggable and can defer to
bindings if required
Fix up callbacks for the new structures
Fix up promotion for the new structure
Any further comments gratefully received.
Regards
Simon
Re: [2.x] [DISCUSS] Endpoints
Posted by Simon Laws <si...@googlemail.com>.
On Thu, Mar 19, 2009 at 9:14 PM, Simon Laws <si...@googlemail.com> wrote:
>>
>> The test itest\distribution\webapp-helloworld-jsp is failing for me
>> now with an NPE in CompositeActivatorImpl2.addReferenceWire, is it
>> working for any one else?
>>
>> ...ant
>>
>
> hmm, let me take a look.
>
> Simon
>
The reason for the NPE is that neither the component reference or
component type reference for the webapp component have an interface
contract set. Looking at the code I'm guessing that no webapp
introspection has been plugged in yet. Is that true? I expect this is
a point in time thing.
However I must have knocked a piece of logic out that made this work
before I committed the endpoint changes. I have a fix that adds the
interface contract to the reference based on the service to which the
reference is connected. So I can make this work for now but I'd like
to understand the implementation.web introspection story.
Simon
Re: [2.x] [DISCUSS] Endpoints
Posted by Simon Laws <si...@googlemail.com>.
>
> The test itest\distribution\webapp-helloworld-jsp is failing for me
> now with an NPE in CompositeActivatorImpl2.addReferenceWire, is it
> working for any one else?
>
> ...ant
>
hmm, let me take a look.
Simon
Re: [2.x] [DISCUSS] Endpoints
Posted by ant elder <an...@gmail.com>.
On Thu, Mar 19, 2009 at 4:27 PM, Simon Laws <si...@googlemail.com> wrote:
> I've just enabled the new endpoint reference/endpoint model in the
> runtime at revision: 756070. Here's what it does.
>
> For each service binding an endpoint model is created
> There are no $promoted$ services anymore. The endpoint at the
> appropriate level hosts the services and refers down to the promoted
> service
> For each reference target (where target is either a wire target or an
> unwired binding) an endpoint reference model is created
> For endpoint references of references that have a callback
> interface an association with the callback services endpoint is
> created
> Before composite activation endpoint reference bindings are matched
> with endpoint bindings
> The endpoint for the endpoint reference is chosen
> At activation/start
> All endpoints have a wire created
> All endpoing reference have a wire created
> Wire operation is that same as it was before.
>
> When it comes to interacting with the wire the old EndpointReference
> structure is still in use. I need some help from Raymond to switch
> this over to the new structure. So there are a number of classes in
> the code based with "2" at the end of their name. I haven't removed
> the classes they replace yet but assume that the version with "2" in
> the name is active.
>
> In particular be aware that there old CompositeActivatorImpl and
> RuntimeWireImpl are no longer active.
>
> Next steps.
> Go through and remove anything that can be removed
> Do a bit of tidying
> Fix up the code to use EnpointReference2 throughout
> Add any of the other features that Raymond has mentioned as we see fit.
> Refactor to change all the classes with "2" at the end to their
> proper names removing anything they replace.
>
> Some pictures of the endpoint reference/endpoint model can be found
> here [1]. I'm just adding some promotion/callback pictures at the
> moment. Any comments, help gratefully received.
>
> Regards
>
> Simon
>
> [1] http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Endpoints
>
The test itest\distribution\webapp-helloworld-jsp is failing for me
now with an NPE in CompositeActivatorImpl2.addReferenceWire, is it
working for any one else?
...ant
Re: [2.x] [DISCUSS] Endpoints
Posted by Raymond Feng <en...@gmail.com>.
Good progress. I'll update the code from svn and do some reading.
Thanks,
Raymond
--------------------------------------------------
From: "Simon Laws" <si...@googlemail.com>
Sent: Thursday, March 19, 2009 9:27 AM
To: <de...@tuscany.apache.org>
Subject: Re: [2.x] [DISCUSS] Endpoints
> I've just enabled the new endpoint reference/endpoint model in the
> runtime at revision: 756070. Here's what it does.
>
> For each service binding an endpoint model is created
> There are no $promoted$ services anymore. The endpoint at the
> appropriate level hosts the services and refers down to the promoted
> service
> For each reference target (where target is either a wire target or an
> unwired binding) an endpoint reference model is created
> For endpoint references of references that have a callback
> interface an association with the callback services endpoint is
> created
> Before composite activation endpoint reference bindings are matched
> with endpoint bindings
> The endpoint for the endpoint reference is chosen
> At activation/start
> All endpoints have a wire created
> All endpoing reference have a wire created
> Wire operation is that same as it was before.
>
> When it comes to interacting with the wire the old EndpointReference
> structure is still in use. I need some help from Raymond to switch
> this over to the new structure. So there are a number of classes in
> the code based with "2" at the end of their name. I haven't removed
> the classes they replace yet but assume that the version with "2" in
> the name is active.
>
> In particular be aware that there old CompositeActivatorImpl and
> RuntimeWireImpl are no longer active.
>
> Next steps.
> Go through and remove anything that can be removed
> Do a bit of tidying
> Fix up the code to use EnpointReference2 throughout
> Add any of the other features that Raymond has mentioned as we see fit.
> Refactor to change all the classes with "2" at the end to their
> proper names removing anything they replace.
>
> Some pictures of the endpoint reference/endpoint model can be found
> here [1]. I'm just adding some promotion/callback pictures at the
> moment. Any comments, help gratefully received.
>
> Regards
>
> Simon
>
> [1] http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Endpoints
Re: [2.x] [DISCUSS] Endpoints
Posted by Simon Laws <si...@googlemail.com>.
I've just enabled the new endpoint reference/endpoint model in the
runtime at revision: 756070. Here's what it does.
For each service binding an endpoint model is created
There are no $promoted$ services anymore. The endpoint at the
appropriate level hosts the services and refers down to the promoted
service
For each reference target (where target is either a wire target or an
unwired binding) an endpoint reference model is created
For endpoint references of references that have a callback
interface an association with the callback services endpoint is
created
Before composite activation endpoint reference bindings are matched
with endpoint bindings
The endpoint for the endpoint reference is chosen
At activation/start
All endpoints have a wire created
All endpoing reference have a wire created
Wire operation is that same as it was before.
When it comes to interacting with the wire the old EndpointReference
structure is still in use. I need some help from Raymond to switch
this over to the new structure. So there are a number of classes in
the code based with "2" at the end of their name. I haven't removed
the classes they replace yet but assume that the version with "2" in
the name is active.
In particular be aware that there old CompositeActivatorImpl and
RuntimeWireImpl are no longer active.
Next steps.
Go through and remove anything that can be removed
Do a bit of tidying
Fix up the code to use EnpointReference2 throughout
Add any of the other features that Raymond has mentioned as we see fit.
Refactor to change all the classes with "2" at the end to their
proper names removing anything they replace.
Some pictures of the endpoint reference/endpoint model can be found
here [1]. I'm just adding some promotion/callback pictures at the
moment. Any comments, help gratefully received.
Regards
Simon
[1] http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Endpoints
Re: [2.x] [DISCUSS] Endpoints
Posted by Simon Laws <si...@googlemail.com>.
Hi Raymond
Thanks for the comments. More in line...
Simon
> I'm fine if the code
> gets broken for a week or two.
Yes, I think a bit of breakage is going to be unavoidable.
>
> I have a few comments/questions (I use Endpoint/EndpointReference to refer
> the Endpoint2/EndpointReference2):
>
> 1) The EndpointReference.get/setTargetName() should be removed. If the
> reference has an @target attribute or the binding has an SCA URI, we create
> a target Endpoint to represent that.
+1 I have gone that direction but you're right I've not removed the
target name. Good spot.
>
> For example,
> <component name="Component1">
> <reference name="Ref1" target="Component2/Service1">
> </component>
>
> Assuming the structural uri for Component1 in the SCA domain is
> TopComponent/Component1, then the target should be relativized as follows:
>
> target structural URI
> ---------------------------
> ---------------------------------------------------------------------
> Component2/Service1 TopComponent/Component2#service(Service1)
> Component2 TopComponent/Component2
> Component2/Service1/Binding1
> TopComponent/Component2#service-binding(Service1/Binding1)
>
>
> 2) For callback of an SCA reference, I assume:
>
> * We create an Endpoint to represent the "callback service" on the component
> that owns the reference
yes
> * Set the callback endpoint to the EndpointReference so that it can be
> passed to the target component to make callbacks
yes (although the serialization piece isn't there yet)
>
> 3) The Endpoint can potentially have the SCA structural binding URI and/or
> the binding-specific physical URI.
>
> For example,
> <component name="Component2">
> <service name="Service1">
> <binding.ws name="Binding1" uri="http://localhost:8080/MyWebService"/>
> </service>
> </component>
>
> The structural URI for Binding1 is:
> TopComponent/Component2#service-binding(Service1/Binding1)
> The WS binding specific URI is: http://localhost:8080/MyWebService
>
> If the Endpoint2 represents a non-SCA service endpoint, then the structural
> URI is null.
>
> Do we need to have an attribute in the Endpoint to access the structural
> URI?
Don't know yet. I had assumed we could go to the binding.
> Do we need to have an attribute in the Endpoint to access the binding
> specific URI or do we reuse binding.get/setURI()?
Don't know about this either. Did put it in but it's commented out as
I changed my mind thinking we would go to the binding.
>
> 4) If we need to pass around an EndpointReference, what would be the
> serialized format? The WS-Addressing EPR structure can probably help.
Yes, EPR sounds right. Haven't done this yet so if you feel like
making a bit of serialization code... ;-)
>
> 5) Do we consider to have an EndpointRegistry at runtime so that endpoints
> can be looked up or resolved based on the structural URIs?
Interesting question. I think when we move on to making this work in
the domain the answer is yes. It's not a requirement for static
configuration of course but would help us we incremental startup
and/or latebinding scenarios.
Re: [2.x] [DISCUSS] Endpoints
Posted by Raymond Feng <en...@gmail.com>.
Hi,
Good work. I suggest that we start to go a bit wild to bring up the new
story ASAP instead of being stuck with the legacy code. I'm fine if the code
gets broken for a week or two.
I have a few comments/questions (I use Endpoint/EndpointReference to refer
the Endpoint2/EndpointReference2):
1) The EndpointReference.get/setTargetName() should be removed. If the
reference has an @target attribute or the binding has an SCA URI, we create
a target Endpoint to represent that.
For example,
<component name="Component1">
<reference name="Ref1" target="Component2/Service1">
</component>
Assuming the structural uri for Component1 in the SCA domain is
TopComponent/Component1, then the target should be relativized as follows:
target structural URI
--------------------------- ---------------------------------------------------------------------
Component2/Service1 TopComponent/Component2#service(Service1)
Component2 TopComponent/Component2
Component2/Service1/Binding1
TopComponent/Component2#service-binding(Service1/Binding1)
2) For callback of an SCA reference, I assume:
* We create an Endpoint to represent the "callback service" on the component
that owns the reference
* Set the callback endpoint to the EndpointReference so that it can be
passed to the target component to make callbacks
3) The Endpoint can potentially have the SCA structural binding URI and/or
the binding-specific physical URI.
For example,
<component name="Component2">
<service name="Service1">
<binding.ws name="Binding1"
uri="http://localhost:8080/MyWebService"/>
</service>
</component>
The structural URI for Binding1 is:
TopComponent/Component2#service-binding(Service1/Binding1)
The WS binding specific URI is: http://localhost:8080/MyWebService
If the Endpoint2 represents a non-SCA service endpoint, then the structural
URI is null.
Do we need to have an attribute in the Endpoint to access the structural
URI?
Do we need to have an attribute in the Endpoint to access the binding
specific URI or do we reuse binding.get/setURI()?
4) If we need to pass around an EndpointReference, what would be the
serialized format? The WS-Addressing EPR structure can probably help.
5) Do we consider to have an EndpointRegistry at runtime so that endpoints
can be looked up or resolved based on the structural URIs?
Thanks,
Raymond
--------------------------------------------------
From: "Simon Laws" <si...@googlemail.com>
Sent: Friday, March 13, 2009 6:31 AM
To: <de...@tuscany.apache.org>
Subject: Re: [2.x] [DISCUSS] Endpoints
>> We can carry on expanding
>> http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Endpoints. Not
>> much
>> there yet but am starting to add things.
>>
>
> An update on where I've got to with Endpoints and EndpointReferences.
> I've updated
> http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Endpoints
> with a model and some description of the events that cause Endpoint
> and EndpointReference models to be created. I've added code to this
> effect in parallel with the existing code. I've got to the stage now
> where I can't do any more in parallel and need to do some ripping and
> replacing.
>
> In particular I have the following TODOs
>
> Use of EndpointReference2 and Endpoint2 in place of the current
> EndpointReference
> Separate out the Endpoint/EndpointReference creation and resolution
> code from the builders so that it's pluggable and can defer to
> bindings if required
> Fix up callbacks for the new structures
> Fix up promotion for the new structure
>
> Any further comments gratefully received.
>
> Regards
>
> Simon