You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by ant elder <an...@gmail.com> on 2011/06/23 09:47:55 UTC
Getting the Tuscany model objects for a contribution
Someone was asking me about how to load a contribution and get the
Tuscany model objects for its artifacts so I've just committed a
testcase to show one way of doing that, see:
https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/DeployerTestCase.java
That loads a contribution jar and then gets the composite, component
and service thats in the contribution. The main part of the code is:
Node node = TuscanyRuntime.newInstance().createNode();
String curi =
node.installContribution("src/test/resources/sample-helloworld.jar");
node.validateContribution(curi);
Contribution contribution = node.getContribution(curi);
If you wanted to run that in a separate Maven build outside of the
domain-node module build then the simplest dependency to use in a
Maven pom.xml is:
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-base-runtime</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
That seems the simplest approach to me, there are other ways such as
using the Deployer directly, does anyone want to show some code to do
that?
...ant
Re: Getting the Tuscany model objects for a contribution
Posted by Luciano Resende <lu...@gmail.com>.
On Sat, Jun 25, 2011 at 4:38 AM, Nirmal Fernando <ni...@gmail.com> wrote:
> Hi,
>
> On Thu, Jun 23, 2011 at 1:17 PM, ant elder <an...@gmail.com> wrote:
>>
>> Someone was asking me about how to load a contribution and get the
>> Tuscany model objects for its artifacts so I've just committed a
>> testcase to show one way of doing that, see:
>>
>>
>> https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/DeployerTestCase.java
>>
>> That loads a contribution jar and then gets the composite, component
>> and service thats in the contribution. The main part of the code is:
>>
>> Node node = TuscanyRuntime.newInstance().createNode();
>> String curi =
>> node.installContribution("src/test/resources/sample-helloworld.jar");
>> node.validateContribution(curi);
>> Contribution contribution = node.getContribution(curi);
>>
>> If you wanted to run that in a separate Maven build outside of the
>> domain-node module build then the simplest dependency to use in a
>> Maven pom.xml is:
>>
>> <dependency>
>> <groupId>org.apache.tuscany.sca</groupId>
>> <artifactId>tuscany-base-runtime</artifactId>
>> <version>2.0-SNAPSHOT</version>
>> </dependency>
>
> It seems like "2.0-SNAPSHOT" is not there in the Maven public repository,
> instead 2.0-Beta2.
>
> Is it okay to use 2.0-Beta2?
>>
>> That seems the simplest approach to me, there are other ways such as
>> using the Deployer directly, does anyone want to show some code to do
>> that?
>>
>> ...ant
>
When you build current trunk, the 2.-SNAPSHOT will be available in
your local maven repo, and it's also available in the apache snapshot
repository [1]
[1] https://repository.apache.org/content/groups/snapshots/org/apache/tuscany/sca/tuscany-assembly/
--
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/
Re: Getting the Tuscany model objects for a contribution
Posted by Nirmal Fernando <ni...@gmail.com>.
Hi,
On Thu, Jun 23, 2011 at 1:17 PM, ant elder <an...@gmail.com> wrote:
> Someone was asking me about how to load a contribution and get the
> Tuscany model objects for its artifacts so I've just committed a
> testcase to show one way of doing that, see:
>
>
> https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/modules/domain-node/src/test/java/org/apache/tuscany/sca/impl/DeployerTestCase.java
>
> That loads a contribution jar and then gets the composite, component
> and service thats in the contribution. The main part of the code is:
>
> Node node = TuscanyRuntime.newInstance().createNode();
> String curi =
> node.installContribution("src/test/resources/sample-helloworld.jar");
> node.validateContribution(curi);
> Contribution contribution = node.getContribution(curi);
>
> If you wanted to run that in a separate Maven build outside of the
> domain-node module build then the simplest dependency to use in a
> Maven pom.xml is:
>
> <dependency>
> <groupId>org.apache.tuscany.sca</groupId>
> <artifactId>tuscany-base-runtime</artifactId>
> <version>2.0-SNAPSHOT</version>
> </dependency>
>
It seems like "2.0-SNAPSHOT" is not there in the Maven public repository,
instead 2.0-Beta2.
Is it okay to use 2.0-Beta2?
>
> That seems the simplest approach to me, there are other ways such as
> using the Deployer directly, does anyone want to show some code to do
> that?
>
> ...ant
>
--
Best Regards,
Nirmal
C.S.Nirmal J. Fernando
Department of Computer Science & Engineering,
Faculty of Engineering,
University of Moratuwa,
Sri Lanka.
Blog: http://nirmalfdo.blogspot.com/