You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by "Marian, Radu" <ra...@bankofamerica.com> on 2008/04/28 17:14:25 UTC

Is there are simple straightforward way of creating a Compoisite

Hello,

I have spent quite a few time through ContributionServiceImpl class and
could not find a simple way to add a Composite to the contributiion -
given the InputStream of the composite URL.  I understand tuscany team
wants to provide the ease of use for compoistes to be discovered from
the file system.... However - IMO - the api should not prevent one from
loading/adding a composite from an InputStream.  

Why is everything have to be served from local file system?  Does the
sca spec mandate that?

Thanks,
Radu.

Re: Is there are simple straightforward way of creating a Compoisite

Posted by Simon Laws <si...@googlemail.com>.
On Wed, Apr 30, 2008 at 1:52 PM, ant elder <an...@gmail.com> wrote:

> On Wed, Apr 30, 2008 at 1:38 PM, Simon Laws <si...@googlemail.com>
> wrote:
>
> >
> >
> > On Wed, Apr 30, 2008 at 1:25 PM, ant elder <an...@apache.org> wrote:
> >
> > >
> > >
> > > On Wed, Apr 30, 2008 at 1:18 PM, Simon Laws <simonslaws@googlemail.com
> >
> > > wrote:
> > >
> > > > snip....
> > > >
> > > > >
> > > > > Cool thats really helpful. Ok so if we can have a Tomcat
> TuscanyHost
> > > > > (i.e.
> > > > > an extension of org.apache.catalina.core.StandardHost not related
> to
> > > > > the
> > > > > Tuscany host stuff)  that will get its addChild method called for
> > > > > each
> > > > > webapp and we can get a File to the root of the webbapp so call
> > > > > nodeFactory.createSCANode with that and treat each webapp as a
> > > > > seperate
> > > > > contribution which seems reasonable. That would give us a node per
> > > > > webapp
> > > > > which i'm not sure is good or bad till theres some answers to the
> > > > > "what is a
> > > > > node" question.
> > > >
> > > >
> > > > sounds ok to me.
> > > >
> > > >
> > > > >
> > > > >
> > > > > How do nodes talk to each other or become part of a bigger domain?
> > > > > Theres
> > > > > nothing in SCANode2Factory.newInstance().createSCANode or
> node.start
> > > > > that
> > > > > mentions anything about any domain?
> > > > >
> > > > >   ...ant
> > > > >
> > > >
> > > > They don't talk to each other, other other than at the application
> > > > level. If you want to have a node read it's configuration from the
> domain
> > > > you can use the
> > > > following factory method.
> > > >
> > > > public abstract SCANode2 createSCANode(String configurationURI);
> > > >
> > > > and provide the URI of the configuration that you want it to read.
> > > > e.g.
> > > >
> > > > node = factory.createSCANode("http://localhost:9990/node-image/NodeA
> > > > ");
> > > >
> > > > This URL is provided by the domain and is tailored specifically to
> > > > provide just the right configuration (the list of composite and
> contribution
> > > > URLs) for the node in question. NodeA in this case.
> > > >
> > > > Simon
> > > >
> > > >
> > > Now I'm lost again :)
> > >
> > > Stepping back a bit, what and how is the domain involved in this? What
> > > does it mean to "have a node read it's configuration from the domain"?
> > >
> > >    ...ant
> > >
> > >
> > Apologies. I'm probably confusing you here as I don't have a clear
> > picture. Two scenarios.
> >
> > 1 - the one we know and love where the webapp is self contained and runs
> a
> > node (SCADomain in our current host-webapp) to run the composite that it
> > contains.
> >
> > 2 - the distributed domain scenario. The last time we approached this we
> > had the node contacting the domain for endpoint information for those
> > targets that could not be resolved locally. This gave us start up
> problems.
> > This is still the role of the new domain but the way that the node gets
> this
> > information is different now. This is where I too am suggesting that the
> use
> > case is not clear.
> >
> > So if we agree that there are two slightly different scenarios we can
> > investigate them further.
> >
> > Simon
> >
>
> Agreed, here we are talking about that second one right? Or at least
> something different than the first anyway. Something like what we had
> described here - http://apache.markmail.org/message/ttssxoruzpndkado
>
> So  in the (2) above how does the "domain" get configured? In a previous
> email you said "the webapp will have been contributed to the domain for
> processing" is there any code i can look at showing that type of thing
> happening? And then how do you create a node from a configured domain?
>
>   ...ant
>

So there are three scenarios that have come up now

1 - Standalone webapp

2 - Distributed domiain webapp - reference/service connections to/from
components on other servers.
2a - Distributed domiain webapp - reference/service connection to/from
components running within the same container.

I have been considering that 2 and 2a take the same approach.

Looking at the webapp code now associated with node2 is seems that the
webapp servlet host constructs a URL based on

domainURL/nodeName

Where domainURL is configured through a property/environment var
(TUSCANY_DOMAIN) and nodeName is the context path of the webapp.

This URL is then used to call the domain implementation to retrieve the
fully configured composite and contributions that the node needs. In this
case the application that the webapp is going to run doesn't necessarily
need to be delivered with the webapp itself as the result of doing a GET on
domainURL/nodeName is a list of URLs and the running webapp can resolve
these URLs to anywhere. It could of course resolve them locally as well.

So this all seems OK but I'll have to try it out to really understand it.

Simon

Re: Is there are simple straightforward way of creating a Compoisite

Posted by ant elder <an...@gmail.com>.
On Wed, Apr 30, 2008 at 1:38 PM, Simon Laws <si...@googlemail.com>
wrote:

>
>
> On Wed, Apr 30, 2008 at 1:25 PM, ant elder <an...@apache.org> wrote:
>
> >
> >
> > On Wed, Apr 30, 2008 at 1:18 PM, Simon Laws <si...@googlemail.com>
> > wrote:
> >
> > > snip....
> > >
> > > >
> > > > Cool thats really helpful. Ok so if we can have a Tomcat TuscanyHost
> > > > (i.e.
> > > > an extension of org.apache.catalina.core.StandardHost not related to
> > > > the
> > > > Tuscany host stuff)  that will get its addChild method called for
> > > > each
> > > > webapp and we can get a File to the root of the webbapp so call
> > > > nodeFactory.createSCANode with that and treat each webapp as a
> > > > seperate
> > > > contribution which seems reasonable. That would give us a node per
> > > > webapp
> > > > which i'm not sure is good or bad till theres some answers to the
> > > > "what is a
> > > > node" question.
> > >
> > >
> > > sounds ok to me.
> > >
> > >
> > > >
> > > >
> > > > How do nodes talk to each other or become part of a bigger domain?
> > > > Theres
> > > > nothing in SCANode2Factory.newInstance().createSCANode or node.start
> > > > that
> > > > mentions anything about any domain?
> > > >
> > > >   ...ant
> > > >
> > >
> > > They don't talk to each other, other other than at the application
> > > level. If you want to have a node read it's configuration from the domain
> > > you can use the
> > > following factory method.
> > >
> > > public abstract SCANode2 createSCANode(String configurationURI);
> > >
> > > and provide the URI of the configuration that you want it to read.
> > > e.g.
> > >
> > > node = factory.createSCANode("http://localhost:9990/node-image/NodeA
> > > ");
> > >
> > > This URL is provided by the domain and is tailored specifically to
> > > provide just the right configuration (the list of composite and contribution
> > > URLs) for the node in question. NodeA in this case.
> > >
> > > Simon
> > >
> > >
> > Now I'm lost again :)
> >
> > Stepping back a bit, what and how is the domain involved in this? What
> > does it mean to "have a node read it's configuration from the domain"?
> >
> >    ...ant
> >
> >
> Apologies. I'm probably confusing you here as I don't have a clear
> picture. Two scenarios.
>
> 1 - the one we know and love where the webapp is self contained and runs a
> node (SCADomain in our current host-webapp) to run the composite that it
> contains.
>
> 2 - the distributed domain scenario. The last time we approached this we
> had the node contacting the domain for endpoint information for those
> targets that could not be resolved locally. This gave us start up problems.
> This is still the role of the new domain but the way that the node gets this
> information is different now. This is where I too am suggesting that the use
> case is not clear.
>
> So if we agree that there are two slightly different scenarios we can
> investigate them further.
>
> Simon
>

Agreed, here we are talking about that second one right? Or at least
something different than the first anyway. Something like what we had
described here - http://apache.markmail.org/message/ttssxoruzpndkado

So  in the (2) above how does the "domain" get configured? In a previous
email you said "the webapp will have been contributed to the domain for
processing" is there any code i can look at showing that type of thing
happening? And then how do you create a node from a configured domain?

   ...ant

Re: Is there are simple straightforward way of creating a Compoisite

Posted by ant elder <an...@apache.org>.
On Wed, Apr 30, 2008 at 1:18 PM, Simon Laws <si...@googlemail.com>
wrote:

> snip....
>
> >
> > Cool thats really helpful. Ok so if we can have a Tomcat TuscanyHost
> > (i.e.
> > an extension of org.apache.catalina.core.StandardHost not related to the
> > Tuscany host stuff)  that will get its addChild method called for each
> > webapp and we can get a File to the root of the webbapp so call
> > nodeFactory.createSCANode with that and treat each webapp as a seperate
> > contribution which seems reasonable. That would give us a node per
> > webapp
> > which i'm not sure is good or bad till theres some answers to the "what
> > is a
> > node" question.
>
>
> sounds ok to me.
>
>
> >
> >
> > How do nodes talk to each other or become part of a bigger domain?
> > Theres
> > nothing in SCANode2Factory.newInstance().createSCANode or node.start
> > that
> > mentions anything about any domain?
> >
> >   ...ant
> >
>
> They don't talk to each other, other other than at the application level.
> If you want to have a node read it's configuration from the domain you can
> use the
> following factory method.
>
> public abstract SCANode2 createSCANode(String configurationURI);
>
> and provide the URI of the configuration that you want it to read. e.g.
>
> node = factory.createSCANode("http://localhost:9990/node-image/NodeA");
>
> This URL is provided by the domain and is tailored specifically to provide
> just the right configuration (the list of composite and contribution URLs)
> for the node in question. NodeA in this case.
>
> Simon
>
>
Now I'm lost again :)

Stepping back a bit, what and how is the domain involved in this? What does
it mean to "have a node read it's configuration from the domain"?

   ...ant

Re: Is there are simple straightforward way of creating a Compoisite

Posted by ant elder <an...@gmail.com>.
On Wed, Apr 30, 2008 at 1:08 PM, Simon Laws <si...@googlemail.com>
wrote:

>
>
> On Wed, Apr 30, 2008 at 12:49 PM, ant elder <an...@apache.org> wrote:
>
> > On Wed, Apr 30, 2008 at 12:00 PM, Simon Laws <si...@googlemail.com>
> > wrote:
> >
> > >
> > >
> > > On Wed, Apr 30, 2008 at 11:12 AM, ant elder <an...@gmail.com>
> > wrote:
> > >
> > > > Bring this comment to the dev list:
> > > >
> > > > "The tuscany web app support doesn't use this evolving node
> > > > implementation
> > > > just yet. I don't imagine it would be difficult to plug it in ...."
> > > >  - http://apache.markmail.org/message/4hvdrcafhapy3kyy
> > > >
> > > > Coincidentally i was having a look at this just the other day after
> > that
> > > > user posted about support for Tomcat with multiple webapps in the
> > same
> > > > SCA
> > > > domain - http://apache.markmail.org/message/ttssxoruzpndkado.
> > > >
> > > > Could you give any pointers at all on where to start with using this
> > > > evolving node implementation like this? Theres no doc and I'm a bit
> > lost
> > > > on
> > > > even which Tuscany modules, samples or tests are current. What I'd
> > like
> > > > to
> > > > do is start exploring the updating of the old runtime-tomcat code to
> > use
> > > > the
> > > > latest domain stuff so that as Tomcat starts up webapps are detected
> > as
> > > > SCA
> > > > contributions and added to a single Tomcat SCA domain. One issue
> > that I
> > > > remember came up last time doing this is that as this happens during
> > > > Tomcat
> > > > startup no http communication can take place so all the
> > registrations of
> > > > contributions with the domain need to be in-vm.
> > > >
> > > >   ...ant
> > > >
> > >
> > > Hi Ant
> > >
> > > Am keen to work with you on this. While svn has been down I've spent
> > time
> > > to resurrect a load balancing demo I have on my local disc (not
> > checked in
> > > yet) and would like to update the webapps I'm using to the lasted
> > domain
> > > code but of course I can't.
> > >
> > > Here's a summary of what I think is current in terms of
> > > domain/node/runtime support (but have to admit that there is an amount
> > of
> > > guessing here).....
> > >
> > > sca/distribution/standalone - not sure but think it's redundant -
> > > forerunner of runtime-standalone?
> > > sca/distribution/tomcat - not sure but think it's redundant -
> > forerunner
> > > of runtime-tomcat?
> > > sca/distribution/war - not sure but think it's redundant - forerunner
> > of
> > > runtime-war?
> > > sca/distribution/webapp - not sure but think it's redundant
> > > sca/modules/domain - old domain SPI
> > > sca/modules/domain-api - old domain API
> > > sca/modules/domain-impl - old domain Implementation - has been
> > superseded
> > > by domain-manager
> > > sca/modules/domain-manager - new domain management application -
> > replaces
> > > domain-impl
> > > sca/modules/host-embedded - original single JVM domain implementation
> > -
> > > still used in most samples
> > > sca/modules/host-webapp - original webapp runtime - fires up tuscany
> > based
> > > on web.xml filter
> > > sca/modules/host-webapp-junit - not sure but have a feeling it's
> > something
> > > to do with running itests in different web containers
> > > sca/modules/node - old node SPI
> > > sca/modules/node-api - old node API
> > > sca/modules/node-impl - old node implementation that runs one or more
> > > composites in a single JVM as part of a distributed domain
> > > sca/modules/node2-api - new node API
> > > sca/modules/node2-impl - new node implementation. This node is coded
> > to
> > > read it's configuration as an atom feed from the new domain-manager
> > > sca/modules/node2-launcher - start up a node from the command line
> > > sca/modules/node2-launcher-webapp - had noticed this before - maybe
> > node2
> > > integration with webapps has been looked at. Let's see!
> > > sca/modules/runtime - I think this was the last attempt at providing a
> > > common runtime baseline to be specialized for different environments
> > > sca/modules/runtime-standalone - command line runtime
> > > sca/modules/runtime-tomcat - deep tomcat integration (IIRC)
> > > sca/modules/runtime-war - war rutime
> > > sca/modules/workspace - SPI for some of the machinery required to
> > process
> > > contributions at the domain level. Used by domain-manager
> > > sca/modules/workspace-impl - Implementation of the workspace
> > > sca/modules/workspace-xml - Reading/writing workspace as XML
> > >
> > > So can we get together here and work out what the true picture is and
> > how
> > > to mode modules/runtime* to node2. First things first I'm going to go
> > look
> > > at node2-launcher-webapp.
> > >
> > > I think the start up process for nodes in a webapp will potentially be
> > > easier now as the node is just reading atom feeds and not making soap
> > calls.
> > > Time will tell!
> > >
> > > Simon
> > >
> >
> > One more question - what is a node?
> >
> > May seem like a silly question but i'm not sure there's ever been much
> > consensus on a clear definition. Is it something for running a single
> > composite, or a single contribution, or a collection of related
> > contributions? How many nodes would there be on a Tomcat instance doing
> > what
> > that user has posted about, one per webapp, one per Tomcat instance?
> >
> >   ...ant
> >
>
> I don't think there has been consensus on this. There has been a gradual
> evolution of the ideas though.
>
> The term "Node" was originally coined to allow us to separately describe
> the code that runs a composite as opposed to the code that manages the
> domain and in particular how composites are allocated to nodes.
>
> The node2 code runs a single composite. It is provided with the URL of the
> composite and the URL of all contributions required by that composite in
> order to run.
>
> Based on the above we need one node for each composite we want to run. So
> assuming our web app holds a composite we need a node to run it.
>
> Question in my mind is how does this node identify which composite to run.
> What do we do at the moment with webapps? Do we use the list of deployable
> composites. Let me go see.
>
> Simon
>
>
Ah ok, i'd misunderstood before. So the Tuscany StandardHost addChild method
would need to scan the webapp looking for composites. Thats easyish -they'd
either been in the meta-inf/sca-deployables folder or there will be an
sca-contributions.xml although in that case will need to look in all the
folders and jars in the webapp reading every .composite file to find the
ones named in the sca-contributions.xml so it may be easier to get just
support for the sca-deployables ones working as a first attempt.  Either way
then for each compostite found call  nodeFactory.createSCANode passing on
the composite File and the webapp root for the contribution File.

Sound ok?

   ...ant

Re: Is there are simple straightforward way of creating a Compoisite

Posted by Simon Laws <si...@googlemail.com>.
On Wed, Apr 30, 2008 at 12:49 PM, ant elder <an...@apache.org> wrote:

> On Wed, Apr 30, 2008 at 12:00 PM, Simon Laws <si...@googlemail.com>
> wrote:
>
> >
> >
> > On Wed, Apr 30, 2008 at 11:12 AM, ant elder <an...@gmail.com> wrote:
> >
> > > Bring this comment to the dev list:
> > >
> > > "The tuscany web app support doesn't use this evolving node
> > > implementation
> > > just yet. I don't imagine it would be difficult to plug it in ...."
> > >  - http://apache.markmail.org/message/4hvdrcafhapy3kyy
> > >
> > > Coincidentally i was having a look at this just the other day after
> that
> > > user posted about support for Tomcat with multiple webapps in the same
> > > SCA
> > > domain - http://apache.markmail.org/message/ttssxoruzpndkado.
> > >
> > > Could you give any pointers at all on where to start with using this
> > > evolving node implementation like this? Theres no doc and I'm a bit
> lost
> > > on
> > > even which Tuscany modules, samples or tests are current. What I'd
> like
> > > to
> > > do is start exploring the updating of the old runtime-tomcat code to
> use
> > > the
> > > latest domain stuff so that as Tomcat starts up webapps are detected
> as
> > > SCA
> > > contributions and added to a single Tomcat SCA domain. One issue that
> I
> > > remember came up last time doing this is that as this happens during
> > > Tomcat
> > > startup no http communication can take place so all the registrations
> of
> > > contributions with the domain need to be in-vm.
> > >
> > >   ...ant
> > >
> >
> > Hi Ant
> >
> > Am keen to work with you on this. While svn has been down I've spent
> time
> > to resurrect a load balancing demo I have on my local disc (not checked
> in
> > yet) and would like to update the webapps I'm using to the lasted domain
> > code but of course I can't.
> >
> > Here's a summary of what I think is current in terms of
> > domain/node/runtime support (but have to admit that there is an amount
> of
> > guessing here).....
> >
> > sca/distribution/standalone - not sure but think it's redundant -
> > forerunner of runtime-standalone?
> > sca/distribution/tomcat - not sure but think it's redundant - forerunner
> > of runtime-tomcat?
> > sca/distribution/war - not sure but think it's redundant - forerunner of
> > runtime-war?
> > sca/distribution/webapp - not sure but think it's redundant
> > sca/modules/domain - old domain SPI
> > sca/modules/domain-api - old domain API
> > sca/modules/domain-impl - old domain Implementation - has been
> superseded
> > by domain-manager
> > sca/modules/domain-manager - new domain management application -
> replaces
> > domain-impl
> > sca/modules/host-embedded - original single JVM domain implementation -
> > still used in most samples
> > sca/modules/host-webapp - original webapp runtime - fires up tuscany
> based
> > on web.xml filter
> > sca/modules/host-webapp-junit - not sure but have a feeling it's
> something
> > to do with running itests in different web containers
> > sca/modules/node - old node SPI
> > sca/modules/node-api - old node API
> > sca/modules/node-impl - old node implementation that runs one or more
> > composites in a single JVM as part of a distributed domain
> > sca/modules/node2-api - new node API
> > sca/modules/node2-impl - new node implementation. This node is coded to
> > read it's configuration as an atom feed from the new domain-manager
> > sca/modules/node2-launcher - start up a node from the command line
> > sca/modules/node2-launcher-webapp - had noticed this before - maybe
> node2
> > integration with webapps has been looked at. Let's see!
> > sca/modules/runtime - I think this was the last attempt at providing a
> > common runtime baseline to be specialized for different environments
> > sca/modules/runtime-standalone - command line runtime
> > sca/modules/runtime-tomcat - deep tomcat integration (IIRC)
> > sca/modules/runtime-war - war rutime
> > sca/modules/workspace - SPI for some of the machinery required to
> process
> > contributions at the domain level. Used by domain-manager
> > sca/modules/workspace-impl - Implementation of the workspace
> > sca/modules/workspace-xml - Reading/writing workspace as XML
> >
> > So can we get together here and work out what the true picture is and
> how
> > to mode modules/runtime* to node2. First things first I'm going to go
> look
> > at node2-launcher-webapp.
> >
> > I think the start up process for nodes in a webapp will potentially be
> > easier now as the node is just reading atom feeds and not making soap
> calls.
> > Time will tell!
> >
> > Simon
> >
>
> One more question - what is a node?
>
> May seem like a silly question but i'm not sure there's ever been much
> consensus on a clear definition. Is it something for running a single
> composite, or a single contribution, or a collection of related
> contributions? How many nodes would there be on a Tomcat instance doing
> what
> that user has posted about, one per webapp, one per Tomcat instance?
>
>   ...ant
>

I don't think there has been consensus on this. There has been a gradual
evolution of the ideas though.

The term "Node" was originally coined to allow us to separately describe the
code that runs a composite as opposed to the code that manages the domain
and in particular how composites are allocated to nodes.

The node2 code runs a single composite. It is provided with the URL of the
composite and the URL of all contributions required by that composite in
order to run.

Based on the above we need one node for each composite we want to run. So
assuming our web app holds a composite we need a node to run it.

Question in my mind is how does this node identify which composite to run.
What do we do at the moment with webapps? Do we use the list of deployable
composites. Let me go see.

Simon

Re: Is there are simple straightforward way of creating a Compoisite

Posted by ant elder <an...@apache.org>.
On Wed, Apr 30, 2008 at 12:00 PM, Simon Laws <si...@googlemail.com>
wrote:

>
>
> On Wed, Apr 30, 2008 at 11:12 AM, ant elder <an...@gmail.com> wrote:
>
> > Bring this comment to the dev list:
> >
> > "The tuscany web app support doesn't use this evolving node
> > implementation
> > just yet. I don't imagine it would be difficult to plug it in ...."
> >  - http://apache.markmail.org/message/4hvdrcafhapy3kyy
> >
> > Coincidentally i was having a look at this just the other day after that
> > user posted about support for Tomcat with multiple webapps in the same
> > SCA
> > domain - http://apache.markmail.org/message/ttssxoruzpndkado.
> >
> > Could you give any pointers at all on where to start with using this
> > evolving node implementation like this? Theres no doc and I'm a bit lost
> > on
> > even which Tuscany modules, samples or tests are current. What I'd like
> > to
> > do is start exploring the updating of the old runtime-tomcat code to use
> > the
> > latest domain stuff so that as Tomcat starts up webapps are detected as
> > SCA
> > contributions and added to a single Tomcat SCA domain. One issue that I
> > remember came up last time doing this is that as this happens during
> > Tomcat
> > startup no http communication can take place so all the registrations of
> > contributions with the domain need to be in-vm.
> >
> >   ...ant
> >
>
> Hi Ant
>
> Am keen to work with you on this. While svn has been down I've spent time
> to resurrect a load balancing demo I have on my local disc (not checked in
> yet) and would like to update the webapps I'm using to the lasted domain
> code but of course I can't.
>
> Here's a summary of what I think is current in terms of
> domain/node/runtime support (but have to admit that there is an amount of
> guessing here).....
>
> sca/distribution/standalone - not sure but think it's redundant -
> forerunner of runtime-standalone?
> sca/distribution/tomcat - not sure but think it's redundant - forerunner
> of runtime-tomcat?
> sca/distribution/war - not sure but think it's redundant - forerunner of
> runtime-war?
> sca/distribution/webapp - not sure but think it's redundant
> sca/modules/domain - old domain SPI
> sca/modules/domain-api - old domain API
> sca/modules/domain-impl - old domain Implementation - has been superseded
> by domain-manager
> sca/modules/domain-manager - new domain management application - replaces
> domain-impl
> sca/modules/host-embedded - original single JVM domain implementation -
> still used in most samples
> sca/modules/host-webapp - original webapp runtime - fires up tuscany based
> on web.xml filter
> sca/modules/host-webapp-junit - not sure but have a feeling it's something
> to do with running itests in different web containers
> sca/modules/node - old node SPI
> sca/modules/node-api - old node API
> sca/modules/node-impl - old node implementation that runs one or more
> composites in a single JVM as part of a distributed domain
> sca/modules/node2-api - new node API
> sca/modules/node2-impl - new node implementation. This node is coded to
> read it's configuration as an atom feed from the new domain-manager
> sca/modules/node2-launcher - start up a node from the command line
> sca/modules/node2-launcher-webapp - had noticed this before - maybe node2
> integration with webapps has been looked at. Let's see!
> sca/modules/runtime - I think this was the last attempt at providing a
> common runtime baseline to be specialized for different environments
> sca/modules/runtime-standalone - command line runtime
> sca/modules/runtime-tomcat - deep tomcat integration (IIRC)
> sca/modules/runtime-war - war rutime
> sca/modules/workspace - SPI for some of the machinery required to process
> contributions at the domain level. Used by domain-manager
> sca/modules/workspace-impl - Implementation of the workspace
> sca/modules/workspace-xml - Reading/writing workspace as XML
>
> So can we get together here and work out what the true picture is and how
> to mode modules/runtime* to node2. First things first I'm going to go look
> at node2-launcher-webapp.
>
> I think the start up process for nodes in a webapp will potentially be
> easier now as the node is just reading atom feeds and not making soap calls.
> Time will tell!
>
> Simon
>

One more question - what is a node?

May seem like a silly question but i'm not sure there's ever been much
consensus on a clear definition. Is it something for running a single
composite, or a single contribution, or a collection of related
contributions? How many nodes would there be on a Tomcat instance doing what
that user has posted about, one per webapp, one per Tomcat instance?

   ...ant

Re: Is there are simple straightforward way of creating a Compoisite

Posted by ant elder <an...@gmail.com>.
On Wed, May 7, 2008 at 11:39 AM, ant elder <an...@gmail.com> wrote:

>
>
> On Wed, May 7, 2008 at 11:29 AM, Simon Laws <si...@googlemail.com>
> wrote:
>
> <snip>
>
>
>>> This is not quite what we need in the Tomcat case. I shouldn't need to
>>> write
>>> a NodeX.composite file for each webapp as we can say each webapp is a
>>> node,
>>> use the webapp name for the node name, and use the webapps
>>> meta-inf/sca-deployables or sca-contribution.xml to get all the
>>> composites.
>>>
>>> So i guess what i want is for the TuscanyStandardHost to start up an
>>> inial
>>
>>
>> What's the  "TuscanyStandardHost"? Does that exist yet?
>>
>
> Its the Tuscany implementation of the Tomcat StandardHost which is what
> gets control when Tomcat starts up and can cerate whatever domains and nodes
> are necessary for the webapps. There is an old one in the runtime-tomcat
> module but i'm right now trying to rewrite it to use all this new domain
> stuff.
>
>    ...ant
>
>
I've committed the updates i had for the TuscanyHost in r654467 its still
using just the old "standalone" SCADomain but it enables you to run SCA
webapps without any Tuscany stuff in the web.xml or webapp lib directory.
You point a Tomcat install at a Tuscany binary distribution install with two
updates to the Tomcat configuration:

- in tomcat conf/catalina.properties add the Tuscany Distro lib directory to
the common.loader path, eg:

common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar,/tuscany-sca-2.0-incubating-SNAPSHOT/lib/*.jar

- in tomcat conf/server.xml add the TuscanyHost class name to the localhost
definition, eg:
      <Host name="localhost"  appBase="webapps"
            className="org.apache.tuscany.sca.runtime.tomcat.TuscanyHost"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

Ideally we'd update org.apache.tuscany.sca.runtime.tomcat.TuscanyHost to use
the new distributed domain stuff, but Ive not been able to make much
progress with getting that to work, I'll start a new thread about that.

   ...ant

Re: Is there are simple straightforward way of creating a Compoisite

Posted by ant elder <an...@gmail.com>.
On Wed, May 7, 2008 at 11:29 AM, Simon Laws <si...@googlemail.com>
wrote:

<snip>


> > This is not quite what we need in the Tomcat case. I shouldn't need to
> > write
> > a NodeX.composite file for each webapp as we can say each webapp is a
> > node,
> > use the webapp name for the node name, and use the webapps
> > meta-inf/sca-deployables or sca-contribution.xml to get all the
> > composites.
> >
> > So i guess what i want is for the TuscanyStandardHost to start up an
> > inial
>
>
> What's the  "TuscanyStandardHost"? Does that exist yet?
>

Its the Tuscany implementation of the Tomcat StandardHost which is what gets
control when Tomcat starts up and can cerate whatever domains and nodes are
necessary for the webapps. There is an old one in the runtime-tomcat module
but i'm right now trying to rewrite it to use all this new domain stuff.

   ...ant

Re: Is there are simple straightforward way of creating a Compoisite

Posted by ant elder <an...@gmail.com>.
On Wed, May 7, 2008 at 11:29 AM, Simon Laws <si...@googlemail.com>
wrote:

>
> I'm not clear if the domain here is intended to be local to the webapp
> container, in which case it could reasonably do webapp processing on the
> local file system, or if it is a more general domain out there in the
> network somewhere. Asking the question in a different way, what is the use
> case here?
>
> 1. User creates a war including SCA artifacts
> 2. User contributes the war to the domain (Using the domian GUI)
> 3. Domain deploys the war to a webapp container chosen by the user
>
> or
>
> 1. User creates a war including SCA artifacts
> 2. User deploys the war to the webapp container, e.g. copies the war to
> the webapps folder
> 3. Tuscany/webapp integration configures Tuscany to run the artifacts in
> the war as part of a domain.
>
>
The second of those.

   ...ant

Re: Is there are simple straightforward way of creating a Compoisite

Posted by Simon Laws <si...@googlemail.com>.
On Wed, May 7, 2008 at 9:55 AM, ant elder <an...@apache.org> wrote:

> On Wed, Apr 30, 2008 at 1:18 PM, Simon Laws <si...@googlemail.com>
> wrote:
>
> > snip....
> >
> > >
> > > Cool thats really helpful. Ok so if we can have a Tomcat TuscanyHost
> > > (i.e.
> > > an extension of org.apache.catalina.core.StandardHost not related to
> the
> > > Tuscany host stuff)  that will get its addChild method called for each
> > > webapp and we can get a File to the root of the webbapp so call
> > > nodeFactory.createSCANode with that and treat each webapp as a
> seperate
> > > contribution which seems reasonable. That would give us a node per
> > > webapp
> > > which i'm not sure is good or bad till theres some answers to the
> "what
> > > is a
> > > node" question.
> >
> >
> > sounds ok to me.
> >
> >
> > >
> > >
> > > How do nodes talk to each other or become part of a bigger domain?
> > > Theres
> > > nothing in SCANode2Factory.newInstance().createSCANode or node.start
> > > that
> > > mentions anything about any domain?
> > >
> > >   ...ant
> > >
> >
> > They don't talk to each other, other other than at the application
> level.
> > If you want to have a node read it's configuration from the domain you
> can
> > use the
> > following factory method.
> >
> > public abstract SCANode2 createSCANode(String configurationURI);
> >
> > and provide the URI of the configuration that you want it to read. e.g.
> >
> > node = factory.createSCANode("http://localhost:9990/node-image/NodeA");
> >
> > This URL is provided by the domain and is tailored specifically to
> provide
> > just the right configuration (the list of composite and contribution
> URLs)
> > for the node in question. NodeA in this case.
> >
> > Simon
> >
> >
> Ok I've been digging around in the code a bit and think i understand that,
> but it will only work if there are pre-existing  .composite files
> describing
> each node when the domain starts up, right? Eg like the NodeA.composite,
> NodeB.composite etc in the calculator-distributed sample.


Agreed, that's the difference here compared to the old domain implementation
where nodes could "register" themselves. It was this registration process
that was causing the startup problems before. There are way of solving this
kind of problem, for example, there are several group membership protocols
out there, but the focus most recently has been on getting the contribution
model sorted rather than automating the creation of the node list.


>
> This is not quite what we need in the Tomcat case. I shouldn't need to
> write
> a NodeX.composite file for each webapp as we can say each webapp is a
> node,
> use the webapp name for the node name, and use the webapps
> meta-inf/sca-deployables or sca-contribution.xml to get all the
> composites.
>
> So i guess what i want is for the TuscanyStandardHost to start up an inial


What's the  "TuscanyStandardHost"? Does that exist yet?


> empty domain, then as each webapp is discovered to get the domain to
> create
> itself a node configuration from the webapp folder, and then have the
> TuscanyStandardHost call domain.createNode for the webapp and store that
> node in the webapps context.


I'm not clear if the domain here is intended to be local to the webapp
container, in which case it could reasonably do webapp processing on the
local file system, or if it is a more general domain out there in the
network somewhere. Asking the question in a different way, what is the use
case here?

1. User creates a war including SCA artifacts
2. User contributes the war to the domain (Using the domian GUI)
3. Domain deploys the war to a webapp container chosen by the user

or

1. User creates a war including SCA artifacts
2. User deploys the war to the webapp container, e.g. copies the war to the
webapps folder
3. Tuscany/webapp integration configures Tuscany to run the artifacts in the
war as part of a domain.

or something else.


>
> Does that sound reasonable? There doesn't seem to be APIs for that right
> now
> so if this approach sounds ok id like to try to add that.
>
>   ...ant
>

Simon

Re: Is there are simple straightforward way of creating a Compoisite

Posted by ant elder <an...@apache.org>.
On Wed, Apr 30, 2008 at 1:18 PM, Simon Laws <si...@googlemail.com>
wrote:

> snip....
>
> >
> > Cool thats really helpful. Ok so if we can have a Tomcat TuscanyHost
> > (i.e.
> > an extension of org.apache.catalina.core.StandardHost not related to the
> > Tuscany host stuff)  that will get its addChild method called for each
> > webapp and we can get a File to the root of the webbapp so call
> > nodeFactory.createSCANode with that and treat each webapp as a seperate
> > contribution which seems reasonable. That would give us a node per
> > webapp
> > which i'm not sure is good or bad till theres some answers to the "what
> > is a
> > node" question.
>
>
> sounds ok to me.
>
>
> >
> >
> > How do nodes talk to each other or become part of a bigger domain?
> > Theres
> > nothing in SCANode2Factory.newInstance().createSCANode or node.start
> > that
> > mentions anything about any domain?
> >
> >   ...ant
> >
>
> They don't talk to each other, other other than at the application level.
> If you want to have a node read it's configuration from the domain you can
> use the
> following factory method.
>
> public abstract SCANode2 createSCANode(String configurationURI);
>
> and provide the URI of the configuration that you want it to read. e.g.
>
> node = factory.createSCANode("http://localhost:9990/node-image/NodeA");
>
> This URL is provided by the domain and is tailored specifically to provide
> just the right configuration (the list of composite and contribution URLs)
> for the node in question. NodeA in this case.
>
> Simon
>
>
Ok I've been digging around in the code a bit and think i understand that,
but it will only work if there are pre-existing  .composite files describing
each node when the domain starts up, right? Eg like the NodeA.composite,
NodeB.composite etc in the calculator-distributed sample.

This is not quite what we need in the Tomcat case. I shouldn't need to write
a NodeX.composite file for each webapp as we can say each webapp is a node,
use the webapp name for the node name, and use the webapps
meta-inf/sca-deployables or sca-contribution.xml to get all the composites.

So i guess what i want is for the TuscanyStandardHost to start up an inial
empty domain, then as each webapp is discovered to get the domain to create
itself a node configuration from the webapp folder, and then have the
TuscanyStandardHost call domain.createNode for the webapp and store that
node in the webapps context.

Does that sound reasonable? There doesn't seem to be APIs for that right now
so if this approach sounds ok id like to try to add that.

   ...ant

Re: Is there are simple straightforward way of creating a Compoisite

Posted by Simon Laws <si...@googlemail.com>.
snip....

>
> Cool thats really helpful. Ok so if we can have a Tomcat TuscanyHost (i.e.
> an extension of org.apache.catalina.core.StandardHost not related to the
> Tuscany host stuff)  that will get its addChild method called for each
> webapp and we can get a File to the root of the webbapp so call
> nodeFactory.createSCANode with that and treat each webapp as a seperate
> contribution which seems reasonable. That would give us a node per webapp
> which i'm not sure is good or bad till theres some answers to the "what is
> a
> node" question.


sounds ok to me.


>
>
> How do nodes talk to each other or become part of a bigger domain? Theres
> nothing in SCANode2Factory.newInstance().createSCANode or node.start that
> mentions anything about any domain?
>
>   ...ant
>

They don't talk to each other, other other than at the application level. If
you want to have a node read it's configuration from the domain you can use
the
following factory method.

public abstract SCANode2 createSCANode(String configurationURI);

and provide the URI of the configuration that you want it to read. e.g.

node = factory.createSCANode("http://localhost:9990/node-image/NodeA");

This URL is provided by the domain and is tailored specifically to provide
just the right configuration (the list of composite and contribution URLs)
for the node in question. NodeA in this case.

Simon

Re: Is there are simple straightforward way of creating a Compoisite

Posted by ant elder <an...@gmail.com>.
On Wed, Apr 30, 2008 at 12:52 PM, Simon Laws <si...@googlemail.com>
wrote:

>
>
> On Wed, Apr 30, 2008 at 12:40 PM, ant elder <an...@apache.org> wrote:
>
> >
> >
> > On Wed, Apr 30, 2008 at 12:00 PM, Simon Laws <si...@googlemail.com>
> > wrote:
> >
> > >
> > >
> > > On Wed, Apr 30, 2008 at 11:12 AM, ant elder <an...@gmail.com>
> > > wrote:
> > >
> > > > Bring this comment to the dev list:
> > > >
> > > > "The tuscany web app support doesn't use this evolving node
> > > > implementation
> > > > just yet. I don't imagine it would be difficult to plug it in ...."
> > > >  - http://apache.markmail.org/message/4hvdrcafhapy3kyy
> > > >
> > > > Coincidentally i was having a look at this just the other day after
> > > > that
> > > > user posted about support for Tomcat with multiple webapps in the
> > > > same SCA
> > > > domain - http://apache.markmail.org/message/ttssxoruzpndkado.
> > > >
> > > > Could you give any pointers at all on where to start with using this
> > > > evolving node implementation like this? Theres no doc and I'm a bit
> > > > lost on
> > > > even which Tuscany modules, samples or tests are current. What I'd
> > > > like to
> > > > do is start exploring the updating of the old runtime-tomcat code to
> > > > use the
> > > > latest domain stuff so that as Tomcat starts up webapps are detected
> > > > as SCA
> > > > contributions and added to a single Tomcat SCA domain. One issue
> > > > that I
> > > > remember came up last time doing this is that as this happens during
> > > > Tomcat
> > > > startup no http communication can take place so all the
> > > > registrations of
> > > > contributions with the domain need to be in-vm.
> > > >
> > > >   ...ant
> > > >
> > >
> > > Hi Ant
> > >
> > > Am keen to work with you on this. While svn has been down I've spent
> > > time to resurrect a load balancing demo I have on my local disc (not checked
> > > in yet) and would like to update the webapps I'm using to the lasted domain
> > > code but of course I can't.
> > >
> > > Here's a summary of what I think is current in terms of
> > > domain/node/runtime support (but have to admit that there is an amount of
> > > guessing here).....
> > >
> > > sca/distribution/standalone - not sure but think it's redundant -
> > > forerunner of runtime-standalone?
> > > sca/distribution/tomcat - not sure but think it's redundant -
> > > forerunner of runtime-tomcat?
> > > sca/distribution/war - not sure but think it's redundant - forerunner
> > > of runtime-war?
> > > sca/distribution/webapp - not sure but think it's redundant
> > > sca/modules/domain - old domain SPI
> > > sca/modules/domain-api - old domain API
> > > sca/modules/domain-impl - old domain Implementation - has been
> > > superseded by domain-manager
> > > sca/modules/domain-manager - new domain management application -
> > > replaces domain-impl
> > > sca/modules/host-embedded - original single JVM domain implementation
> > > - still used in most samples
> > > sca/modules/host-webapp - original webapp runtime - fires up tuscany
> > > based on web.xml filter
> > > sca/modules/host-webapp-junit - not sure but have a feeling it's
> > > something to do with running itests in different web containers
> > > sca/modules/node - old node SPI
> > > sca/modules/node-api - old node API
> > > sca/modules/node-impl - old node implementation that runs one or more
> > > composites in a single JVM as part of a distributed domain
> > > sca/modules/node2-api - new node API
> > > sca/modules/node2-impl - new node implementation. This node is coded
> > > to read it's configuration as an atom feed from the new domain-manager
> > > sca/modules/node2-launcher - start up a node from the command line
> > > sca/modules/node2-launcher-webapp - had noticed this before - maybe
> > > node2 integration with webapps has been looked at. Let's see!
> > > sca/modules/runtime - I think this was the last attempt at providing a
> > > common runtime baseline to be specialized for different environments
> > > sca/modules/runtime-standalone - command line runtime
> > > sca/modules/runtime-tomcat - deep tomcat integration (IIRC)
> > > sca/modules/runtime-war - war rutime
> > > sca/modules/workspace - SPI for some of the machinery required to
> > > process contributions at the domain level. Used by domain-manager
> > > sca/modules/workspace-impl - Implementation of the workspace
> > > sca/modules/workspace-xml - Reading/writing workspace as XML
> > >
> > > So can we get together here and work out what the true picture is and
> > > how to mode modules/runtime* to node2. First things first I'm going to go
> > > look at node2-launcher-webapp.
> > >
> > > I think the start up process for nodes in a webapp will potentially be
> > > easier now as the node is just reading atom feeds and not making soap calls.
> > > Time will tell!
> > >
> > > Simon
> > >
> >
> > Great, working together would be good and i'm sure make getting
> > somewhere useful happen much quicker :)
> >
> > Thanks for the list of module statuses thats helpful, i'll also go look
> > the node2-launcher-webapp one.
> >
> > The comment on the use of atom feeds is interesting. To be honest i'd
> > hope we could have a way to avoid that being needed in this Tomcat use case,
> > or at least being optional. One issue we had last time when we tried to do
> > this was that there had to be a separate standalone "domain manager" running
> > before you could start up a Tomcat instance, and that sucks quite a bit IMHO
> > so i'd like to try to get a design from the beginning where its not needed.
> > This will all be happening in a single JVM and with the code bootstrapping
> > Tuscany being at the "top" classloader so everything should be accessible to
> > just make direct SPI calls to configure a domain instead of going via a
> > remote binding shouldn't it?  There have been some emails recently about the
> > domain/workspace SPIs i guess i need to go read more closely what they were
> > about.
> >
> >     ...ant
> >
> >
> Also, the node is setup so that there are several ways to provide the
> details of the composite/contributions that it needs (this is what started
> this off on the user list). When I say that the node is configured via an
> atom feed what this means is that the node reads the URL of the composite to
> run and the contributions that requires from and atom feed. It then uses
> these URLs to go get the composite/contributions in question. You can
> provide these URLs directly without using the feed. For example, I updated
> the validation tests, e.g  [1], to make the latest node read from the file
> system. No domain  manager involved. Here's the code...
>
> SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
> node = nodeFactory.createSCANode(new
> File("src/main/resources/DuplicateComponentName/Calculator.composite").toURL().toString(),
>                                                       new
> SCAContribution("TestContribution",
>
>                                                                       new
> File("src/main/resources/DuplicateComponentName").toURL().toString()));
> node.start();
> calculatorService = ((SCAClient)node).getService(CalculatorService.class,
> "CalculatorServiceComponent");
>
> So a little bit more complicated that what we have in host-embedded. The
> parameters to this version of createSCANode are
>
> URL to composite
> List of Contributions (each having a URI and a URL)
>
> I quite like this very explicit specification but we could add the helper
> method back in so, for sample running, we could do something like
>
> node =
> SCANode2Factory.createSCANodeWithComposite("DuplicateComponentName/Calculator.composite");
>
> Regards
>
> Simon
>
> [1]
> http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/itest/validation/src/test/java/calculator/DuplicateComponentNameTestCase.java


Cool thats really helpful. Ok so if we can have a Tomcat TuscanyHost (i.e.
an extension of org.apache.catalina.core.StandardHost not related to the
Tuscany host stuff)  that will get its addChild method called for each
webapp and we can get a File to the root of the webbapp so call
nodeFactory.createSCANode with that and treat each webapp as a seperate
contribution which seems reasonable. That would give us a node per webapp
which i'm not sure is good or bad till theres some answers to the "what is a
node" question.

How do nodes talk to each other or become part of a bigger domain? Theres
nothing in SCANode2Factory.newInstance().createSCANode or node.start that
mentions anything about any domain?

   ...ant

Re: Is there are simple straightforward way of creating a Compoisite

Posted by ant elder <an...@apache.org>.
On Wed, Apr 30, 2008 at 12:00 PM, Simon Laws <si...@googlemail.com>
wrote:

>
>
> On Wed, Apr 30, 2008 at 11:12 AM, ant elder <an...@gmail.com> wrote:
>
> > Bring this comment to the dev list:
> >
> > "The tuscany web app support doesn't use this evolving node
> > implementation
> > just yet. I don't imagine it would be difficult to plug it in ...."
> >  - http://apache.markmail.org/message/4hvdrcafhapy3kyy
> >
> > Coincidentally i was having a look at this just the other day after that
> > user posted about support for Tomcat with multiple webapps in the same
> > SCA
> > domain - http://apache.markmail.org/message/ttssxoruzpndkado.
> >
> > Could you give any pointers at all on where to start with using this
> > evolving node implementation like this? Theres no doc and I'm a bit lost
> > on
> > even which Tuscany modules, samples or tests are current. What I'd like
> > to
> > do is start exploring the updating of the old runtime-tomcat code to use
> > the
> > latest domain stuff so that as Tomcat starts up webapps are detected as
> > SCA
> > contributions and added to a single Tomcat SCA domain. One issue that I
> > remember came up last time doing this is that as this happens during
> > Tomcat
> > startup no http communication can take place so all the registrations of
> > contributions with the domain need to be in-vm.
> >
> >   ...ant
> >
>
> Hi Ant
>
> Am keen to work with you on this. While svn has been down I've spent time
> to resurrect a load balancing demo I have on my local disc (not checked in
> yet) and would like to update the webapps I'm using to the lasted domain
> code but of course I can't.
>
> Here's a summary of what I think is current in terms of
> domain/node/runtime support (but have to admit that there is an amount of
> guessing here).....
>
> sca/distribution/standalone - not sure but think it's redundant -
> forerunner of runtime-standalone?
> sca/distribution/tomcat - not sure but think it's redundant - forerunner
> of runtime-tomcat?
> sca/distribution/war - not sure but think it's redundant - forerunner of
> runtime-war?
> sca/distribution/webapp - not sure but think it's redundant
> sca/modules/domain - old domain SPI
> sca/modules/domain-api - old domain API
> sca/modules/domain-impl - old domain Implementation - has been superseded
> by domain-manager
> sca/modules/domain-manager - new domain management application - replaces
> domain-impl
> sca/modules/host-embedded - original single JVM domain implementation -
> still used in most samples
> sca/modules/host-webapp - original webapp runtime - fires up tuscany based
> on web.xml filter
> sca/modules/host-webapp-junit - not sure but have a feeling it's something
> to do with running itests in different web containers
> sca/modules/node - old node SPI
> sca/modules/node-api - old node API
> sca/modules/node-impl - old node implementation that runs one or more
> composites in a single JVM as part of a distributed domain
> sca/modules/node2-api - new node API
> sca/modules/node2-impl - new node implementation. This node is coded to
> read it's configuration as an atom feed from the new domain-manager
> sca/modules/node2-launcher - start up a node from the command line
> sca/modules/node2-launcher-webapp - had noticed this before - maybe node2
> integration with webapps has been looked at. Let's see!
> sca/modules/runtime - I think this was the last attempt at providing a
> common runtime baseline to be specialized for different environments
> sca/modules/runtime-standalone - command line runtime
> sca/modules/runtime-tomcat - deep tomcat integration (IIRC)
> sca/modules/runtime-war - war rutime
> sca/modules/workspace - SPI for some of the machinery required to process
> contributions at the domain level. Used by domain-manager
> sca/modules/workspace-impl - Implementation of the workspace
> sca/modules/workspace-xml - Reading/writing workspace as XML
>
> So can we get together here and work out what the true picture is and how
> to mode modules/runtime* to node2. First things first I'm going to go look
> at node2-launcher-webapp.
>
> I think the start up process for nodes in a webapp will potentially be
> easier now as the node is just reading atom feeds and not making soap calls.
> Time will tell!
>
> Simon
>

Great, working together would be good and i'm sure make getting somewhere
useful happen much quicker :)

Thanks for the list of module statuses thats helpful, i'll also go look the
node2-launcher-webapp one.

The comment on the use of atom feeds is interesting. To be honest i'd hope
we could have a way to avoid that being needed in this Tomcat use case, or
at least being optional. One issue we had last time when we tried to do this
was that there had to be a separate standalone "domain manager" running
before you could start up a Tomcat instance, and that sucks quite a bit IMHO
so i'd like to try to get a design from the beginning where its not needed.
This will all be happening in a single JVM and with the code bootstrapping
Tuscany being at the "top" classloader so everything should be accessible to
just make direct SPI calls to configure a domain instead of going via a
remote binding shouldn't it?  There have been some emails recently about the
domain/workspace SPIs i guess i need to go read more closely what they were
about.

    ...ant

Re: Is there are simple straightforward way of creating a Compoisite

Posted by Simon Laws <si...@googlemail.com>.
On Wed, Apr 30, 2008 at 12:00 PM, Simon Laws <si...@googlemail.com>
wrote:

>
>
> On Wed, Apr 30, 2008 at 11:12 AM, ant elder <an...@gmail.com> wrote:
>
> > Bring this comment to the dev list:
> >
> > "The tuscany web app support doesn't use this evolving node
> > implementation
> > just yet. I don't imagine it would be difficult to plug it in ...."
> >  - http://apache.markmail.org/message/4hvdrcafhapy3kyy
> >
> > Coincidentally i was having a look at this just the other day after that
> > user posted about support for Tomcat with multiple webapps in the same
> > SCA
> > domain - http://apache.markmail.org/message/ttssxoruzpndkado.
> >
> > Could you give any pointers at all on where to start with using this
> > evolving node implementation like this? Theres no doc and I'm a bit lost
> > on
> > even which Tuscany modules, samples or tests are current. What I'd like
> > to
> > do is start exploring the updating of the old runtime-tomcat code to use
> > the
> > latest domain stuff so that as Tomcat starts up webapps are detected as
> > SCA
> > contributions and added to a single Tomcat SCA domain. One issue that I
> > remember came up last time doing this is that as this happens during
> > Tomcat
> > startup no http communication can take place so all the registrations of
> > contributions with the domain need to be in-vm.
> >
> >   ...ant
> >
>
> Hi Ant
>
> Am keen to work with you on this. While svn has been down I've spent time
> to resurrect a load balancing demo I have on my local disc (not checked in
> yet) and would like to update the webapps I'm using to the lasted domain
> code but of course I can't.
>
> Here's a summary of what I think is current in terms of
> domain/node/runtime support (but have to admit that there is an amount of
> guessing here).....
>
> sca/distribution/standalone - not sure but think it's redundant -
> forerunner of runtime-standalone?
> sca/distribution/tomcat - not sure but think it's redundant - forerunner
> of runtime-tomcat?
> sca/distribution/war - not sure but think it's redundant - forerunner of
> runtime-war?
> sca/distribution/webapp - not sure but think it's redundant
> sca/modules/domain - old domain SPI
> sca/modules/domain-api - old domain API
> sca/modules/domain-impl - old domain Implementation - has been superseded
> by domain-manager
> sca/modules/domain-manager - new domain management application - replaces
> domain-impl
> sca/modules/host-embedded - original single JVM domain implementation -
> still used in most samples
> sca/modules/host-webapp - original webapp runtime - fires up tuscany based
> on web.xml filter
> sca/modules/host-webapp-junit - not sure but have a feeling it's something
> to do with running itests in different web containers
> sca/modules/node - old node SPI
> sca/modules/node-api - old node API
> sca/modules/node-impl - old node implementation that runs one or more
> composites in a single JVM as part of a distributed domain
> sca/modules/node2-api - new node API
> sca/modules/node2-impl - new node implementation. This node is coded to
> read it's configuration as an atom feed from the new domain-manager
> sca/modules/node2-launcher - start up a node from the command line
> sca/modules/node2-launcher-webapp - had noticed this before - maybe node2
> integration with webapps has been looked at. Let's see!
> sca/modules/runtime - I think this was the last attempt at providing a
> common runtime baseline to be specialized for different environments
> sca/modules/runtime-standalone - command line runtime
> sca/modules/runtime-tomcat - deep tomcat integration (IIRC)
> sca/modules/runtime-war - war rutime
> sca/modules/workspace - SPI for some of the machinery required to process
> contributions at the domain level. Used by domain-manager
> sca/modules/workspace-impl - Implementation of the workspace
> sca/modules/workspace-xml - Reading/writing workspace as XML
>
> So can we get together here and work out what the true picture is and how
> to mode modules/runtime* to node2. First things first I'm going to go look
> at node2-launcher-webapp.
>
> I think the start up process for nodes in a webapp will potentially be
> easier now as the node is just reading atom feeds and not making soap calls.
> Time will tell!
>
> Simon
>

A couple more to add to the list...

sca/modules/implementation-node - a model of a node in the distributed
domain, assigns a composite to the node and provides default binding details
sca/modules/implementation-node-xml - readers/writers for the model
sca/modules/implementation-node-runtime - some launchers and some web app
stuff in here also
sca/samples/calculator-distributed - a basic sample that uses the new
domain/node code
sca/tutorial/* - a multi composite store application that uses the new
domain/node code

Simon

Re: Is there are simple straightforward way of creating a Compoisite

Posted by Simon Laws <si...@googlemail.com>.
On Wed, Apr 30, 2008 at 11:12 AM, ant elder <an...@gmail.com> wrote:

> Bring this comment to the dev list:
>
> "The tuscany web app support doesn't use this evolving node implementation
> just yet. I don't imagine it would be difficult to plug it in ...."
>  - http://apache.markmail.org/message/4hvdrcafhapy3kyy
>
> Coincidentally i was having a look at this just the other day after that
> user posted about support for Tomcat with multiple webapps in the same SCA
> domain - http://apache.markmail.org/message/ttssxoruzpndkado.
>
> Could you give any pointers at all on where to start with using this
> evolving node implementation like this? Theres no doc and I'm a bit lost
> on
> even which Tuscany modules, samples or tests are current. What I'd like to
> do is start exploring the updating of the old runtime-tomcat code to use
> the
> latest domain stuff so that as Tomcat starts up webapps are detected as
> SCA
> contributions and added to a single Tomcat SCA domain. One issue that I
> remember came up last time doing this is that as this happens during
> Tomcat
> startup no http communication can take place so all the registrations of
> contributions with the domain need to be in-vm.
>
>   ...ant
>

Hi Ant

Am keen to work with you on this. While svn has been down I've spent time to
resurrect a load balancing demo I have on my local disc (not checked in yet)
and would like to update the webapps I'm using to the lasted domain code but
of course I can't.

Here's a summary of what I think is current in terms of domain/node/runtime
support (but have to admit that there is an amount of guessing here).....

sca/distribution/standalone - not sure but think it's redundant - forerunner
of runtime-standalone?
sca/distribution/tomcat - not sure but think it's redundant - forerunner of
runtime-tomcat?
sca/distribution/war - not sure but think it's redundant - forerunner of
runtime-war?
sca/distribution/webapp - not sure but think it's redundant
sca/modules/domain - old domain SPI
sca/modules/domain-api - old domain API
sca/modules/domain-impl - old domain Implementation - has been superseded by
domain-manager
sca/modules/domain-manager - new domain management application - replaces
domain-impl
sca/modules/host-embedded - original single JVM domain implementation -
still used in most samples
sca/modules/host-webapp - original webapp runtime - fires up tuscany based
on web.xml filter
sca/modules/host-webapp-junit - not sure but have a feeling it's something
to do with running itests in different web containers
sca/modules/node - old node SPI
sca/modules/node-api - old node API
sca/modules/node-impl - old node implementation that runs one or more
composites in a single JVM as part of a distributed domain
sca/modules/node2-api - new node API
sca/modules/node2-impl - new node implementation. This node is coded to read
it's configuration as an atom feed from the new domain-manager
sca/modules/node2-launcher - start up a node from the command line
sca/modules/node2-launcher-webapp - had noticed this before - maybe node2
integration with webapps has been looked at. Let's see!
sca/modules/runtime - I think this was the last attempt at providing a
common runtime baseline to be specialized for different environments
sca/modules/runtime-standalone - command line runtime
sca/modules/runtime-tomcat - deep tomcat integration (IIRC)
sca/modules/runtime-war - war rutime
sca/modules/workspace - SPI for some of the machinery required to process
contributions at the domain level. Used by domain-manager
sca/modules/workspace-impl - Implementation of the workspace
sca/modules/workspace-xml - Reading/writing workspace as XML

So can we get together here and work out what the true picture is and how to
mode modules/runtime* to node2. First things first I'm going to go look at
node2-launcher-webapp.

I think the start up process for nodes in a webapp will potentially be
easier now as the node is just reading atom feeds and not making soap calls.
Time will tell!

Simon

Fwd: Is there are simple straightforward way of creating a Compoisite

Posted by ant elder <an...@gmail.com>.
Bring this comment to the dev list:

"The tuscany web app support doesn't use this evolving node implementation
just yet. I don't imagine it would be difficult to plug it in ...."
  - http://apache.markmail.org/message/4hvdrcafhapy3kyy

Coincidentally i was having a look at this just the other day after that
user posted about support for Tomcat with multiple webapps in the same SCA
domain - http://apache.markmail.org/message/ttssxoruzpndkado.

Could you give any pointers at all on where to start with using this
evolving node implementation like this? Theres no doc and I'm a bit lost on
even which Tuscany modules, samples or tests are current. What I'd like to
do is start exploring the updating of the old runtime-tomcat code to use the
latest domain stuff so that as Tomcat starts up webapps are detected as SCA
contributions and added to a single Tomcat SCA domain. One issue that I
remember came up last time doing this is that as this happens during Tomcat
startup no http communication can take place so all the registrations of
contributions with the domain need to be in-vm.

   ...ant

RE: Is there are simple straightforward way of creating a Compoisite

Posted by "Marian, Radu" <ra...@bankofamerica.com>.
Simon,

Thanks for all your help again - very timely too!

As far as web app contributions.  Our intent is to separated business
metadata as much as possible from infrastructure metadata.  

By business metadata I mean - xsd, wsdl, xq, sql, bpel - basically
anything dealing with business message structure or business process
(long running or not), e.t.c, and of course - .composite files too since
it has references to business metatada.

By infrastructure metadata I mean the binaries (java classes) that are
generic enough to serve a given business use case.  So the
infrastructure metadata contribution is loaded in my case as follows:
	  URL urlServiceProviderClassesDir =
getServletContext().getResource("/WEB-INF/classes");

Subsequently all business metadata is hosted centrally and separately
from service provider deployment units.  So the business metatdata is
loaded through the .composite as follows:
	  URL urlComposite = new
URL("http://localhost:7001/domain/metadata/<service.provider/versionN>/C
onsumerFacade.composite");
        String sCompositeContents =
UtilityHelper.getStringFromResource(urlComposite);
        SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
        SCANode2Factory.SCAContribution contribution = 
		new SCANode2Factory.SCAContribution("Service Provider
Classes", urlServiceProviderClassesDir.toString());
    	  node = nodeFactory.createSCANode(urlComposite.toString(),
sCompositeContents, contribution);
    	
    	  node.start();
        lifeCycleProcessor =
((SCAClient)node).getService(LifeCycleProcessorImpl.class,
"ConsumerFacadeLifecycleComponent");

I am looking forward to dynamically execute the process piece (in my
case not bpel - short running process).  So that I can reuse the same
infrastructure over and over for other type of service provider
implmentations - the only thing that would change is the .composite.

Note - in my poc I am not using any data binding nor OR frameworks -
xquery works directly on the xml.  Java class method signature is a
simple xml string in xml string out.  This helps keeping infrastructure
metadata reusable but also stimulates reuse of the separated business
metadata.

Hope that perspective helps provide one of many feedbacks...   I am
currently develping this poc and would like to contribute it in a form
of a sample or tutorial to tuscany.  But need to fine tune my rusted dev
skills ... it takes time.

Regards,
Radu Marian
CRM Services Architecture Team
Bank of America, Charlotte NC
(980) 387-6233
radu.marian@bankofamerica.com

-----Original Message-----
From: Simon Laws [mailto:simonslaws@googlemail.com] 
Sent: Tuesday, April 29, 2008 1:29 PM
To: tuscany-user@ws.apache.org
Subject: Re: Is there are simple straightforward way of creating a
Compoisite

On Tue, Apr 29, 2008 at 4:49 PM, Marian, Radu
<ra...@bankofamerica.com>
wrote:

> Simon,
>
> Thanks for your reply.  I have actually changed the code to:
>        SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
>        SCANode2Factory.SCAContribution contribution = new 
> SCANode2Factory.SCAContribution("Service Provider Classes", 
> urlServiceProviderClassesDir.toString());
>        node = nodeFactory.createSCANode(urlComposite.toString(),
> sCompositeContents, contribution);
>
>        node.start();
>        lifeCycleProcessor =
> ((SCAClient)node).getService(LifeCycleProcessorImpl.class,
> "ConsumerFacadeLifecycleComponent");
>
> Works ok - I am in the middle of debugging.
>
> Question - do I need to configure TuscanyServletFilter in web.xml?  I 
> am using node2 api.
>
> Thanks,
> Radu Marian
> CRM Services Architecture Team
> Bank of America, Charlotte NC
> (980) 387-6233
> radu.marian@bankofamerica.com
>
> -----Original Message-----
> From: Simon Laws [mailto:simonslaws@googlemail.com]
> Sent: Tuesday, April 29, 2008 10:49 AM
> To: tuscany-user@ws.apache.org
> Subject: Re: Is there are simple straightforward way of creating a 
> Compoisite
>
> On Mon, Apr 28, 2008 at 6:27 PM, Simon Laws 
> <si...@googlemail.com>
> wrote:
>
> >
> >
> > On Mon, Apr 28, 2008 at 5:36 PM, Marian, Radu < 
> > radu.marian@bankofamerica.com> wrote:
> >
> > > Simon,
> > >
> > > Thanks for your prompt response.  I hope the following api will 
> > > let me do what I need - compositeContent :
> > >     /**
> > >     * Creates a new SCA node.
> > >     *
> > >     * @param compositeURI the URI of the composite to use
> > >     * @param compositeContent the XML content of the composite to
> use
> > >     * @param contributions the URI of the contributions that 
> > > provides the composites and related artifacts
> > >     * @return a new SCA node.
> > >     */
> > >    public abstract SCANode2 createSCANode(String compositeURI, 
> > > String compositeContent, SCAContribution... contributions);
> > >
> > > However I could not find it in the latest 1.2 release... :( sorce 
> > > code or binaries...
> > >
> > > Any idea?  Should I get a nightly?
> > >
> > > Regards,
> > > Radu Marian
> > > CRM Services Architecture Team
> > > Bank of America, Charlotte NC
> > > (980) 387-6233
> > > radu.marian@bankofamerica.com
> > >
> > > -----Original Message-----
> > > From: Simon Laws [mailto:simonslaws@googlemail.com]
> > > Sent: Monday, April 28, 2008 11:54 AM
> > > To: tuscany-user@ws.apache.org
> > > Subject: Re: Is there are simple straightforward way of creating a

> > > Compoisite
> > >
> > > On Mon, Apr 28, 2008 at 4:14 PM, Marian, Radu 
> > > <ra...@bankofamerica.com>
> > > wrote:
> > >
> > > > Hello,
> > > >
> > > > I have spent quite a few time through ContributionServiceImpl 
> > > > class and could not find a simple way to add a Composite to the 
> > > > contributiion - given the InputStream of the composite URL.  I 
> > > > understand tuscany team wants to provide the ease of use for 
> > > > compoistes to be discovered from the file system.... However - 
> > > > IMO
>
> > > > - the api should not prevent one from loading/adding a composite

> > > > from an
> > > InputStream.
> > > >
> > > > Why is everything have to be served from local file system?  
> > > > Does the sca spec mandate that?
> > > >
> > > > Thanks,
> > > > Radu.
> > > >
> > >
> > > Hi Radu
> > >
> > > You catch us at a point of transition. The spec doesn't mandate 
> > > that
>
> > > contributions/composites be read from the local files system 
> > > although most of our samples do this as they use the 
> > > DefaultSCADomain implementation from the host-embedded module.
> > >
> > > There has been work recently on new code to allow for easier and 
> > > more consistent processing of contributions and composites and for

> > > deployment of these out to the nodes where they will run. Hence 
> > > there is a new runtime interface, see node2-api [1], that can be 
> > > used to fire up the Tuscany runtime classes and run a composite.
> > >
> > > A node expects to be provided with a single composite and all of 
> > > the
>
> > > contributions required to run that composite. This information can

> > > be provided in a number of ways
> > >
> > >    /**
> > >     * Creates a new SCA node.
> > >     *
> > >     * @param configurationURI the URI of the node configuration
> > >     * @return a new SCA node.
> > >     */
> > >    public abstract SCANode2 createSCANode(String 
> > > configurationURI);
> > >
> > >    /**
> > >     * Creates a new SCA node.
> > >     *
> > >     * @param compositeURI the URI of the composite to use
> > >     * @param contributions the URI of the contributions that 
> > > provides the composites and related artifacts
> > >     * @return a new SCA node.
> > >     */
> > >    public abstract SCANode2 createSCANode(String compositeURI, 
> > > SCAContribution... contributions);
> > >
> > >    /**
> > >     * Creates a new SCA node.
> > >     *
> > >     * @param compositeURI the URI of the composite to use
> > >     * @param compositeContent the XML content of the composite to
> use
> > >     * @param contributions the URI of the contributions that 
> > > provides the composites and related artifacts
> > >     * @return a new SCA node.
> > >     */
> > >    public abstract SCANode2 createSCANode(String compositeURI, 
> > > String compositeContent, SCAContribution... contributions);
> > >
> > > If you did want to use this to load contributions from the file 
> > > system you can, see [2] for an example (although we don't have the

> > > helper methods in place just yet to make this really easy).
> > > Alternatively you can start a node up and have it read it's 
> > > configuration across the network, for example, see one of the 
> > > nodes from the distributed calculator sample [3]. There isn't an 
> > > interface
>
> > > here that takes an input stream but you can provide a composite as

> > > a
>
> > > string which of course can come from where ever you want it to.
> > >
> > > You will note in the distributed calculator sample that there is 
> > > "LaunchDomain.java" also. This launches a web app that provides 
> > > the environment in which you can manage you contributions and 
> > > which will
>
> > > vend them out across the network to nodes using an Atom feed.
> > >
> > > There is very little documentation on all of this yet. It's very 
> > > much on the TODO list. It's all pretty new and we'd love to hear 
> > > any
>
> > > comments you have or ideas for improvement.
> > >
> > > Hope that helps
> > >
> > > Simon
> > >
> > > [1]
> > > http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/modules
> > > /n
> > > ode2
> > > -api/src/main/java/org/apache/tuscany/sca/node/SCANode2Factory.jav
> > > a< 
> > > http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/modules
> > > /n 
> > > ode2-api/src/main/java/org/apache/tuscany/sca/node/SCANode2Factory
> > > .j
> > > ava>
> > > [2]
> > > http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/itest/v
> > > al
> > > idat
> > > ion/src/test/java/calculator/DuplicateComponentNameTestCase.java<h
> > > tt 
> > > p://svn.apache.org/repos/asf/incubator/tuscany/java/sca/itest/vali
> > > da 
> > > tion/src/test/java/calculator/DuplicateComponentNameTestCase.java>
> > > [3]
> > > http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples
> > > /c
> > > alcu
> > > lator-distributed/src/main/java/node/LaunchCalculatorNodeA.java<ht
> > > tp 
> > > ://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/cal
> > > cu 
> > > lator-distributed/src/main/java/node/LaunchCalculatorNodeA.java>
> > >
> >
> > Yes, apologies Radu, I should have mentioned that it isn't in the 
> > latest release. It is a work in progress and has only recently gone
> into the API.
> > As you can also guess  the "node2" code is intended to replace
"node"
> > shortly as node2 is new and takes a slightly different view on the 
> > way
>
> > that the runtime should be started.
> >
> > To try it out I would normally advise you to either check the trunk 
> > source code out of subversion or take one of our nightly builds.
> > However I've just been to check the nightly build link from our 
> > download page and it's not working today (for me at least) as there 
> > seems to be a problem with the continuum build system. Your only 
> > option at the moment is to take the code from subversion in the mean

> > time. There are instructions here [1]. If you can't face that let us
> know and I'm sure we can sort something out.
> >
> > Regards
> >
> > Simon
> >
> > [1]
> > http://incubator.apache.org/tuscany/sca-java-development-guide.html
> >
>
>
> Hi Radu
>
> With reference to your mail over on the other thread [1] (confused me 
> for a moment;-).  I have a question. You pasted the code...
>
>        SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
>        SCANode2Factory.SCAContribution[] contributions = new 
> SCANode2Factory.SCAContribution[0];
>        SCANode2 node =
> nodeFactory.createSCANode(urlComposite.toURI().toString(),
> sCompositeContents, contributions);
>
>
> Is this complete? I would expect to see you adding some details to the

> contribution for example, for a contribution on your local disc you 
> could do...
>
> SCANode2Factory.SCAContribution  contributions = new 
> SCANode2Factory.SCAContribution("TestContribution",
>
>
> new
> File("src/main/resources/DuplicateComponentName").toURL().toString());
>
> Of course using an array if you need to add more than one
contribution.
> The contribution should contain the artifacts that the composite 
> requires, such as the component implementations, and WSDL or XSD/XML 
> files etc.
>
> Regards
>
> Simon
>
> [1]
> http://www.mail-archive.com/tuscany-user%40ws.apache.org/msg03030.html
>

Hi Radu

The tuscany web app support doesn't use this evolving node
implementation just yet. I don't imagine it would be difficult to plug
it in but we would need to decide how it's going to work in the context
of a webapp. For example, what does a contribution mean in a webapp?
There have been lots of threads about this kind of thing in the past and
I can point you at a few but I would welcome your thoughts first if you
are looking in this direction.

Our current host-webapp support uses the old runtime implementation from
host-embedded IIRC and treats the webapp itself as a contribution. It
plugs into the webapp through a filter configuration in web.xml.

Regards

Simon

Re: Is there are simple straightforward way of creating a Compoisite

Posted by Simon Laws <si...@googlemail.com>.
On Tue, Apr 29, 2008 at 4:49 PM, Marian, Radu <ra...@bankofamerica.com>
wrote:

> Simon,
>
> Thanks for your reply.  I have actually changed the code to:
>        SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
>        SCANode2Factory.SCAContribution contribution = new
> SCANode2Factory.SCAContribution("Service Provider Classes",
> urlServiceProviderClassesDir.toString());
>        node = nodeFactory.createSCANode(urlComposite.toString(),
> sCompositeContents, contribution);
>
>        node.start();
>        lifeCycleProcessor =
> ((SCAClient)node).getService(LifeCycleProcessorImpl.class,
> "ConsumerFacadeLifecycleComponent");
>
> Works ok - I am in the middle of debugging.
>
> Question - do I need to configure TuscanyServletFilter in web.xml?  I am
> using node2 api.
>
> Thanks,
> Radu Marian
> CRM Services Architecture Team
> Bank of America, Charlotte NC
> (980) 387-6233
> radu.marian@bankofamerica.com
>
> -----Original Message-----
> From: Simon Laws [mailto:simonslaws@googlemail.com]
> Sent: Tuesday, April 29, 2008 10:49 AM
> To: tuscany-user@ws.apache.org
> Subject: Re: Is there are simple straightforward way of creating a
> Compoisite
>
> On Mon, Apr 28, 2008 at 6:27 PM, Simon Laws <si...@googlemail.com>
> wrote:
>
> >
> >
> > On Mon, Apr 28, 2008 at 5:36 PM, Marian, Radu <
> > radu.marian@bankofamerica.com> wrote:
> >
> > > Simon,
> > >
> > > Thanks for your prompt response.  I hope the following api will let
> > > me do what I need - compositeContent :
> > >     /**
> > >     * Creates a new SCA node.
> > >     *
> > >     * @param compositeURI the URI of the composite to use
> > >     * @param compositeContent the XML content of the composite to
> use
> > >     * @param contributions the URI of the contributions that
> > > provides the composites and related artifacts
> > >     * @return a new SCA node.
> > >     */
> > >    public abstract SCANode2 createSCANode(String compositeURI,
> > > String compositeContent, SCAContribution... contributions);
> > >
> > > However I could not find it in the latest 1.2 release... :( sorce
> > > code or binaries...
> > >
> > > Any idea?  Should I get a nightly?
> > >
> > > Regards,
> > > Radu Marian
> > > CRM Services Architecture Team
> > > Bank of America, Charlotte NC
> > > (980) 387-6233
> > > radu.marian@bankofamerica.com
> > >
> > > -----Original Message-----
> > > From: Simon Laws [mailto:simonslaws@googlemail.com]
> > > Sent: Monday, April 28, 2008 11:54 AM
> > > To: tuscany-user@ws.apache.org
> > > Subject: Re: Is there are simple straightforward way of creating a
> > > Compoisite
> > >
> > > On Mon, Apr 28, 2008 at 4:14 PM, Marian, Radu
> > > <ra...@bankofamerica.com>
> > > wrote:
> > >
> > > > Hello,
> > > >
> > > > I have spent quite a few time through ContributionServiceImpl
> > > > class and could not find a simple way to add a Composite to the
> > > > contributiion - given the InputStream of the composite URL.  I
> > > > understand tuscany team wants to provide the ease of use for
> > > > compoistes to be discovered from the file system.... However - IMO
>
> > > > - the api should not prevent one from loading/adding a composite
> > > > from an
> > > InputStream.
> > > >
> > > > Why is everything have to be served from local file system?  Does
> > > > the sca spec mandate that?
> > > >
> > > > Thanks,
> > > > Radu.
> > > >
> > >
> > > Hi Radu
> > >
> > > You catch us at a point of transition. The spec doesn't mandate that
>
> > > contributions/composites be read from the local files system
> > > although most of our samples do this as they use the
> > > DefaultSCADomain implementation from the host-embedded module.
> > >
> > > There has been work recently on new code to allow for easier and
> > > more consistent processing of contributions and composites and for
> > > deployment of these out to the nodes where they will run. Hence
> > > there is a new runtime interface, see node2-api [1], that can be
> > > used to fire up the Tuscany runtime classes and run a composite.
> > >
> > > A node expects to be provided with a single composite and all of the
>
> > > contributions required to run that composite. This information can
> > > be provided in a number of ways
> > >
> > >    /**
> > >     * Creates a new SCA node.
> > >     *
> > >     * @param configurationURI the URI of the node configuration
> > >     * @return a new SCA node.
> > >     */
> > >    public abstract SCANode2 createSCANode(String configurationURI);
> > >
> > >    /**
> > >     * Creates a new SCA node.
> > >     *
> > >     * @param compositeURI the URI of the composite to use
> > >     * @param contributions the URI of the contributions that
> > > provides the composites and related artifacts
> > >     * @return a new SCA node.
> > >     */
> > >    public abstract SCANode2 createSCANode(String compositeURI,
> > > SCAContribution... contributions);
> > >
> > >    /**
> > >     * Creates a new SCA node.
> > >     *
> > >     * @param compositeURI the URI of the composite to use
> > >     * @param compositeContent the XML content of the composite to
> use
> > >     * @param contributions the URI of the contributions that
> > > provides the composites and related artifacts
> > >     * @return a new SCA node.
> > >     */
> > >    public abstract SCANode2 createSCANode(String compositeURI,
> > > String compositeContent, SCAContribution... contributions);
> > >
> > > If you did want to use this to load contributions from the file
> > > system you can, see [2] for an example (although we don't have the
> > > helper methods in place just yet to make this really easy).
> > > Alternatively you can start a node up and have it read it's
> > > configuration across the network, for example, see one of the nodes
> > > from the distributed calculator sample [3]. There isn't an interface
>
> > > here that takes an input stream but you can provide a composite as a
>
> > > string which of course can come from where ever you want it to.
> > >
> > > You will note in the distributed calculator sample that there is
> > > "LaunchDomain.java" also. This launches a web app that provides the
> > > environment in which you can manage you contributions and which will
>
> > > vend them out across the network to nodes using an Atom feed.
> > >
> > > There is very little documentation on all of this yet. It's very
> > > much on the TODO list. It's all pretty new and we'd love to hear any
>
> > > comments you have or ideas for improvement.
> > >
> > > Hope that helps
> > >
> > > Simon
> > >
> > > [1]
> > > http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/modules/n
> > > ode2
> > > -api/src/main/java/org/apache/tuscany/sca/node/SCANode2Factory.java<
> > > http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/modules/n
> > > ode2-api/src/main/java/org/apache/tuscany/sca/node/SCANode2Factory.j
> > > ava>
> > > [2]
> > > http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/itest/val
> > > idat
> > > ion/src/test/java/calculator/DuplicateComponentNameTestCase.java<htt
> > > p://svn.apache.org/repos/asf/incubator/tuscany/java/sca/itest/valida
> > > tion/src/test/java/calculator/DuplicateComponentNameTestCase.java>
> > > [3]
> > > http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/c
> > > alcu
> > > lator-distributed/src/main/java/node/LaunchCalculatorNodeA.java<http
> > > ://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/calcu
> > > lator-distributed/src/main/java/node/LaunchCalculatorNodeA.java>
> > >
> >
> > Yes, apologies Radu, I should have mentioned that it isn't in the
> > latest release. It is a work in progress and has only recently gone
> into the API.
> > As you can also guess  the "node2" code is intended to replace "node"
> > shortly as node2 is new and takes a slightly different view on the way
>
> > that the runtime should be started.
> >
> > To try it out I would normally advise you to either check the trunk
> > source code out of subversion or take one of our nightly builds.
> > However I've just been to check the nightly build link from our
> > download page and it's not working today (for me at least) as there
> > seems to be a problem with the continuum build system. Your only
> > option at the moment is to take the code from subversion in the mean
> > time. There are instructions here [1]. If you can't face that let us
> know and I'm sure we can sort something out.
> >
> > Regards
> >
> > Simon
> >
> > [1]
> > http://incubator.apache.org/tuscany/sca-java-development-guide.html
> >
>
>
> Hi Radu
>
> With reference to your mail over on the other thread [1] (confused me
> for a moment;-).  I have a question. You pasted the code...
>
>        SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
>        SCANode2Factory.SCAContribution[] contributions = new
> SCANode2Factory.SCAContribution[0];
>        SCANode2 node =
> nodeFactory.createSCANode(urlComposite.toURI().toString(),
> sCompositeContents, contributions);
>
>
> Is this complete? I would expect to see you adding some details to the
> contribution for example, for a contribution on your local disc you
> could do...
>
> SCANode2Factory.SCAContribution  contributions = new
> SCANode2Factory.SCAContribution("TestContribution",
>
>
> new
> File("src/main/resources/DuplicateComponentName").toURL().toString());
>
> Of course using an array if you need to add more than one contribution.
> The contribution should contain the artifacts that the composite
> requires, such as the component implementations, and WSDL or XSD/XML
> files etc.
>
> Regards
>
> Simon
>
> [1]
> http://www.mail-archive.com/tuscany-user%40ws.apache.org/msg03030.html
>

Hi Radu

The tuscany web app support doesn't use this evolving node implementation
just yet. I don't imagine it would be difficult to plug it in but we would
need to decide how it's going to work in the context of a webapp. For
example, what does a contribution mean in a webapp? There have been lots of
threads about this kind of thing in the past and I can point you at a few
but I would welcome your thoughts first if you are looking in this
direction.

Our current host-webapp support uses the old runtime implementation from
host-embedded IIRC and treats the webapp itself as a contribution. It plugs
into the webapp through a filter configuration in web.xml.

Regards

Simon

RE: Is there are simple straightforward way of creating a Compoisite

Posted by "Marian, Radu" <ra...@bankofamerica.com>.
Simon,

Thanks for your reply.  I have actually changed the code to:
        SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
        SCANode2Factory.SCAContribution contribution = new
SCANode2Factory.SCAContribution("Service Provider Classes",
urlServiceProviderClassesDir.toString());
    	node = nodeFactory.createSCANode(urlComposite.toString(),
sCompositeContents, contribution);
    	
    	node.start();
        lifeCycleProcessor =
((SCAClient)node).getService(LifeCycleProcessorImpl.class,
"ConsumerFacadeLifecycleComponent");

Works ok - I am in the middle of debugging.

Question - do I need to configure TuscanyServletFilter in web.xml?  I am
using node2 api.

Thanks,
Radu Marian
CRM Services Architecture Team
Bank of America, Charlotte NC
(980) 387-6233
radu.marian@bankofamerica.com

-----Original Message-----
From: Simon Laws [mailto:simonslaws@googlemail.com] 
Sent: Tuesday, April 29, 2008 10:49 AM
To: tuscany-user@ws.apache.org
Subject: Re: Is there are simple straightforward way of creating a
Compoisite

On Mon, Apr 28, 2008 at 6:27 PM, Simon Laws <si...@googlemail.com>
wrote:

>
>
> On Mon, Apr 28, 2008 at 5:36 PM, Marian, Radu < 
> radu.marian@bankofamerica.com> wrote:
>
> > Simon,
> >
> > Thanks for your prompt response.  I hope the following api will let 
> > me do what I need - compositeContent :
> >     /**
> >     * Creates a new SCA node.
> >     *
> >     * @param compositeURI the URI of the composite to use
> >     * @param compositeContent the XML content of the composite to
use
> >     * @param contributions the URI of the contributions that 
> > provides the composites and related artifacts
> >     * @return a new SCA node.
> >     */
> >    public abstract SCANode2 createSCANode(String compositeURI, 
> > String compositeContent, SCAContribution... contributions);
> >
> > However I could not find it in the latest 1.2 release... :( sorce 
> > code or binaries...
> >
> > Any idea?  Should I get a nightly?
> >
> > Regards,
> > Radu Marian
> > CRM Services Architecture Team
> > Bank of America, Charlotte NC
> > (980) 387-6233
> > radu.marian@bankofamerica.com
> >
> > -----Original Message-----
> > From: Simon Laws [mailto:simonslaws@googlemail.com]
> > Sent: Monday, April 28, 2008 11:54 AM
> > To: tuscany-user@ws.apache.org
> > Subject: Re: Is there are simple straightforward way of creating a 
> > Compoisite
> >
> > On Mon, Apr 28, 2008 at 4:14 PM, Marian, Radu 
> > <ra...@bankofamerica.com>
> > wrote:
> >
> > > Hello,
> > >
> > > I have spent quite a few time through ContributionServiceImpl 
> > > class and could not find a simple way to add a Composite to the 
> > > contributiion - given the InputStream of the composite URL.  I 
> > > understand tuscany team wants to provide the ease of use for 
> > > compoistes to be discovered from the file system.... However - IMO

> > > - the api should not prevent one from loading/adding a composite 
> > > from an
> > InputStream.
> > >
> > > Why is everything have to be served from local file system?  Does 
> > > the sca spec mandate that?
> > >
> > > Thanks,
> > > Radu.
> > >
> >
> > Hi Radu
> >
> > You catch us at a point of transition. The spec doesn't mandate that

> > contributions/composites be read from the local files system 
> > although most of our samples do this as they use the 
> > DefaultSCADomain implementation from the host-embedded module.
> >
> > There has been work recently on new code to allow for easier and 
> > more consistent processing of contributions and composites and for 
> > deployment of these out to the nodes where they will run. Hence 
> > there is a new runtime interface, see node2-api [1], that can be 
> > used to fire up the Tuscany runtime classes and run a composite.
> >
> > A node expects to be provided with a single composite and all of the

> > contributions required to run that composite. This information can 
> > be provided in a number of ways
> >
> >    /**
> >     * Creates a new SCA node.
> >     *
> >     * @param configurationURI the URI of the node configuration
> >     * @return a new SCA node.
> >     */
> >    public abstract SCANode2 createSCANode(String configurationURI);
> >
> >    /**
> >     * Creates a new SCA node.
> >     *
> >     * @param compositeURI the URI of the composite to use
> >     * @param contributions the URI of the contributions that 
> > provides the composites and related artifacts
> >     * @return a new SCA node.
> >     */
> >    public abstract SCANode2 createSCANode(String compositeURI, 
> > SCAContribution... contributions);
> >
> >    /**
> >     * Creates a new SCA node.
> >     *
> >     * @param compositeURI the URI of the composite to use
> >     * @param compositeContent the XML content of the composite to
use
> >     * @param contributions the URI of the contributions that 
> > provides the composites and related artifacts
> >     * @return a new SCA node.
> >     */
> >    public abstract SCANode2 createSCANode(String compositeURI, 
> > String compositeContent, SCAContribution... contributions);
> >
> > If you did want to use this to load contributions from the file 
> > system you can, see [2] for an example (although we don't have the 
> > helper methods in place just yet to make this really easy). 
> > Alternatively you can start a node up and have it read it's 
> > configuration across the network, for example, see one of the nodes 
> > from the distributed calculator sample [3]. There isn't an interface

> > here that takes an input stream but you can provide a composite as a

> > string which of course can come from where ever you want it to.
> >
> > You will note in the distributed calculator sample that there is 
> > "LaunchDomain.java" also. This launches a web app that provides the 
> > environment in which you can manage you contributions and which will

> > vend them out across the network to nodes using an Atom feed.
> >
> > There is very little documentation on all of this yet. It's very 
> > much on the TODO list. It's all pretty new and we'd love to hear any

> > comments you have or ideas for improvement.
> >
> > Hope that helps
> >
> > Simon
> >
> > [1]
> > http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/modules/n
> > ode2 
> > -api/src/main/java/org/apache/tuscany/sca/node/SCANode2Factory.java<
> > http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/modules/n
> > ode2-api/src/main/java/org/apache/tuscany/sca/node/SCANode2Factory.j
> > ava>
> > [2]
> > http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/itest/val
> > idat 
> > ion/src/test/java/calculator/DuplicateComponentNameTestCase.java<htt
> > p://svn.apache.org/repos/asf/incubator/tuscany/java/sca/itest/valida
> > tion/src/test/java/calculator/DuplicateComponentNameTestCase.java>
> > [3]
> > http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/c
> > alcu 
> > lator-distributed/src/main/java/node/LaunchCalculatorNodeA.java<http
> > ://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/calcu
> > lator-distributed/src/main/java/node/LaunchCalculatorNodeA.java>
> >
>
> Yes, apologies Radu, I should have mentioned that it isn't in the 
> latest release. It is a work in progress and has only recently gone
into the API.
> As you can also guess  the "node2" code is intended to replace "node"
> shortly as node2 is new and takes a slightly different view on the way

> that the runtime should be started.
>
> To try it out I would normally advise you to either check the trunk 
> source code out of subversion or take one of our nightly builds. 
> However I've just been to check the nightly build link from our 
> download page and it's not working today (for me at least) as there 
> seems to be a problem with the continuum build system. Your only 
> option at the moment is to take the code from subversion in the mean 
> time. There are instructions here [1]. If you can't face that let us
know and I'm sure we can sort something out.
>
> Regards
>
> Simon
>
> [1] 
> http://incubator.apache.org/tuscany/sca-java-development-guide.html
>


Hi Radu

With reference to your mail over on the other thread [1] (confused me
for a moment;-).  I have a question. You pasted the code...

        SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
        SCANode2Factory.SCAContribution[] contributions = new
SCANode2Factory.SCAContribution[0];
        SCANode2 node =
nodeFactory.createSCANode(urlComposite.toURI().toString(),
sCompositeContents, contributions);


Is this complete? I would expect to see you adding some details to the
contribution for example, for a contribution on your local disc you
could do...

SCANode2Factory.SCAContribution  contributions = new
SCANode2Factory.SCAContribution("TestContribution",


new
File("src/main/resources/DuplicateComponentName").toURL().toString());

Of course using an array if you need to add more than one contribution.
The contribution should contain the artifacts that the composite
requires, such as the component implementations, and WSDL or XSD/XML
files etc.

Regards

Simon

[1]
http://www.mail-archive.com/tuscany-user%40ws.apache.org/msg03030.html

Re: Is there are simple straightforward way of creating a Compoisite

Posted by Simon Laws <si...@googlemail.com>.
On Mon, Apr 28, 2008 at 6:27 PM, Simon Laws <si...@googlemail.com>
wrote:

>
>
> On Mon, Apr 28, 2008 at 5:36 PM, Marian, Radu <
> radu.marian@bankofamerica.com> wrote:
>
> > Simon,
> >
> > Thanks for your prompt response.  I hope the following api will let me
> > do what I need - compositeContent :
> >     /**
> >     * Creates a new SCA node.
> >     *
> >     * @param compositeURI the URI of the composite to use
> >     * @param compositeContent the XML content of the composite to use
> >     * @param contributions the URI of the contributions that provides
> > the composites and related artifacts
> >     * @return a new SCA node.
> >     */
> >    public abstract SCANode2 createSCANode(String compositeURI, String
> > compositeContent, SCAContribution... contributions);
> >
> > However I could not find it in the latest 1.2 release... :( sorce code
> > or binaries...
> >
> > Any idea?  Should I get a nightly?
> >
> > Regards,
> > Radu Marian
> > CRM Services Architecture Team
> > Bank of America, Charlotte NC
> > (980) 387-6233
> > radu.marian@bankofamerica.com
> >
> > -----Original Message-----
> > From: Simon Laws [mailto:simonslaws@googlemail.com]
> > Sent: Monday, April 28, 2008 11:54 AM
> > To: tuscany-user@ws.apache.org
> > Subject: Re: Is there are simple straightforward way of creating a
> > Compoisite
> >
> > On Mon, Apr 28, 2008 at 4:14 PM, Marian, Radu
> > <ra...@bankofamerica.com>
> > wrote:
> >
> > > Hello,
> > >
> > > I have spent quite a few time through ContributionServiceImpl class
> > > and could not find a simple way to add a Composite to the
> > > contributiion - given the InputStream of the composite URL.  I
> > > understand tuscany team wants to provide the ease of use for
> > > compoistes to be discovered from the file system.... However - IMO -
> > > the api should not prevent one from loading/adding a composite from an
> > InputStream.
> > >
> > > Why is everything have to be served from local file system?  Does the
> > > sca spec mandate that?
> > >
> > > Thanks,
> > > Radu.
> > >
> >
> > Hi Radu
> >
> > You catch us at a point of transition. The spec doesn't mandate that
> > contributions/composites be read from the local files system although
> > most of our samples do this as they use the DefaultSCADomain
> > implementation from the host-embedded module.
> >
> > There has been work recently on new code to allow for easier and more
> > consistent processing of contributions and composites and for deployment
> > of these out to the nodes where they will run. Hence there is a new
> > runtime interface, see node2-api [1], that can be used to fire up the
> > Tuscany runtime classes and run a composite.
> >
> > A node expects to be provided with a single composite and all of the
> > contributions required to run that composite. This information can be
> > provided in a number of ways
> >
> >    /**
> >     * Creates a new SCA node.
> >     *
> >     * @param configurationURI the URI of the node configuration
> >     * @return a new SCA node.
> >     */
> >    public abstract SCANode2 createSCANode(String configurationURI);
> >
> >    /**
> >     * Creates a new SCA node.
> >     *
> >     * @param compositeURI the URI of the composite to use
> >     * @param contributions the URI of the contributions that provides
> > the composites and related artifacts
> >     * @return a new SCA node.
> >     */
> >    public abstract SCANode2 createSCANode(String compositeURI,
> > SCAContribution... contributions);
> >
> >    /**
> >     * Creates a new SCA node.
> >     *
> >     * @param compositeURI the URI of the composite to use
> >     * @param compositeContent the XML content of the composite to use
> >     * @param contributions the URI of the contributions that provides
> > the composites and related artifacts
> >     * @return a new SCA node.
> >     */
> >    public abstract SCANode2 createSCANode(String compositeURI, String
> > compositeContent, SCAContribution... contributions);
> >
> > If you did want to use this to load contributions from the file system
> > you can, see [2] for an example (although we don't have the helper
> > methods in place just yet to make this really easy). Alternatively you
> > can start a node up and have it read it's configuration across the
> > network, for example, see one of the nodes from the distributed
> > calculator sample [3]. There isn't an interface here that takes an input
> > stream but you can provide a composite as a string which of course can
> > come from where ever you want it to.
> >
> > You will note in the distributed calculator sample that there is
> > "LaunchDomain.java" also. This launches a web app that provides the
> > environment in which you can manage you contributions and which will
> > vend them out across the network to nodes using an Atom feed.
> >
> > There is very little documentation on all of this yet. It's very much on
> > the TODO list. It's all pretty new and we'd love to hear any comments
> > you have or ideas for improvement.
> >
> > Hope that helps
> >
> > Simon
> >
> > [1]
> > http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/modules/node2
> > -api/src/main/java/org/apache/tuscany/sca/node/SCANode2Factory.java<http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/SCANode2Factory.java>
> > [2]
> > http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/itest/validat
> > ion/src/test/java/calculator/DuplicateComponentNameTestCase.java<http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/itest/validation/src/test/java/calculator/DuplicateComponentNameTestCase.java>
> > [3]
> > http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/calcu
> > lator-distributed/src/main/java/node/LaunchCalculatorNodeA.java<http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/calculator-distributed/src/main/java/node/LaunchCalculatorNodeA.java>
> >
>
> Yes, apologies Radu, I should have mentioned that it isn't in the latest
> release. It is a work in progress and has only recently gone into the API.
> As you can also guess  the "node2" code is intended to replace "node"
> shortly as node2 is new and takes a slightly different view on the way that
> the runtime should be started.
>
> To try it out I would normally advise you to either check the trunk source
> code out of subversion or take one of our nightly builds. However I've just
> been to check the nightly build link from our download page and it's not
> working today (for me at least) as there seems to be a problem with the
> continuum build system. Your only option at the moment is to take the code
> from subversion in the mean time. There are instructions here [1]. If you
> can't face that let us know and I'm sure we can sort something out.
>
> Regards
>
> Simon
>
> [1] http://incubator.apache.org/tuscany/sca-java-development-guide.html
>


Hi Radu

With reference to your mail over on the other thread [1] (confused me for a
moment;-).  I have a question. You pasted the code...

        SCANode2Factory nodeFactory = SCANode2Factory.newInstance();
        SCANode2Factory.SCAContribution[] contributions = new
SCANode2Factory.SCAContribution[0];
        SCANode2 node =
nodeFactory.createSCANode(urlComposite.toURI().toString(),
sCompositeContents, contributions);


Is this complete? I would expect to see you adding some details to the
contribution for example, for a contribution on your local disc you could
do...

SCANode2Factory.SCAContribution  contributions = new
SCANode2Factory.SCAContribution("TestContribution",


new File("src/main/resources/DuplicateComponentName").toURL().toString());

Of course using an array if you need to add more than one contribution. The
contribution should contain the artifacts that the composite requires, such
as the component implementations, and WSDL or XSD/XML files etc.

Regards

Simon

[1] http://www.mail-archive.com/tuscany-user%40ws.apache.org/msg03030.html

Re: Is there are simple straightforward way of creating a Compoisite

Posted by Simon Laws <si...@googlemail.com>.
On Mon, Apr 28, 2008 at 5:36 PM, Marian, Radu <ra...@bankofamerica.com>
wrote:

> Simon,
>
> Thanks for your prompt response.  I hope the following api will let me
> do what I need - compositeContent :
>     /**
>     * Creates a new SCA node.
>     *
>     * @param compositeURI the URI of the composite to use
>     * @param compositeContent the XML content of the composite to use
>     * @param contributions the URI of the contributions that provides
> the composites and related artifacts
>     * @return a new SCA node.
>     */
>    public abstract SCANode2 createSCANode(String compositeURI, String
> compositeContent, SCAContribution... contributions);
>
> However I could not find it in the latest 1.2 release... :( sorce code
> or binaries...
>
> Any idea?  Should I get a nightly?
>
> Regards,
> Radu Marian
> CRM Services Architecture Team
> Bank of America, Charlotte NC
> (980) 387-6233
> radu.marian@bankofamerica.com
>
> -----Original Message-----
> From: Simon Laws [mailto:simonslaws@googlemail.com]
> Sent: Monday, April 28, 2008 11:54 AM
> To: tuscany-user@ws.apache.org
> Subject: Re: Is there are simple straightforward way of creating a
> Compoisite
>
> On Mon, Apr 28, 2008 at 4:14 PM, Marian, Radu
> <ra...@bankofamerica.com>
> wrote:
>
> > Hello,
> >
> > I have spent quite a few time through ContributionServiceImpl class
> > and could not find a simple way to add a Composite to the
> > contributiion - given the InputStream of the composite URL.  I
> > understand tuscany team wants to provide the ease of use for
> > compoistes to be discovered from the file system.... However - IMO -
> > the api should not prevent one from loading/adding a composite from an
> InputStream.
> >
> > Why is everything have to be served from local file system?  Does the
> > sca spec mandate that?
> >
> > Thanks,
> > Radu.
> >
>
> Hi Radu
>
> You catch us at a point of transition. The spec doesn't mandate that
> contributions/composites be read from the local files system although
> most of our samples do this as they use the DefaultSCADomain
> implementation from the host-embedded module.
>
> There has been work recently on new code to allow for easier and more
> consistent processing of contributions and composites and for deployment
> of these out to the nodes where they will run. Hence there is a new
> runtime interface, see node2-api [1], that can be used to fire up the
> Tuscany runtime classes and run a composite.
>
> A node expects to be provided with a single composite and all of the
> contributions required to run that composite. This information can be
> provided in a number of ways
>
>    /**
>     * Creates a new SCA node.
>     *
>     * @param configurationURI the URI of the node configuration
>     * @return a new SCA node.
>     */
>    public abstract SCANode2 createSCANode(String configurationURI);
>
>    /**
>     * Creates a new SCA node.
>     *
>     * @param compositeURI the URI of the composite to use
>     * @param contributions the URI of the contributions that provides
> the composites and related artifacts
>     * @return a new SCA node.
>     */
>    public abstract SCANode2 createSCANode(String compositeURI,
> SCAContribution... contributions);
>
>    /**
>     * Creates a new SCA node.
>     *
>     * @param compositeURI the URI of the composite to use
>     * @param compositeContent the XML content of the composite to use
>     * @param contributions the URI of the contributions that provides
> the composites and related artifacts
>     * @return a new SCA node.
>     */
>    public abstract SCANode2 createSCANode(String compositeURI, String
> compositeContent, SCAContribution... contributions);
>
> If you did want to use this to load contributions from the file system
> you can, see [2] for an example (although we don't have the helper
> methods in place just yet to make this really easy). Alternatively you
> can start a node up and have it read it's configuration across the
> network, for example, see one of the nodes from the distributed
> calculator sample [3]. There isn't an interface here that takes an input
> stream but you can provide a composite as a string which of course can
> come from where ever you want it to.
>
> You will note in the distributed calculator sample that there is
> "LaunchDomain.java" also. This launches a web app that provides the
> environment in which you can manage you contributions and which will
> vend them out across the network to nodes using an Atom feed.
>
> There is very little documentation on all of this yet. It's very much on
> the TODO list. It's all pretty new and we'd love to hear any comments
> you have or ideas for improvement.
>
> Hope that helps
>
> Simon
>
> [1]
> http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/modules/node2
> -api/src/main/java/org/apache/tuscany/sca/node/SCANode2Factory.java<http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/SCANode2Factory.java>
> [2]
> http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/itest/validat
> ion/src/test/java/calculator/DuplicateComponentNameTestCase.java<http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/itest/validation/src/test/java/calculator/DuplicateComponentNameTestCase.java>
> [3]
> http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/calcu
> lator-distributed/src/main/java/node/LaunchCalculatorNodeA.java<http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/calculator-distributed/src/main/java/node/LaunchCalculatorNodeA.java>
>

Yes, apologies Radu, I should have mentioned that it isn't in the latest
release. It is a work in progress and has only recently gone into the API.
As you can also guess  the "node2" code is intended to replace "node"
shortly as node2 is new and takes a slightly different view on the way that
the runtime should be started.

To try it out I would normally advise you to either check the trunk source
code out of subversion or take one of our nightly builds. However I've just
been to check the nightly build link from our download page and it's not
working today (for me at least) as there seems to be a problem with the
continuum build system. Your only option at the moment is to take the code
from subversion in the mean time. There are instructions here [1]. If you
can't face that let us know and I'm sure we can sort something out.

Regards

Simon

[1] http://incubator.apache.org/tuscany/sca-java-development-guide.html

RE: Is there are simple straightforward way of creating a Compoisite

Posted by "Marian, Radu" <ra...@bankofamerica.com>.
Simon,

Thanks for your prompt response.  I hope the following api will let me
do what I need - compositeContent :
    /**
     * Creates a new SCA node.
     *
     * @param compositeURI the URI of the composite to use
     * @param compositeContent the XML content of the composite to use
     * @param contributions the URI of the contributions that provides
the composites and related artifacts
     * @return a new SCA node.
     */
    public abstract SCANode2 createSCANode(String compositeURI, String
compositeContent, SCAContribution... contributions);

However I could not find it in the latest 1.2 release... :( sorce code
or binaries...

Any idea?  Should I get a nightly?

Regards,
Radu Marian
CRM Services Architecture Team
Bank of America, Charlotte NC
(980) 387-6233
radu.marian@bankofamerica.com

-----Original Message-----
From: Simon Laws [mailto:simonslaws@googlemail.com] 
Sent: Monday, April 28, 2008 11:54 AM
To: tuscany-user@ws.apache.org
Subject: Re: Is there are simple straightforward way of creating a
Compoisite

On Mon, Apr 28, 2008 at 4:14 PM, Marian, Radu
<ra...@bankofamerica.com>
wrote:

> Hello,
>
> I have spent quite a few time through ContributionServiceImpl class 
> and could not find a simple way to add a Composite to the 
> contributiion - given the InputStream of the composite URL.  I 
> understand tuscany team wants to provide the ease of use for 
> compoistes to be discovered from the file system.... However - IMO - 
> the api should not prevent one from loading/adding a composite from an
InputStream.
>
> Why is everything have to be served from local file system?  Does the 
> sca spec mandate that?
>
> Thanks,
> Radu.
>

Hi Radu

You catch us at a point of transition. The spec doesn't mandate that
contributions/composites be read from the local files system although
most of our samples do this as they use the DefaultSCADomain
implementation from the host-embedded module.

There has been work recently on new code to allow for easier and more
consistent processing of contributions and composites and for deployment
of these out to the nodes where they will run. Hence there is a new
runtime interface, see node2-api [1], that can be used to fire up the
Tuscany runtime classes and run a composite.

A node expects to be provided with a single composite and all of the
contributions required to run that composite. This information can be
provided in a number of ways

    /**
     * Creates a new SCA node.
     *
     * @param configurationURI the URI of the node configuration
     * @return a new SCA node.
     */
    public abstract SCANode2 createSCANode(String configurationURI);

    /**
     * Creates a new SCA node.
     *
     * @param compositeURI the URI of the composite to use
     * @param contributions the URI of the contributions that provides
the composites and related artifacts
     * @return a new SCA node.
     */
    public abstract SCANode2 createSCANode(String compositeURI,
SCAContribution... contributions);

    /**
     * Creates a new SCA node.
     *
     * @param compositeURI the URI of the composite to use
     * @param compositeContent the XML content of the composite to use
     * @param contributions the URI of the contributions that provides
the composites and related artifacts
     * @return a new SCA node.
     */
    public abstract SCANode2 createSCANode(String compositeURI, String
compositeContent, SCAContribution... contributions);

If you did want to use this to load contributions from the file system
you can, see [2] for an example (although we don't have the helper
methods in place just yet to make this really easy). Alternatively you
can start a node up and have it read it's configuration across the
network, for example, see one of the nodes from the distributed
calculator sample [3]. There isn't an interface here that takes an input
stream but you can provide a composite as a string which of course can
come from where ever you want it to.

You will note in the distributed calculator sample that there is
"LaunchDomain.java" also. This launches a web app that provides the
environment in which you can manage you contributions and which will
vend them out across the network to nodes using an Atom feed.

There is very little documentation on all of this yet. It's very much on
the TODO list. It's all pretty new and we'd love to hear any comments
you have or ideas for improvement.

Hope that helps

Simon

[1]
http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/modules/node2
-api/src/main/java/org/apache/tuscany/sca/node/SCANode2Factory.java
[2]
http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/itest/validat
ion/src/test/java/calculator/DuplicateComponentNameTestCase.java
[3]
http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/calcu
lator-distributed/src/main/java/node/LaunchCalculatorNodeA.java

Re: Is there are simple straightforward way of creating a Compoisite

Posted by Simon Laws <si...@googlemail.com>.
On Mon, Apr 28, 2008 at 4:14 PM, Marian, Radu <ra...@bankofamerica.com>
wrote:

> Hello,
>
> I have spent quite a few time through ContributionServiceImpl class and
> could not find a simple way to add a Composite to the contributiion -
> given the InputStream of the composite URL.  I understand tuscany team
> wants to provide the ease of use for compoistes to be discovered from
> the file system.... However - IMO - the api should not prevent one from
> loading/adding a composite from an InputStream.
>
> Why is everything have to be served from local file system?  Does the
> sca spec mandate that?
>
> Thanks,
> Radu.
>

Hi Radu

You catch us at a point of transition. The spec doesn't mandate that
contributions/composites be read from the local files system although most
of our samples do this as they use the DefaultSCADomain implementation from
the host-embedded module.

There has been work recently on new code to allow for easier and more
consistent processing of contributions and composites and for deployment of
these out to the nodes where they will run. Hence there is a new runtime
interface, see node2-api [1], that can be used to fire up the Tuscany
runtime classes and run a composite.

A node expects to be provided with a single composite and all of the
contributions required to run that composite. This information can be
provided in a number of ways

    /**
     * Creates a new SCA node.
     *
     * @param configurationURI the URI of the node configuration
     * @return a new SCA node.
     */
    public abstract SCANode2 createSCANode(String configurationURI);

    /**
     * Creates a new SCA node.
     *
     * @param compositeURI the URI of the composite to use
     * @param contributions the URI of the contributions that provides the
composites and related artifacts
     * @return a new SCA node.
     */
    public abstract SCANode2 createSCANode(String compositeURI,
SCAContribution... contributions);

    /**
     * Creates a new SCA node.
     *
     * @param compositeURI the URI of the composite to use
     * @param compositeContent the XML content of the composite to use
     * @param contributions the URI of the contributions that provides the
composites and related artifacts
     * @return a new SCA node.
     */
    public abstract SCANode2 createSCANode(String compositeURI, String
compositeContent, SCAContribution... contributions);

If you did want to use this to load contributions from the file system you
can, see [2] for an example (although we don't have the helper methods in
place just yet to make this really easy). Alternatively you can start a node
up and have it read it's configuration across the network, for example, see
one of the nodes from the distributed calculator sample [3]. There isn't an
interface here that takes an input stream but you can provide a composite as
a string which of course can come from where ever you want it to.

You will note in the distributed calculator sample that there is
"LaunchDomain.java" also. This launches a web app that provides the
environment in which you can manage you contributions and which will vend
them out across the network to nodes using an Atom feed.

There is very little documentation on all of this yet. It's very much on the
TODO list. It's all pretty new and we'd love to hear any comments you have
or ideas for improvement.

Hope that helps

Simon

[1]
http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/modules/node2-api/src/main/java/org/apache/tuscany/sca/node/SCANode2Factory.java
[2]
http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/itest/validation/src/test/java/calculator/DuplicateComponentNameTestCase.java
[3]
http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/calculator-distributed/src/main/java/node/LaunchCalculatorNodeA.java