geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlaskow...@apache.org
Subject svn commit: r585279 - in /geronimo/samples/trunk/samples/jms-mdb-sample: jms-mdb-sample-ear/src/main/resources/META-INF/ jms-mdb-sample-ejb/src/main/java/org/apache/geronimo/samples/order/ jms-mdb-sample-ejb/src/main/resources/META-INF/ jms-mdb-sample-...
Date Tue, 16 Oct 2007 22:49:26 GMT
Author: jlaskowski
Date: Tue Oct 16 15:49:18 2007
New Revision: 585279

URL: http://svn.apache.org/viewvc?rev=585279&view=rev
Log:
CommonConnectionFactory -> OrderConnectionFactory - naming consistency
Typo/code warning correction
Code formatting
Unneeded/unused code removal

Modified:
    geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-ear/src/main/resources/META-INF/geronimo-application.xml
    geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-ejb/src/main/java/org/apache/geronimo/samples/order/OrderRecvMDB.java
    geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-ejb/src/main/resources/META-INF/openejb-jar.xml
    geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-war/src/main/java/org/apache/geronimo/samples/order/OrderSenderServlet.java
    geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-war/src/main/webapp/WEB-INF/web.xml
    geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-war/src/main/webapp/error.jsp
    geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-war/src/main/webapp/order.jsp

Modified: geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-ear/src/main/resources/META-INF/geronimo-application.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-ear/src/main/resources/META-INF/geronimo-application.xml?rev=585279&r1=585278&r2=585279&view=diff
==============================================================================
--- geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-ear/src/main/resources/META-INF/geronimo-application.xml
(original)
+++ geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-ear/src/main/resources/META-INF/geronimo-application.xml
Tue Oct 16 15:49:18 2007
@@ -21,7 +21,6 @@
 <!-- $Rev$ $Date$ -->
 
 <application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-1.2">
-
     <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
         <moduleId>
             <groupId>${pom.groupId}</groupId>
@@ -30,7 +29,6 @@
             <type>ear</type>
         </moduleId>
     </environment>
-
     <module>
        <connector>geronimo-activemq-ra-2.0-SNAPSHOT.rar</connector>
         <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
@@ -60,7 +58,7 @@
                     <connection-definition>
                         <connectionfactory-interface>javax.jms.ConnectionFactory</connectionfactory-interface>
                         <connectiondefinition-instance>
-                            <name>CommonConnectionFactory</name>
+                            <name>OrderConnectionFactory</name>
                             <implemented-interface>javax.jms.QueueConnectionFactory</implemented-interface>
                             <implemented-interface>javax.jms.TopicConnectionFactory</implemented-interface>
                             <connectionmanager>
@@ -88,7 +86,5 @@
                 <adminobject-class>org.apache.activemq.command.ActiveMQTopic</adminobject-class>
             </adminobject>
         </connector>
-
     </module>
-
 </application>

Modified: geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-ejb/src/main/java/org/apache/geronimo/samples/order/OrderRecvMDB.java
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-ejb/src/main/java/org/apache/geronimo/samples/order/OrderRecvMDB.java?rev=585279&r1=585278&r2=585279&view=diff
==============================================================================
--- geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-ejb/src/main/java/org/apache/geronimo/samples/order/OrderRecvMDB.java
(original)
+++ geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-ejb/src/main/java/org/apache/geronimo/samples/order/OrderRecvMDB.java
Tue Oct 16 15:49:18 2007
@@ -16,18 +16,8 @@
  */
 package org.apache.geronimo.samples.order;
 
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.Date;
-
-import javax.annotation.Resource;
 import javax.ejb.MessageDriven;
 import javax.ejb.ActivationConfigProperty;
-import javax.ejb.EJBException;
-import javax.ejb.MessageDrivenBean;
-import javax.ejb.MessageDrivenContext;
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageListener;
@@ -43,15 +33,8 @@
                })
 public class OrderRecvMDB implements MessageListener {
 
-    private static final String ORDER_MGMT_INFO = "order_mgmt.properties";
-    private static final String ORDER_REPO = "order.repo";
-
-    public OrderRecvMDB() {
-
-    }
-
     /*
-     * Process a message. <br>
+     * Process a message.
      * 
      * @param message The message to process. 
      */
@@ -59,8 +42,7 @@
         TextMessage textMessage = (TextMessage) message;
         try {
             System.out.println("Order Received \n"+ textMessage.getText());
-        }
-        catch ( JMSException e ) {
+        } catch ( JMSException e ) {
             e.printStackTrace();
         }
     }

Modified: geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-ejb/src/main/resources/META-INF/openejb-jar.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-ejb/src/main/resources/META-INF/openejb-jar.xml?rev=585279&r1=585278&r2=585279&view=diff
==============================================================================
--- geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-ejb/src/main/resources/META-INF/openejb-jar.xml
(original)
+++ geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-ejb/src/main/resources/META-INF/openejb-jar.xml
Tue Oct 16 15:49:18 2007
@@ -1,21 +1,25 @@
+<?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
+    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.
+-->
 
-http://www.apache.org/licenses/LICENSE-2.0
+<!-- $Rev$ $Date$ -->
 
-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.
--->
 <openejb-jar 
 	xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1"
 	xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1" 
@@ -24,7 +28,7 @@
 	<sys:environment>
 		<sys:moduleId>			
 			<sys:groupId>org.apache.geronimo.samples</sys:groupId>
-			<sys:artifactId>OrderEjb</sys:artifactId>
+			<sys:artifactId>OrderMDB</sys:artifactId>
 			<sys:version>1.2</sys:version>
 			<sys:type>car</sys:type>
 		</sys:moduleId>
@@ -34,14 +38,6 @@
 			<sys:artifactId>activemq-broker</sys:artifactId>
 			<sys:type>car</sys:type>
 		</sys:dependency>
-<!--
-           <sys:dependency>
-               <sys:groupId>org.apache.geronimo.samples</sys:groupId>
-               <sys:artifactId>jms-resources</sys:artifactId>
-               <sys:version>1.2</sys:version>
-               <sys:type>rar</sys:type>
-           </sys:dependency>
-  -->
 		</sys:dependencies>
 		<sys:hidden-classes/>
 		<sys:non-overridable-classes/>

Modified: geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-war/src/main/java/org/apache/geronimo/samples/order/OrderSenderServlet.java
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-war/src/main/java/org/apache/geronimo/samples/order/OrderSenderServlet.java?rev=585279&r1=585278&r2=585279&view=diff
==============================================================================
--- geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-war/src/main/java/org/apache/geronimo/samples/order/OrderSenderServlet.java
(original)
+++ geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-war/src/main/java/org/apache/geronimo/samples/order/OrderSenderServlet.java
Tue Oct 16 15:49:18 2007
@@ -20,7 +20,6 @@
 
 import javax.annotation.Resource;
 import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
 import javax.jms.Queue;
 import javax.jms.Connection;
 import javax.jms.Session;
@@ -28,29 +27,33 @@
 import javax.jms.TextMessage;
 import javax.jms.JMSException;
 import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+/**
+ * @Version $Rev$ $Date$
+ */
 public class OrderSenderServlet extends HttpServlet {
 
-    @Resource(name="CommonConnectionFactory")
+    @Resource(name="OrderConnectionFactory")
     private ConnectionFactory factory;
 
     @Resource(name="OrderQueue")
     private Queue receivingQueue;
 
+    @Override
     public void init() throws ServletException {
         super.init();       
     }
 
+    @Override
     protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException,
IOException {
         manageOrders(req,res);
     }
 
+    @Override
     protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException,
IOException {
         doGet(req,res);
     }
@@ -68,12 +71,11 @@
 
             if ( !customerId.equals("") && !orderId.equals("") && !qty.equals("")
) {
                 System.out.println("Start Sending Order Request");
-                // creating online order request
-                String orderRequest = "<Order orderId=\""+orderId+"\" custId=\""+customerId+"\"
qty=\""+qty+"\" model=\""+model+"\"/>" ;
+                path = "/order.jsp";
+
                 connection = factory.createConnection();
                 sess = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);   
-                path = "/order.jsp";
-                TextMessage msg = sess.createTextMessage("<OrderId=" + orderId + " CustomerId="
+ customerId
+                TextMessage msg = sess.createTextMessage("<CustomerId=" + customerId +
" OrderId=" + orderId
                                                          + " Quantity=" + qty + " Model="
+ model + ">" );
                 messageProducer = sess.createProducer(receivingQueue);
                 messageProducer.send(msg);
@@ -83,13 +85,13 @@
                 String error = "";
 
                 if ( customerId.equals("") ) {
-                    error = "Customer Id Cannot be Empty";
+                    error = "Customer Id cannot be empty";
                 }
                 else if ( orderId.equals("") ) {
-                    error = "Order Id Cannot be Empty";
+                    error = "Order Id cannot be empty";
                 }
                 else if ( qty.equals("") ) {
-                    error = "Quantity Cannot be Empty";
+                    error = "Quantity cannot be empty";
                 }
                 req.setAttribute("error",error);
             }

Modified: geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-war/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-war/src/main/webapp/WEB-INF/web.xml?rev=585279&r1=585278&r2=585279&view=diff
==============================================================================
--- geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-war/src/main/webapp/WEB-INF/web.xml
(original)
+++ geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-war/src/main/webapp/WEB-INF/web.xml
Tue Oct 16 15:49:18 2007
@@ -20,8 +20,10 @@
 
 <!-- $Rev$ $Date$ -->
 
-<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
-
+<web-app version="2.5"
+    xmlns="http://java.sun.com/xml/ns/javaee"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
     <description>jms-mdb-sample Servlet Sample</description>
     <servlet>
         <servlet-name>OrderSenderServlet</servlet-name>
@@ -31,24 +33,20 @@
     <servlet-mapping>
         <servlet-name>OrderSenderServlet</servlet-name>
         <url-pattern>/order</url-pattern>
-	</servlet-mapping>
-
-	<resource-ref>
-	    <res-ref-name>CommonConnectionFactory</res-ref-name>
-	    <res-type>javax.jms.QueueConnectionFactory</res-type>
-	    <res-auth>Container</res-auth>
-		<res-sharing-scope>Shareable</res-sharing-scope>
- 	</resource-ref>
-
-	<message-destination-ref>
-	    <message-destination-ref-name>OrderQueue</message-destination-ref-name>
-	    <message-destination-type>javax.jms.Queue</message-destination-type>
-	    <message-destination-usage>Produces</message-destination-usage>
-	    <message-destination-link>OrderQueue</message-destination-link>
-	</message-destination-ref>
-
+    </servlet-mapping>
+    <resource-ref>
+        <res-ref-name>OrderConnectionFactory</res-ref-name>
+        <res-type>javax.jms.QueueConnectionFactory</res-type>
+        <res-auth>Container</res-auth>
+        <res-sharing-scope>Shareable</res-sharing-scope>
+    </resource-ref>
+    <message-destination-ref>
+        <message-destination-ref-name>OrderQueue</message-destination-ref-name>
+        <message-destination-type>javax.jms.Queue</message-destination-type>
+        <message-destination-usage>Produces</message-destination-usage>
+        <message-destination-link>OrderQueue</message-destination-link>
+    </message-destination-ref>
     <welcome-file-list>
         <welcome-file>index.html</welcome-file>
     </welcome-file-list>
-
 </web-app>

Modified: geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-war/src/main/webapp/error.jsp
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-war/src/main/webapp/error.jsp?rev=585279&r1=585278&r2=585279&view=diff
==============================================================================
--- geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-war/src/main/webapp/error.jsp
(original)
+++ geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-war/src/main/webapp/error.jsp
Tue Oct 16 15:49:18 2007
@@ -22,10 +22,7 @@
 	<div align="center">
 		<H2>Error Occured !!!</H2>
 		<BR><BR>
-		<%
-			String error = (String)request.getAttribute("error");
-		%>
-		<b><%=error%></b>
+		<b><%= request.getAttribute("error") %></b>
 		<BR><BR>
 		<a href="../Order/">Home</a>
 	</div>

Modified: geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-war/src/main/webapp/order.jsp
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-war/src/main/webapp/order.jsp?rev=585279&r1=585278&r2=585279&view=diff
==============================================================================
--- geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-war/src/main/webapp/order.jsp
(original)
+++ geronimo/samples/trunk/samples/jms-mdb-sample/jms-mdb-sample-war/src/main/webapp/order.jsp
Tue Oct 16 15:49:18 2007
@@ -22,10 +22,10 @@
     <div div=true align="center">
       <strong><H2>Welcome to the Order Management System</H2><br><br><br></strong>
     <FORM method="POST" action="order">
-	<TABLE width="90%" border="0" bgcolor="cyan">
+	<TABLE width="90%" border="0" style="background-color: cyan">
 	<TR>	
 	<TD><strong>Customer Id</strong></TD>
-	<TD><strong><INPUT type="text" name="customerId"></strong></strong></TD>
+	<TD><strong><INPUT type="text" name="customerId"></strong></TD>
 	</TR>
 	<TR>	
 	<TD><strong>Order Id</strong></TD>



Mime
View raw message