Author: antelder
Date: Tue Apr 28 15:40:48 2009
New Revision: 769438

URL: http://svn.apache.org/viewvc?rev=769438&view=rev
Log:
Update zip archetype to use an Add service

Added:
    
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddImpl.java
    
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddService.java
    
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/add.composite
Removed:
    
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
    
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
    
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/helloworld.composite
Modified:
    
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/META-INF/maven/archetype.xml
    
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/pom.xml

Modified: 
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/META-INF/maven/archetype.xml
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/archetypes/contribution-zip/src/main/resources/META-INF/maven/archetype.xml?rev=769438&r1=769437&r2=769438&view=diff
==============================================================================
--- 
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/META-INF/maven/archetype.xml
 (original)
+++ 
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/META-INF/maven/archetype.xml
 Tue Apr 28 15:40:48 2009
@@ -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

Modified: 
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/pom.xml
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/pom.xml?rev=769438&r1=769437&r2=769438&view=diff
==============================================================================
--- 
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/pom.xml
 (original)
+++ 
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/pom.xml
 Tue Apr 28 15:40:48 2009
@@ -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 -->

Added: 
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddImpl.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddImpl.java?rev=769438&view=auto
==============================================================================
--- 
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddImpl.java
 (added)
+++ 
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddImpl.java
 Tue Apr 28 15:40:48 2009
@@ -0,0 +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.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));
+    }
+}

Added: 
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddService.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddService.java?rev=769438&view=auto
==============================================================================
--- 
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddService.java
 (added)
+++ 
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddService.java
 Tue Apr 28 15:40:48 2009
@@ -0,0 +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 AddService {
+
+    int add(int x, int y);
+
+}

Added: 
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/add.composite
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/add.composite?rev=769438&view=auto
==============================================================================
--- 
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/add.composite
 (added)
+++ 
tuscany/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/add.composite
 Tue Apr 28 15:40:48 2009
@@ -0,0 +1,29 @@
+<?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.    
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903";
+           xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0";
+           targetNamespace="http://${package}";
+           name="${artifactId}">
+
+    <component name="AddComponent">
+        <implementation.java class="${package}.AddImpl"/>
+    </component>
+
+</composite>


Reply via email to