Author: antelder
Date: Tue Mar 29 12:11:26 2011
New Revision: 1086563
URL: http://svn.apache.org/viewvc?rev=1086563&view=rev
Log:
Start adding the getting started helloworld samples back to trunk samples
Added:
tuscany/sca-java-2.x/trunk/samples/getting-started/
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld/
- copied from r1086534,
tuscany/sca-java-2.x/trunk/unreleased/samples/helloworld-contribution/
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/
(with props)
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/README
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/pom.xml
(with props)
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/main/
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/main/java/
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/main/java/sample/
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/main/java/sample/Helloworld.java
(with props)
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/main/java/sample/HelloworldSCAClient.java
(with props)
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/main/resources/
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/test/
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/test/java/
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/test/java/sample/
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/test/java/sample/HelloworldTestCase.java
(with props)
tuscany/sca-java-2.x/trunk/samples/getting-started/pom.xml (with props)
Modified:
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld/README
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld/pom.xml
tuscany/sca-java-2.x/trunk/samples/pom.xml
Propchange:
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Mar 29 12:11:26 2011
@@ -0,0 +1,20 @@
+target
+work
+dojo
+*.iws
+*.ipr
+*.iml
+derby.log
+maven.log
+maven-eclipse.xml
+build.xml
+build-dependency.xml
+velocity.log*
+junit*.properties
+surefire*.properties
+.project
+.classpath
+.settings
+.deployables
+.wtpmodules
+.externalToolBuilders
Added:
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/README
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/README?rev=1086563&view=auto
==============================================================================
---
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/README
(added)
+++
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/README
Tue Mar 29 12:11:26 2011
@@ -0,0 +1,24 @@
+Tuscany - Getting Started - Helloworld SCAClient Sample
+-------------------------------------------------------
+
+This sample demonstrates using the OASIS SCAClient API to invoke a service in
a remote SCA domain.
+
+See the README in the top-level samples folder for general information on the
Tuscany samples.
+
+This project has a Java class with a main method which uses the SCAClient API
to invoke a Helloworld
+service in a remote SCA domain.
+
+Before running this sample you must have a helloworld service running in a SCA
domain somewhere,
+for example, you may do using a separate command prompt and running the
Tuscany
+"Getting Started - Helloworld Sample" with the command "mvn tuscany:run
-DdomainURI=uri:default".
+
+You can then run this SCAClient sample with the Maven command:
+
+ mvn exec:java
+
+You should see the following oputput:
+
+ HelloworldSCAClient, using domainURI uri:default
+ Calling HelloworldComponent.sayHello("world")
+ Hello world
+
Added:
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/pom.xml
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/pom.xml?rev=1086563&view=auto
==============================================================================
---
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/pom.xml
(added)
+++
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/pom.xml
Tue Mar 29 12:11:26 2011
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.tuscany.sca.samples</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <artifactId>helloworld-scaclient</artifactId>
+ <version>2.0-SNAPSHOT</version>
+
+ <name>Apache Tuscany SCA Samples Helloworld SCAClient</name>
+
+ <properties>
+ <tuscany.version>${project.version}</tuscany.version>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-base-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-domain-hazelcast</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1.1</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <mainClass>sample.HelloworldSCAClient</mainClass>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange:
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/main/java/sample/Helloworld.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/main/java/sample/Helloworld.java?rev=1086563&view=auto
==============================================================================
---
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/main/java/sample/Helloworld.java
(added)
+++
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/main/java/sample/Helloworld.java
Tue Mar 29 12:11:26 2011
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface Helloworld {
+
+ String sayHello(String name);
+
+}
Propchange:
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/main/java/sample/Helloworld.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/main/java/sample/Helloworld.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/main/java/sample/HelloworldSCAClient.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/main/java/sample/HelloworldSCAClient.java?rev=1086563&view=auto
==============================================================================
---
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/main/java/sample/HelloworldSCAClient.java
(added)
+++
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/main/java/sample/HelloworldSCAClient.java
Tue Mar 29 12:11:26 2011
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample;
+
+import java.net.URI;
+
+import org.oasisopen.sca.NoSuchDomainException;
+import org.oasisopen.sca.NoSuchServiceException;
+import org.oasisopen.sca.client.SCAClientFactory;
+
+public class HelloworldSCAClient {
+
+ public static void main(String[] args) throws NoSuchDomainException,
NoSuchServiceException {
+
+ String domainURI = System.getProperties().getProperty("domainURI");
+ if (domainURI == null || domainURI.length() < 1) {
+ domainURI = "uri:default";
+ }
+ System.out.println("HelloworldSCAClient, using domainURI " +
domainURI);
+
+ String name = args.length < 1 ? "world" : args[0];
+
+ SCAClientFactory factory =
SCAClientFactory.newInstance(URI.create(domainURI));
+ Helloworld service = factory.getService(Helloworld.class,
"HelloworldComponent");
+
+ System.out.println("Calling HelloworldComponent.sayHello(\"" + name +
"\")");
+ System.out.println(service.sayHello(name));
+ }
+
+}
Propchange:
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/main/java/sample/HelloworldSCAClient.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/main/java/sample/HelloworldSCAClient.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/test/java/sample/HelloworldTestCase.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/test/java/sample/HelloworldTestCase.java?rev=1086563&view=auto
==============================================================================
---
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/test/java/sample/HelloworldTestCase.java
(added)
+++
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/test/java/sample/HelloworldTestCase.java
Tue Mar 29 12:11:26 2011
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample;
+
+import org.apache.tuscany.sca.Node;
+import org.apache.tuscany.sca.TuscanyRuntime;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.monitor.ValidationException;
+import org.apache.tuscany.sca.runtime.ActivationException;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchDomainException;
+import org.oasisopen.sca.NoSuchServiceException;
+
+public class HelloworldTestCase {
+
+ static Node node;
+
+ @Test
+ public void testSayHello() throws NoSuchDomainException,
NoSuchServiceException {
+ HelloworldSCAClient.main(new String[0]);
+ }
+
+ @BeforeClass
+ public static void start() throws ContributionReadException,
ActivationException, ValidationException {
+ node = TuscanyRuntime.newInstance().createNode("uri:default");
+ node.installContribution(null, "../helloworld/target/classes", null,
null, true);
+ }
+
+ @AfterClass
+ public static void stop() {
+ if (node != null) {
+ node.stop();
+ }
+ }
+
+}
Propchange:
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/test/java/sample/HelloworldTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-scaclient/src/test/java/sample/HelloworldTestCase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld/README
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld/README?rev=1086563&r1=1086534&r2=1086563&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld/README
(original)
+++ tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld/README Tue
Mar 29 12:11:26 2011
@@ -5,7 +5,7 @@ This sample demonstrates a simple hellow
See the README in the top-level samples folder for general information on the
Tuscany samples.
-This project creates an SCA contribution with a deployable composite named
helloworld.comosite.
+This project creates an SCA contribution with a deployable composite named
helloworld.composite.
The composite defines an SCA component, HelloworldComponent, which provides a
Helloworld service,
the component is implemented by a Java class.
Modified: tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld/pom.xml
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld/pom.xml?rev=1086563&r1=1086534&r2=1086563&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld/pom.xml
(original)
+++ tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld/pom.xml Tue
Mar 29 12:11:26 2011
@@ -21,21 +21,20 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca.samples</groupId>
- <artifactId>tuscany-samples</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
+ <parent>
+ <groupId>org.apache.tuscany.sca.samples</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
- <groupId>org.apache.tuscany.sca.samples</groupId>
- <artifactId>helloworld-contribution</artifactId>
+ <artifactId>helloworld</artifactId>
<version>2.0-SNAPSHOT</version>
- <name>Tuscany Sample Helloworld Contribution</name>
+ <name>Apache Tuscany SCA Samples Helloworld</name>
<properties>
- <tuscany.version>2.0-SNAPSHOT</tuscany.version>
+ <tuscany.version>${project.version}</tuscany.version>
</properties>
<dependencies>
@@ -64,7 +63,6 @@
</dependencies>
<build>
- <defaultGoal>install</defaultGoal>
<plugins>
<plugin>
@@ -76,4 +74,4 @@
</build>
-</project>
\ No newline at end of file
+</project>
Added: tuscany/sca-java-2.x/trunk/samples/getting-started/pom.xml
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/getting-started/pom.xml?rev=1086563&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/getting-started/pom.xml (added)
+++ tuscany/sca-java-2.x/trunk/samples/getting-started/pom.xml Tue Mar 29
12:11:26 2011
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca.samples</groupId>
+ <artifactId>tuscany-samples</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>tuscany-samples-getting-started</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Samples Getting Started</name>
+
+ <modules>
+ <module>helloworld</module>
+ </modules>
+
+</project>
Propchange: tuscany/sca-java-2.x/trunk/samples/getting-started/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tuscany/sca-java-2.x/trunk/samples/getting-started/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: tuscany/sca-java-2.x/trunk/samples/pom.xml
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/pom.xml?rev=1086563&r1=1086562&r2=1086563&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/pom.xml (original)
+++ tuscany/sca-java-2.x/trunk/samples/pom.xml Tue Mar 29 12:11:26 2011
@@ -32,6 +32,7 @@
<name>Apache Tuscany SCA Samples</name>
<modules>
+ <module>getting-started</module>
</modules>
</project>