You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Luciano Resende <lu...@gmail.com> on 2007/02/25 22:00:20 UTC

Integrating Contribution services with DefaultSCAContainer

I want to start getting the Contribution service integrated to the process
of running components, and I was thinking to give it a try by integrating
the service with the new DeafultSCAContatiner that some sample apps in the
integration branch is using. I think the idea is to stop using the launcher
to consume the application SCDL, and ask the Contribution service to process
the application as a contribution.

from:
component = launcher.bootApplication("application", applicationSCDL);

to maybe:
URI appURI = this.contributionService.contribute(contributionLocation,
false);
...

Today, when you ask the contribution service to consume an application, you
will get back an URI, that is an ID for that contribution. So, my question
is, how the external world would get access to the model objects created
during the loading phase from the contribution service ? Is the contribution
service responsible to register these model objects
(e.gcomponentDefinition) into some specific model repository (
e.g the domain) ? and If so, how do I got about doing this ?


Could someone please share some ideas, or more concrete example on how I'd
go about integrating the Contribution service into the big picture ?

-- 
Luciano Resende
http://people.apache.org/~lresende

Re: Integrating Contribution services with DefaultSCAContainer

Posted by Jeremy Boynes <jb...@apache.org>.
Not sure about this DefaultSCAContainer thingy - that's not something  
that's in trunk.

Based on the deployment model in the spec, contribution is totally  
separate from running components. Contribution is about defining type  
information in the domain, something that happens once (per type);  
running components is about creating instances of those types,  
something that happens many times.

So from the command line, to make a contribution the user would do  
something like:
   $ java -jar contribute myContribution.jar ...
which would contribute that jar to the local domain (perhaps with  
command line args to contribute it to other domains).

Of course, this is just the command line form admins might use - we'd  
want to offer alternatives such as a Maven plugin, Ant task or IDE  
integration. These would all be wrappers around the ContributionService.

With this in place, we should be able to migrate the launcher to a  
mode where the user just needs to specify the component to launch:
   $ java -jar launcher myComponent args...
and the runtime does the rest.

--
Jeremy

On Feb 25, 2007, at 1:00 PM, Luciano Resende wrote:

> I want to start getting the Contribution service integrated to the  
> process
> of running components, and I was thinking to give it a try by  
> integrating
> the service with the new DeafultSCAContatiner that some sample apps  
> in the
> integration branch is using. I think the idea is to stop using the  
> launcher
> to consume the application SCDL, and ask the Contribution service  
> to process
> the application as a contribution.
>
> from:
> component = launcher.bootApplication("application", applicationSCDL);
>
> to maybe:
> URI appURI = this.contributionService.contribute(contributionLocation,
> false);
> ...
>
> Today, when you ask the contribution service to consume an  
> application, you
> will get back an URI, that is an ID for that contribution. So, my  
> question
> is, how the external world would get access to the model objects  
> created
> during the loading phase from the contribution service ? Is the  
> contribution
> service responsible to register these model objects
> (e.gcomponentDefinition) into some specific model repository (
> e.g the domain) ? and If so, how do I got about doing this ?
>
>
> Could someone please share some ideas, or more concrete example on  
> how I'd
> go about integrating the Contribution service into the big picture ?
>
> -- 
> Luciano Resende
> http://people.apache.org/~lresende


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: Integrating Contribution services with DefaultSCAContainer

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Luciano Resende wrote:
> I want to start getting the Contribution service integrated to the 
> process of running components, and I was thinking to give it a try by 
> integrating the service with the new DeafultSCAContatiner that some 
> sample apps in the integration branch is using. I think the idea is to 
> stop using the launcher to consume the application SCDL, and ask the 
> Contribution service to process the application as a contribution.
>
> from:
> component = launcher.bootApplication("application", applicationSCDL);
>
> to maybe:
> URI appURI = this.contributionService.contribute(contributionLocation, 
> false);
> ...
>
> Today, when you ask the contribution service to consume an 
> application, you will get back an URI, that is an ID for that 
> contribution. So, my question is, how the external world would get 
> access to the model objects created during the loading phase from the 
> contribution service ? Is the contribution service responsible to 
> register these model objects ( e.g componentDefinition) into some 
> specific model repository (e.g the domain) ? and If so, how do I got 
> about doing this ?
>
>
> Could someone please share some ideas, or more concrete example on how 
> I'd go about integrating the Contribution service into the big picture ?
>
> -- 
> Luciano Resende
> http://people.apache.org/~lresende <http://people.apache.org/%7Elresende> 

I have one question and a few comments:

- I was expecting to see that ContributionService in the spi module, 
with the Contribution model. Why is it defined in the host-api module?

- I don't think that bootApplication and contribute() are really 
equivalent. Starting a component requires the following to happen:
1. An SCA contribution containing the component implementation and a 
composite containing the component declaration is installed.
2. The composite declaring the component is included in the SCA domain 
logical composite.
3. An SCA runtime starts, instantiates and starts the component.

ContributionService.contribute() should only do step 1. 
Launcher.bootApplication used to do the equivalent of 1+2+3.

Then I imagine that you'll need to get your hands on the actual 
Contribution model and point to the DeployedArtifact representing the 
Composite.

Next you'll need to add this Composite to the SCA Domain. By the way, do 
we have an SCA Domain service yet? If we don't then maybe we can just 
skip that step for now...

Then you'll probably want to turn the DeployedArtifact into a Component 
model object and add it to the correct node in the Component model tree 
described at 
http://cwiki.apache.org/TUSCANY/tuscany-architecture-guide.data/tuscany_composite_hierarchy.jpg.

And finally start that Component.

-- 
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: Integrating Contribution services with DefaultSCAContainer

Posted by Jeremy Boynes <jb...@apache.org>.
On Feb 25, 2007, at 5:25 PM, Jim Marino wrote:

>
> On Feb 25, 2007, at 5:11 PM, Luciano Resende wrote:
>
>> It would take me about a week, with help, it probably would be done
>> sooner... We could use the loan app, I was using the calculator  
>> sample app.
>> Let me merge the latest stuff I have to trunk.
>
> O.K. sounds cool. To start the app you'll need to get a  
> distribution, which you can grab from the runtime assembly  
> directory. I typically get the tar and expand it in an /image  
> directory. This allows me to run the sample from the command line  
> doing:
>
> java -jar ../image/assembly-1.0-alpha-incubating-SNAPSHOT-bin/bin/ 
> launcher.jar  target/loan-application.jar
>
> or to debug:
>
> java -Xdebug -Xnoagent -Djava.compiler=NONE - 
> Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 - 
> jar ../image/assembly-1.0-alpha-incubating-SNAPSHOT-bin/bin/ 
> launcher.jar target/loan-application.jar
>

You can also run/debug as an application (assuming you get the IDE  
set up right). In IDEA I have:
* classpath from the launcher module
* main class = org.apache.tuscany.launcher.Main
* JVM parameters = -ea -Dtuscany.installDir=${SCA}/runtime/standalone/ 
smoketest/target/assembly
* Program parameters = calc.jar add 2 3
* Working directory = ${SAMPLES}/standalone/calculator/target

That probably translates to Eclipse somehow.
--
Jeremy


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: Integrating Contribution services with DefaultSCAContainer

Posted by Jim Marino <jm...@myromatours.com>.
On Feb 25, 2007, at 5:11 PM, Luciano Resende wrote:

> It would take me about a week, with help, it probably would be done
> sooner... We could use the loan app, I was using the calculator  
> sample app.
> Let me merge the latest stuff I have to trunk.

O.K. sounds cool. To start the app you'll need to get a distribution,  
which you can grab from the runtime assembly directory. I typically  
get the tar and expand it in an /image directory. This allows me to  
run the sample from the command line doing:

java -jar ../image/assembly-1.0-alpha-incubating-SNAPSHOT-bin/bin/ 
launcher.jar  target/loan-application.jar

or to debug:

java -Xdebug -Xnoagent -Djava.compiler=NONE - 
Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 -jar ../ 
image/assembly-1.0-alpha-incubating-SNAPSHOT-bin/bin/launcher.jar  
target/loan-application.jar

Jim

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: Integrating Contribution services with DefaultSCAContainer

Posted by Luciano Resende <lu...@gmail.com>.
It would take me about a week, with help, it probably would be done
sooner... We could use the loan app, I was using the calculator sample app.
Let me merge the latest stuff I have to trunk.

-- 
Luciano Resende
http://people.apache.org/~lresende

On 2/25/07, Jim Marino <jm...@myromatours.com> wrote:
>
>
> On Feb 25, 2007, at 4:52 PM, Luciano Resende wrote:
>
> > Hi Jim
> >
> >   I'm trying to get a simple end-to-end scenario working asap. In
> > trunk, it
> > might take a week or so.
>
> Why would it take that long since we have full samples online? We
> could start with the loan application sample. I'm willing to help
> out. I imagine we should be able to get something going pretty quickly.
>
> Jim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>

Re: Integrating Contribution services with DefaultSCAContainer

Posted by Jim Marino <jm...@myromatours.com>.
On Feb 25, 2007, at 4:52 PM, Luciano Resende wrote:

> Hi Jim
>
>   I'm trying to get a simple end-to-end scenario working asap. In  
> trunk, it
> might take a week or so.

Why would it take that long since we have full samples online? We  
could start with the loan application sample. I'm willing to help  
out. I imagine we should be able to get something going pretty quickly.

Jim

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: Integrating Contribution services with DefaultSCAContainer

Posted by Luciano Resende <lu...@gmail.com>.
Hi Jim

   I'm trying to get a simple end-to-end scenario working asap. In trunk, it
might take a week or so.

-- 
Luciano Resende
http://people.apache.org/~lresende

On 2/25/07, Jim Marino <jm...@myromatours.com> wrote:
>
>
> On Feb 25, 2007, at 1:00 PM, Luciano Resende wrote:
>
> > I want to start getting the Contribution service integrated to the
> > process
> > of running components, and I was thinking to give it a try by
> > integrating
> > the service with the new DeafultSCAContatiner that some sample apps
> > in the
> > integration branch is using. I think the idea is to stop using the
> > launcher
> > to consume the application SCDL, and ask the Contribution service
> > to process
> > the application as a contribution.
> >
> > from:
> > component = launcher.bootApplication("application", applicationSCDL);
> >
> > to maybe:
> > URI appURI = this.contributionService.contribute(contributionLocation,
> > false);
> > ...
> >
> > Today, when you ask the contribution service to consume an
> > application, you
> > will get back an URI, that is an ID for that contribution. So, my
> > question
> > is, how the external world would get access to the model objects
> > created
> > during the loading phase from the contribution service ? Is the
> > contribution
> > service responsible to register these model objects
> > (e.gcomponentDefinition) into some specific model repository (
> > e.g the domain) ? and If so, how do I got about doing this ?
> >
> >
> > Could someone please share some ideas, or more concrete example on
> > how I'd
> > go about integrating the Contribution service into the big picture ?
> Hi Luciano,
>
> Any chance of integrating this over the next day(s) or so into trunk?
> I posted a note a few days back that I'd like to get the contribution
> service working with some of the extensions we have including Spring,
> Transactions, JPA, and DataSources and inquired about the status of
> this work. This would also help out when we get to releasing those
> extensions (or other ones people may be interested in such as Groovy).
>
> Thanks,
> Jim
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>

Re: Integrating Contribution services with DefaultSCAContainer

Posted by Jim Marino <jm...@myromatours.com>.
On Feb 25, 2007, at 1:00 PM, Luciano Resende wrote:

> I want to start getting the Contribution service integrated to the  
> process
> of running components, and I was thinking to give it a try by  
> integrating
> the service with the new DeafultSCAContatiner that some sample apps  
> in the
> integration branch is using. I think the idea is to stop using the  
> launcher
> to consume the application SCDL, and ask the Contribution service  
> to process
> the application as a contribution.
>
> from:
> component = launcher.bootApplication("application", applicationSCDL);
>
> to maybe:
> URI appURI = this.contributionService.contribute(contributionLocation,
> false);
> ...
>
> Today, when you ask the contribution service to consume an  
> application, you
> will get back an URI, that is an ID for that contribution. So, my  
> question
> is, how the external world would get access to the model objects  
> created
> during the loading phase from the contribution service ? Is the  
> contribution
> service responsible to register these model objects
> (e.gcomponentDefinition) into some specific model repository (
> e.g the domain) ? and If so, how do I got about doing this ?
>
>
> Could someone please share some ideas, or more concrete example on  
> how I'd
> go about integrating the Contribution service into the big picture ?
Hi Luciano,

Any chance of integrating this over the next day(s) or so into trunk?  
I posted a note a few days back that I'd like to get the contribution  
service working with some of the extensions we have including Spring,  
Transactions, JPA, and DataSources and inquired about the status of  
this work. This would also help out when we get to releasing those  
extensions (or other ones people may be interested in such as Groovy).

Thanks,
Jim


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org