summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-04-23 11:09:39 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-04-23 11:09:39 +0000
commit819a77513852144dd60117dbf3e40cb9f110c23c (patch)
tree99344cf5df085b7e13d282eee040e2bf3efc872c
parentf2f3de55f8833f6458ea8396fe3df749fd3c54e3 (diff)
Update to embedded helloworld sample contribution
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@937250 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--sca-java-2.x/trunk/samples/webapps/helloworld/pom.xml26
-rw-r--r--sca-java-2.x/trunk/samples/webapps/helloworld/src/main/java/sample/HelloworldService.java25
-rw-r--r--sca-java-2.x/trunk/samples/webapps/helloworld/src/main/java/sample/HelloworldServiceImpl.java38
-rw-r--r--sca-java-2.x/trunk/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.composite29
-rw-r--r--sca-java-2.x/trunk/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.xml10
5 files changed, 36 insertions, 92 deletions
diff --git a/sca-java-2.x/trunk/samples/webapps/helloworld/pom.xml b/sca-java-2.x/trunk/samples/webapps/helloworld/pom.xml
index 9c8c28cf64..d43e0a949a 100644
--- a/sca-java-2.x/trunk/samples/webapps/helloworld/pom.xml
+++ b/sca-java-2.x/trunk/samples/webapps/helloworld/pom.xml
@@ -43,6 +43,32 @@
<build>
<finalName>helloworld</finalName>
<plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>sample-helloworld</artifactId>
+ <version>${pom.version}</version>
+ <!-- should really go in the target folder but i can't get jetty:run to work using that -->
+ <outputDirectory>src/main/webapp/embeddedContributions</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
diff --git a/sca-java-2.x/trunk/samples/webapps/helloworld/src/main/java/sample/HelloworldService.java b/sca-java-2.x/trunk/samples/webapps/helloworld/src/main/java/sample/HelloworldService.java
deleted file mode 100644
index 53ff7a5ca1..0000000000
--- a/sca-java-2.x/trunk/samples/webapps/helloworld/src/main/java/sample/HelloworldService.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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;
-
-public interface HelloworldService {
-
- String sayHello(String name);
-
-}
diff --git a/sca-java-2.x/trunk/samples/webapps/helloworld/src/main/java/sample/HelloworldServiceImpl.java b/sca-java-2.x/trunk/samples/webapps/helloworld/src/main/java/sample/HelloworldServiceImpl.java
deleted file mode 100644
index 8d220029a5..0000000000
--- a/sca-java-2.x/trunk/samples/webapps/helloworld/src/main/java/sample/HelloworldServiceImpl.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.EagerInit;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Scope;
-
-@EagerInit
-@Scope("COMPOSITE")
-public class HelloworldServiceImpl implements HelloworldService {
-
- public String sayHello(String name) {
- return "Hello " + name;
- }
-
- @Init
- public void init() {
- System.out.println(sayHello("world"));
- }
-
-}
diff --git a/sca-java-2.x/trunk/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.composite b/sca-java-2.x/trunk/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.composite
deleted file mode 100644
index 8e9976daf8..0000000000
--- a/sca-java-2.x/trunk/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.composite
+++ /dev/null
@@ -1,29 +0,0 @@
-<?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/200912"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://samples"
- name="Helloworld">
-
- <component name="HelloworldComponent">
- <implementation.java class="sample.HelloworldServiceImpl"/>
- </component>
-
-</composite>
diff --git a/sca-java-2.x/trunk/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.xml b/sca-java-2.x/trunk/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.xml
index d7b237641c..5b1b8e6ebb 100644
--- a/sca-java-2.x/trunk/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.xml
+++ b/sca-java-2.x/trunk/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.xml
@@ -24,6 +24,16 @@
<display-name>Apache Tuscany Helloworld Sample</display-name>
+ <context-param>
+ <param-name>contributions</param-name>
+ <param-value>/embeddedContributions</param-value>
+ </context-param>
+
+ <init-param>
+ <param-name>contributions</param-name>
+ <param-value>/embeddedContributions</param-value>
+ </init-param>
+
<filter>
<filter-name>tuscany</filter-name>
<filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>