summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/samples/helloworld-spring/src/main/java
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-07-29 00:14:45 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-07-29 00:14:45 +0000
commit49a28fd5795d7ed1d155a2ee571a98e009214281 (patch)
treed19634ec9c8464688804afa3bb438d3ed1502abb /sca-java-2.x/trunk/samples/helloworld-spring/src/main/java
parentf661a34f0314c405134067c843222312f8408db7 (diff)
Add the parent delegation for the SCA spring application context
Improve the sample to demonstrate the child bean wired to a bean in the parent context (WebApplicationContext) git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@980272 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/samples/helloworld-spring/src/main/java')
-rw-r--r--sca-java-2.x/trunk/samples/helloworld-spring/src/main/java/sample/DateServiceImpl.java1
-rw-r--r--sca-java-2.x/trunk/samples/helloworld-spring/src/main/java/sample/HelloworldImpl.java14
2 files changed, 8 insertions, 7 deletions
diff --git a/sca-java-2.x/trunk/samples/helloworld-spring/src/main/java/sample/DateServiceImpl.java b/sca-java-2.x/trunk/samples/helloworld-spring/src/main/java/sample/DateServiceImpl.java
index 2b3c412de3..64bdd86f7c 100644
--- a/sca-java-2.x/trunk/samples/helloworld-spring/src/main/java/sample/DateServiceImpl.java
+++ b/sca-java-2.x/trunk/samples/helloworld-spring/src/main/java/sample/DateServiceImpl.java
@@ -30,6 +30,7 @@ import org.oasisopen.sca.annotation.Service;
public class DateServiceImpl implements DateService {
public Date getDate() {
+ System.out.println("DateServiceImpl.getDate()");
return new Date();
}
diff --git a/sca-java-2.x/trunk/samples/helloworld-spring/src/main/java/sample/HelloworldImpl.java b/sca-java-2.x/trunk/samples/helloworld-spring/src/main/java/sample/HelloworldImpl.java
index a44dcacc3a..125c333ddc 100644
--- a/sca-java-2.x/trunk/samples/helloworld-spring/src/main/java/sample/HelloworldImpl.java
+++ b/sca-java-2.x/trunk/samples/helloworld-spring/src/main/java/sample/HelloworldImpl.java
@@ -18,17 +18,17 @@
*/
package sample;
-import org.oasisopen.sca.annotation.Reference;
public class HelloworldImpl implements Helloworld {
- @Reference(required = false)
- private DateService dateService;
+
+ public HelloworldImpl() {
+ super();
+ System.out.println("HelloworldImpl()");
+ }
public String sayHello(String name) {
- if (dateService == null) {
- return "Hello " + name;
- }
- return "[" + dateService.getDate() + "] Hello " + name;
+ System.out.println("HelloworldImpl.sayHello(" + name + ")");
+ return "Hello " + name;
}
}