diff options
-rw-r--r-- | java/sca/archetypes/contribution-zip/src/main/resources/META-INF/maven/archetype.xml | 10 | ||||
-rw-r--r-- | java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/pom.xml | 6 | ||||
-rw-r--r-- | java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddImpl.java (renamed from java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java) | 74 | ||||
-rw-r--r-- | java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddService.java (renamed from java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/HelloworldService.java) | 50 | ||||
-rw-r--r-- | java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/add.composite (renamed from java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/helloworld.composite) | 4 |
5 files changed, 73 insertions, 71 deletions
diff --git a/java/sca/archetypes/contribution-zip/src/main/resources/META-INF/maven/archetype.xml b/java/sca/archetypes/contribution-zip/src/main/resources/META-INF/maven/archetype.xml index 31bc30120e..6db972b386 100644 --- a/java/sca/archetypes/contribution-zip/src/main/resources/META-INF/maven/archetype.xml +++ b/java/sca/archetypes/contribution-zip/src/main/resources/META-INF/maven/archetype.xml @@ -18,13 +18,13 @@ * under the License. --> <archetype> - <id>tuscany-contribution-jar</id> + <id>tuscany-contribution-zip</id> <sources> - <source>src\main\java\HelloworldImpl.java</source> - <source>src\main\java\HelloworldService.java</source> + <source>src\main\java\AddImpl.java</source> + <source>src\main\java\AddService.java</source> </sources> <resources> - <resource>src\main\hello.composite</resource> - <resource>src\main\webapp\META-INF\sca-contribution.xml</resource> + <resource>src\main\resources\add.composite</resource> + <resource>src\main\resources\META-INF\sca-contribution.xml</resource> </resources> </archetype>
\ No newline at end of file diff --git a/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/pom.xml b/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/pom.xml index 20cb1fe810..a8bbc9b0dc 100644 --- a/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/pom.xml +++ b/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/pom.xml @@ -40,9 +40,9 @@ <!-- AN EXAMPLE APPLICATION DEPENDENCY TO BE INCLUDED IN ZIP --> <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>1.4</version> + <groupId>commons-math</groupId> + <artifactId>commons-math</artifactId> + <version>1.2</version> </dependency> <!-- JUNIT DEPENDENCY FOR TESTING --> diff --git a/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java b/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddImpl.java index 26237c105c..359f2c0a38 100644 --- a/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java +++ b/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddImpl.java @@ -1,36 +1,38 @@ -/* - * 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 ${package}; - -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Scope; -import org.oasisopen.sca.annotation.EagerInit; - -@Scope("COMPOSITE") @EagerInit -public class HelloworldImpl implements HelloworldService { - - public String sayHello(String name) { - return "Hello " + name; - } - - @Init - public void init() { - System.out.println(sayHello("world")); - } -} +/*
+ * 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 ${package};
+
+import org.apache.commons.math.util.MathUtils;
+
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.EagerInit;
+
+@Scope("COMPOSITE") @EagerInit
+public class AddImpl implements AddService {
+
+ public int add(int x, int y) {
+ return MathUtils.addAndCheck(x, y);
+ }
+
+ @Init
+ public void init() {
+ System.out.println("1 + 2 = " + add(1, 2));
+ }
+}
diff --git a/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/HelloworldService.java b/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddService.java index 47501efb9a..1081cb0b2e 100644 --- a/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/HelloworldService.java +++ b/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddService.java @@ -1,25 +1,25 @@ -/* - * 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 ${package}; - -public interface HelloworldService { - - String sayHello(String name); - -} +/*
+ * 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 ${package};
+
+public interface AddService {
+
+ int add(int x, int y);
+
+}
diff --git a/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/helloworld.composite b/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/add.composite index 29d1725fd4..83bc07435d 100644 --- a/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/helloworld.composite +++ b/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/add.composite @@ -22,8 +22,8 @@ targetNamespace="http://${package}"
name="${artifactId}">
- <component name="HelloworldComponent">
- <implementation.java class="${package}.HelloworldImpl"/>
+ <component name="AddComponent">
+ <implementation.java class="${package}.AddImpl"/>
</component>
</composite>
|