summaryrefslogtreecommitdiffstats
path: root/java/sca
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-04-19 08:41:38 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-04-19 08:41:38 +0000
commitf5434dff25e5fb861d84a35ba7c4bcd0afe0b876 (patch)
tree22d6164f9886a42ebc6c015005a0c5e1c7c5bad9 /java/sca
parentf092056d428a18aa52b32538532f97b2a7b7b8f4 (diff)
Update contribution archetypes to support tuscany:run, add EagerInit method to helloworld imls so it outputs 'hello world' on init so its obvious its started up
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@766439 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca')
-rw-r--r--java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml4
-rw-r--r--java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java9
-rw-r--r--java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/pom.xml4
-rw-r--r--java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java5
4 files changed, 22 insertions, 0 deletions
diff --git a/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml b/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml
index a91c20c80b..9bbaa237dd 100644
--- a/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml
+++ b/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml
@@ -97,6 +97,10 @@
<downloadSources>true</downloadSources>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ </plugin>
</plugins>
</build>
<properties>
diff --git a/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java b/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
index 2491816adc..af90e4fe7f 100644
--- a/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
+++ b/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
@@ -18,10 +18,19 @@
*/
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"));
+ }
}
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 026dda5f3c..20cb1fe810 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
@@ -109,6 +109,10 @@
<artifactId>maven-zip-plugin</artifactId>
<extensions>true</extensions>
</plugin>
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ </plugin>
</plugins>
</build>
<properties>
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/HelloworldImpl.java
index 86073fc14d..26237c105c 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/HelloworldImpl.java
@@ -18,6 +18,7 @@
*/
package ${package};
+import org.oasisopen.sca.annotation.Init;
import org.oasisopen.sca.annotation.Scope;
import org.oasisopen.sca.annotation.EagerInit;
@@ -28,4 +29,8 @@ public class HelloworldImpl implements HelloworldService {
return "Hello " + name;
}
+ @Init
+ public void init() {
+ System.out.println(sayHello("world"));
+ }
}