Hi, Setting the HTTP port is just the degenerated case to configure base binding URIs. There are a lot of use cases:
1) Allow the embedded HTTP server (Tomcat/Jetty) to use a specific HTTP port 2) For multi-homed machine, configure which IP addresses the HTTP server should listen 3) For virtual hosts, we need to set the base URI to use the virtual host name 4) For a cluster environment, we need to set the base URI to use the cluster name As we know, some of the knowledge cannot be acquired by runtime to look up the hostname/IP. They need to be configured/customized. IMO, we should generalize the plugin here to introduce something like a BindingURIResolver so that it can: * Configure the base binding URIs based on the binding and protocol * Resolve the "uri" of a binding to a deployed URI (in some cases, maybe even more than one deployed URIs) On the client side, now we have Node.getEndpointAddress() which provides a reliable way to look up the deployed URIs without hard-coding. I would like to see something symmetric on the side side to handle the deployed URI. Thanks, Raymond ________________________________________________________________ Raymond Feng rf...@apache.org Apache Tuscany PMC member and committer: tuscany.apache.org Co-author of Tuscany SCA In Action book: www.tuscanyinaction.com Personal Web Site: www.enjoyjava.com ________________________________________________________________ On Apr 26, 2011, at 1:08 AM, Simon Laws wrote: > On Thu, Apr 21, 2011 at 9:09 AM, ant elder <antel...@apache.org> wrote: >> On Wed, Apr 20, 2011 at 3:28 PM, Simon Laws <simonsl...@googlemail.com> >> wrote: >>>> >>>> What is it needed for? If its just for tests to set the http port to >>>> default to 8085 instead of 8080 then there is a static field on the >>>> http server class which tests can set. >>>> >>>> ...ant >>>> >>> >>> So here's a scenario. One the same machine start two Tuscany nodes to >>> run two composites from the same domain that have components that talk >>> to each other over the default binding remoted using web services. >>> >> >> I can't see why that scenario shouldn't work ok with whats there now. >> Anyway, like i said earlier i didn't implement anything for the base >> URIs but it shouldn't be hard to do. It doesn't seem like the best >> approach to me though and i don't remember any scenarios being given >> in the past that explained why its necessary. >> >> ...ant >> > > I think we first need to agree (or not) whether we need to be able to > set HTTP port numbers. Only then can we establish what a suitable > mechanism is. Otherwise the two points become confused. > > Based on previous (and current based on the "Allow the lookup of > endpoint address by component/service/binding name from the Node API" > thread) experience I'm first asserting that we need to be able to set > HTTP port numbers in order that the user of the runtime is able to set > values other than the defaults chosen by Tuscany. I'm not saying how > these values should be set by the user. > > Simon > > -- > Apache Tuscany committer: tuscany.apache.org > Co-author of a book about Tuscany and SCA: tuscanyinaction.com