You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2008/02/14 14:19:37 UTC
svn commit: r627736 - in
/incubator/tuscany/java/sca/samples/helloworld-jms-webapp: ./ src/
src/main/ src/main/java/ src/main/java/helloworld/ src/main/resources/
src/main/webapp/ src/main/webapp/META-INF/ src/main/webapp/WEB-INF/
Author: antelder
Date: Thu Feb 14 05:19:36 2008
New Revision: 627736
URL: http://svn.apache.org/viewvc?rev=627736&view=rev
Log:
Add JMS helloworld webapp sample
Added:
incubator/tuscany/java/sca/samples/helloworld-jms-webapp/
incubator/tuscany/java/sca/samples/helloworld-jms-webapp/pom.xml (with props)
incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/
incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/
incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/
incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/
incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/HelloWorldClient.java (with props)
incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/HelloWorldService.java (with props)
incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/HelloWorldServiceImpl.java (with props)
incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/resources/
incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/
incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/META-INF/
incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/META-INF/HelloWorld.composite
incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/META-INF/sca-contribution.xml (with props)
incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/WEB-INF/
incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/WEB-INF/web.xml (with props)
incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/hello.jsp
Added: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/helloworld-jms-webapp/pom.xml?rev=627736&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/helloworld-jms-webapp/pom.xml (added)
+++ incubator/tuscany/java/sca/samples/helloworld-jms-webapp/pom.xml Thu Feb 14 05:19:36 2008
@@ -0,0 +1,53 @@
+<?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.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-helloworld-jms-webapp</artifactId>
+ <packaging>war</packaging>
+ <name>Apache Tuscany SCA JMS HelloWorld Sample in a WebApp</name>
+
+ <repositories>
+ <repository>
+ <id>apache.incubator</id>
+ <url>http://people.apache.org/repo/m2-incubating-repository</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-runtime-war</artifactId>
+ <version>1.2-incubating-SNAPSHOT</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+
+</project>
Propchange: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/pom.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/HelloWorldClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/HelloWorldClient.java?rev=627736&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/HelloWorldClient.java (added)
+++ incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/HelloWorldClient.java Thu Feb 14 05:19:36 2008
@@ -0,0 +1,37 @@
+/*
+ * 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 helloworld;
+
+/**
+ * The HelloWorld client implementation
+ */
+public class HelloWorldClient implements HelloWorldService {
+
+ HelloWorldService helloWorldService;
+
+ public String sayHello(String name) {
+ System.out.println("HelloWorldClient.sayHello " + name);
+ return helloWorldService.sayHello(name);
+ }
+
+ public void setHelloWorldService(HelloWorldService helloWorldService) {
+ System.out.println("HelloWorldClient .setHelloWorldService " + helloWorldService);
+ this.helloWorldService = helloWorldService;
+ }
+}
\ No newline at end of file
Propchange: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/HelloWorldClient.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/HelloWorldClient.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/HelloWorldService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/HelloWorldService.java?rev=627736&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/HelloWorldService.java (added)
+++ incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/HelloWorldService.java Thu Feb 14 05:19:36 2008
@@ -0,0 +1,29 @@
+/*
+ * 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 helloworld;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * The interface for the helloworld service
+ */
+@Remotable
+public interface HelloWorldService {
+ public String sayHello(String name);
+}
Propchange: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/HelloWorldService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/HelloWorldService.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/HelloWorldServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/HelloWorldServiceImpl.java?rev=627736&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/HelloWorldServiceImpl.java (added)
+++ incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/HelloWorldServiceImpl.java Thu Feb 14 05:19:36 2008
@@ -0,0 +1,34 @@
+/*
+ * 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 helloworld;
+
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements the HelloWorld service.
+ */
+@Service(HelloWorldService.class)
+public class HelloWorldServiceImpl implements HelloWorldService {
+
+ public String sayHello(String name) {
+ System.out.println("HelloWorldServiceImpl .sayHello " + name);
+ return "Hello " + name;
+ }
+
+}
Propchange: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/HelloWorldServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/java/helloworld/HelloWorldServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/META-INF/HelloWorld.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/META-INF/HelloWorld.composite?rev=627736&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/META-INF/HelloWorld.composite (added)
+++ incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/META-INF/HelloWorld.composite Thu Feb 14 05:19:36 2008
@@ -0,0 +1,62 @@
+<?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://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="HelloWorld">
+
+ <component name="HelloWorldClient">
+ <implementation.java class="helloworld.HelloWorldClient"/>
+ <reference name="helloWorldService">
+ <interface.java interface="helloworld.HelloWorldService"/>
+ <!-- binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
+ jndiURL="tcp://localhost:61619">
+ <destination name="RequestQueue" create="always"/>
+ <response>
+ <destination name="ResponseQueue" create="always"/>
+ </response>
+ </binding.jms -->
+ <binding.jms>
+ <destination name="RequestQueue"/>
+ <response>
+ <destination name="ResponseQueue"/>
+ </response>
+ </binding.jms>
+ </reference>
+ </component>
+
+ <component name="HelloWorldServiceComponent">
+ <implementation.java class="helloworld.HelloWorldServiceImpl" />
+ <service name="HelloWorldService">
+ <interface.java interface="helloworld.HelloWorldService"/>
+ <!-- binding.jms initialContextFactory="org.apache.activemq.jndi.ActiveMQInitialContextFactory"
+ jndiURL="tcp://localhost:61619">
+ <destination name="RequestQueue" create="always"/>
+ <response>
+ <destination name="ResponseQueue" create="always"/>
+ </response>
+ </binding.jms -->
+ <binding.jms>
+ <destination name="RequestQueue"/>
+ </binding.jms>
+ </service>
+ </component>
+
+</composite>
Added: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/META-INF/sca-contribution.xml?rev=627736&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/META-INF/sca-contribution.xml (added)
+++ incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/META-INF/sca-contribution.xml Thu Feb 14 05:19:36 2008
@@ -0,0 +1,24 @@
+<?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.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:HelloWorld"/>
+</contribution>
\ No newline at end of file
Propchange: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/META-INF/sca-contribution.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/WEB-INF/web.xml?rev=627736&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/WEB-INF/web.xml (added)
+++ incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/WEB-INF/web.xml Thu Feb 14 05:19:36 2008
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ * 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.
+-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
+Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+
+ <display-name>Apache Tuscany JMS Web Service Sample</display-name>
+
+ <filter>
+ <filter-name>tuscany</filter-name>
+ <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>tuscany</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <welcome-file-list id="WelcomeFileList">
+ <welcome-file>hello.jsp</welcome-file>
+ </welcome-file-list>
+
+</web-app>
Propchange: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/hello.jsp
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/hello.jsp?rev=627736&view=auto
==============================================================================
--- incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/hello.jsp (added)
+++ incubator/tuscany/java/sca/samples/helloworld-jms-webapp/src/main/webapp/hello.jsp Thu Feb 14 05:19:36 2008
@@ -0,0 +1,45 @@
+<%--
+ * 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.
+--%>
+
+<%@ page import="org.apache.tuscany.sca.host.embedded.SCADomain"%>
+<%@ page import="helloworld.HelloWorldService" %>
+
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%
+ SCADomain scaDomain = (SCADomain) application.getAttribute("org.apache.tuscany.sca.SCADomain");
+ HelloWorldService helloWorldService = (HelloWorldService)scaDomain.getService(HelloWorldService.class, "HelloWorldClient");
+%>
+<html>
+<head><title>HelloWorld JMS sample</title></head>
+
+<body>
+
+If this sample is working correctly you should see "Hello World" on the next line...
+<p>
+<%= helloWorldService.sayHello("world") %>
+<p>
+If you do not see "Hello World" on the line above then there has been a problem.
+<p>
+The sample requires JMS resources be manually configured in the server environment, these are:
+a JMS connection factory named "ConnectionFactory",
+and two destination queues, one named "RequestQueue" and another named "ResponseQueue".
+See the sample README file for more information.
+
+</body>
+</html>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org