diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-06-24 10:36:45 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-06-24 10:36:45 +0000 |
commit | f865c76a194ed84161310b2f4e254700de033479 (patch) | |
tree | b1ac6bab628820e8d8955916184d6209665e2b56 /sca-java-2.x/contrib/samples/servlet-callback/src/main | |
parent | 2d74722e60aa6fc98604ee4a555f6bb689d7f584 (diff) |
TUSCANY-3517: Apply latest updates to callback sample in servlet-callback-0.0.2.zip
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@957499 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/contrib/samples/servlet-callback/src/main')
5 files changed, 39 insertions, 7 deletions
diff --git a/sca-java-2.x/contrib/samples/servlet-callback/src/main/java/sample/HelloworldService.java b/sca-java-2.x/contrib/samples/servlet-callback/src/main/java/sample/HelloworldService.java index 3777bb4a75..fa6b2c42b1 100644 --- a/sca-java-2.x/contrib/samples/servlet-callback/src/main/java/sample/HelloworldService.java +++ b/sca-java-2.x/contrib/samples/servlet-callback/src/main/java/sample/HelloworldService.java @@ -22,7 +22,7 @@ import org.oasisopen.sca.annotation.Callback; import org.oasisopen.sca.annotation.Remotable; @Remotable -@Callback(CallbackServlet.class) +@Callback(ServletCallback.class) public interface HelloworldService { void sayHello(String name); diff --git a/sca-java-2.x/contrib/samples/servlet-callback/src/main/java/sample/HelloworldServiceImpl.java b/sca-java-2.x/contrib/samples/servlet-callback/src/main/java/sample/HelloworldServiceImpl.java index 3cb1b8a7d7..a4ae0761e4 100644 --- a/sca-java-2.x/contrib/samples/servlet-callback/src/main/java/sample/HelloworldServiceImpl.java +++ b/sca-java-2.x/contrib/samples/servlet-callback/src/main/java/sample/HelloworldServiceImpl.java @@ -24,10 +24,14 @@ import org.oasisopen.sca.annotation.Service; @Service(HelloworldService.class) public class HelloworldServiceImpl implements HelloworldService { + private ServletCallback callback; + @Callback - private CallbackServlet callback; - - public void sayHello(String name) { + public void setCallback(ServletCallback callback) { + this.callback = callback; + } + + public void sayHello(String name) { callback.sendGreeting("Hello " + name + "!"); } diff --git a/sca-java-2.x/contrib/samples/servlet-callback/src/main/java/sample/HelloworldServlet.java b/sca-java-2.x/contrib/samples/servlet-callback/src/main/java/sample/HelloworldServlet.java index c03220de32..0e30b688b0 100644 --- a/sca-java-2.x/contrib/samples/servlet-callback/src/main/java/sample/HelloworldServlet.java +++ b/sca-java-2.x/contrib/samples/servlet-callback/src/main/java/sample/HelloworldServlet.java @@ -31,8 +31,8 @@ import org.oasisopen.sca.ComponentContext; import org.oasisopen.sca.annotation.Reference; import org.oasisopen.sca.annotation.Service; -@Service(CallbackServlet.class) -public class HelloworldServlet extends HttpServlet implements CallbackServlet { +@Service(ServletCallback.class) +public class HelloworldServlet extends HttpServlet implements ServletCallback { private static final long serialVersionUID = 1L; private HttpServletResponse response; diff --git a/sca-java-2.x/contrib/samples/servlet-callback/src/main/java/sample/ServletCallback.java b/sca-java-2.x/contrib/samples/servlet-callback/src/main/java/sample/ServletCallback.java new file mode 100644 index 0000000000..c60c3f8975 --- /dev/null +++ b/sca-java-2.x/contrib/samples/servlet-callback/src/main/java/sample/ServletCallback.java @@ -0,0 +1,28 @@ +/* + * 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.Remotable; + +@Remotable +public interface ServletCallback { + + void sendGreeting(String greeting); + +} diff --git a/sca-java-2.x/contrib/samples/servlet-callback/src/main/webapp/WEB-INF/web.composite b/sca-java-2.x/contrib/samples/servlet-callback/src/main/webapp/WEB-INF/web.composite index fd678ba581..89d168fc10 100644 --- a/sca-java-2.x/contrib/samples/servlet-callback/src/main/webapp/WEB-INF/web.composite +++ b/sca-java-2.x/contrib/samples/servlet-callback/src/main/webapp/WEB-INF/web.composite @@ -25,7 +25,7 @@ <component name="foo"> <implementation.web web-uri=""/> <reference name="service" target="HelloworldComponent"> - <java.interface interface="HelloworldService" callbackInterface="CallbackServlet"/> + <interface.java interface="sample.HelloworldService" callbackInterface="sample.ServletCallback"/> </reference> </component> |