diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-10-28 09:54:25 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-10-28 09:54:25 +0000 |
commit | 613b275ffa5d7ae0c41b625db231c187b8a136ef (patch) | |
tree | 74f448551ee167bfb627fa51849f006e4f5ffb31 /branches/sca-java-2.0-M4/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldServiceImpl.java | |
parent | 17d6a0df23caf287e42c7dbf3919e49d60fdedd2 (diff) |
Create 2.0 M4 release branch
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@830484 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-2.0-M4/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldServiceImpl.java')
-rw-r--r-- | branches/sca-java-2.0-M4/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldServiceImpl.java | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/branches/sca-java-2.0-M4/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldServiceImpl.java b/branches/sca-java-2.0-M4/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldServiceImpl.java new file mode 100644 index 0000000000..cacb88b5e3 --- /dev/null +++ b/branches/sca-java-2.0-M4/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldServiceImpl.java @@ -0,0 +1,44 @@ +package helloworldrest; + +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; + +import org.oasisopen.sca.annotation.Scope; +import org.oasisopen.sca.annotation.Service; + +@Service(HelloWorldService.class) +@Scope("Composite") +@Path("/helloworld") +public class HelloWorldServiceImpl implements HelloWorldService { + + private String name = new String("original!"); + + @Path("/setname") + @PUT + @Consumes("text/plain") + public void setName(String name) { + this.name = name; + + } + + //http://<host>:<port>/helloworld-rest-webapp/HelloWorldService/helloworld/getname + @Path("/getname") + @GET + @Produces("text/plain") + public String getName() { + return this.name; + } + + @POST + @Path("/postoperation/{name}/") + @Consumes("text/plain") + public void postOperationTest(@PathParam("name") String name) { + this.name = name; + } + +} |