[jboss-cvs] JBoss Messaging SVN: r7613 - in trunk/examples/javaee: mdb-bmt and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jul 27 10:47:03 EDT 2009


Author: ataylor
Date: 2009-07-27 10:47:02 -0400 (Mon, 27 Jul 2009)
New Revision: 7613

Added:
   trunk/examples/javaee/mdb-bmt/
   trunk/examples/javaee/mdb-bmt/src/org/jboss/javaee/example/MDB_BMTClientExample.java
   trunk/examples/javaee/mdb-bmt/src/org/jboss/javaee/example/server/MDB_BMTExample.java
Removed:
   trunk/examples/javaee/mdb-bmp/
   trunk/examples/javaee/mdb-bmt/src/org/jboss/javaee/example/MDB_BMPClientExample.java
   trunk/examples/javaee/mdb-bmt/src/org/jboss/javaee/example/server/MDB_BMPExample.java
Modified:
   trunk/examples/javaee/mdb-bmt/build.xml
   trunk/examples/javaee/mdb-bmt/readme.html
   trunk/examples/javaee/messaging-javaee-examples.iml
Log:
renamed examples

Copied: trunk/examples/javaee/mdb-bmt (from rev 7610, trunk/examples/javaee/mdb-bmp)

Modified: trunk/examples/javaee/mdb-bmt/build.xml
===================================================================
--- trunk/examples/javaee/mdb-bmp/build.xml	2009-07-27 13:26:00 UTC (rev 7610)
+++ trunk/examples/javaee/mdb-bmt/build.xml	2009-07-27 14:47:02 UTC (rev 7613)
@@ -31,7 +31,7 @@
    
    <target name="run">
       <antcall target="runExample">
-         <param name="example.classname" value="org.jboss.javaee.example.MDB_BMPClientExample"/>
+         <param name="example.classname" value="org.jboss.javaee.example.MDB_BMTClientExample"/>
       </antcall>
    </target>
 </project>
\ No newline at end of file

Modified: trunk/examples/javaee/mdb-bmt/readme.html
===================================================================
--- trunk/examples/javaee/mdb-bmp/readme.html	2009-07-27 13:26:00 UTC (rev 7610)
+++ trunk/examples/javaee/mdb-bmt/readme.html	2009-07-27 14:47:02 UTC (rev 7613)
@@ -1,12 +1,12 @@
 <html>
   <head>
-    <title>JBoss Messaging Java EE MDB BMP Example</title>
+    <title>JBoss Messaging Java EE MDB Bean Managed Transaction Example</title>
     <link rel="stylesheet" type="text/css" href="../../common/common.css">
   </head>
   <body>
-     <h1>Java EE MDB BMP Example</h1>
+     <h1>Java EE MDB Bean Managed Transaction Example</h1>
      <br>
-     <p>This example shows you how to send a message to an MDB configured to use Bean Managed Persistence</p>
+     <p>This example shows you how to send a message to an MDB configured to use Bean Managed Transactions</p>
      <p>
          The example will send deploy a simple MDB and demonstrate sending a message and the MDB consuming it
      </p>

Deleted: trunk/examples/javaee/mdb-bmt/src/org/jboss/javaee/example/MDB_BMPClientExample.java
===================================================================
--- trunk/examples/javaee/mdb-bmp/src/org/jboss/javaee/example/MDB_BMPClientExample.java	2009-07-27 13:26:00 UTC (rev 7610)
+++ trunk/examples/javaee/mdb-bmt/src/org/jboss/javaee/example/MDB_BMPClientExample.java	2009-07-27 14:47:02 UTC (rev 7613)
@@ -1,84 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.javaee.example;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.InitialContext;
-
-/**
- * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
- */
-public class MDB_BMPClientExample
-{
-   public static void main(String[] args) throws Exception
-   {
-      Connection connection = null;
-      InitialContext initialContext = null;
-      try
-      {
-         //Step 1. Create an initial context to perform the JNDI lookup.
-         initialContext = new InitialContext();
-
-         //Step 2. Perfom a lookup on the queue
-         Queue queue = (Queue) initialContext.lookup("/queue/testQueue");
-
-         //Step 3. Perform a lookup on the Connection Factory
-         ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");
-
-         //Step 4.Create a JMS Connection
-         connection = cf.createConnection();
-
-         //Step 5. Create a JMS Session
-         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
-         //Step 6. Create a JMS Message Producer
-         MessageProducer producer = session.createProducer(queue);
-
-         //Step 7. Create a Text Message
-         TextMessage message = session.createTextMessage("This is a text message");
-
-         System.out.println("Sent message: " + message.getText());
-
-         //Step 8. Send the Message
-         producer.send(message);
-
-          //Step 9, 10 and 11 in MDB_BMPExample
-      }
-      finally
-      {
-         //Step 12. Be sure to close our JMS resources!
-         if (initialContext != null)
-         {
-            initialContext.close();
-         }
-         if(connection != null)
-         {
-            connection.close();
-         }
-      }
-   }
-}
\ No newline at end of file

Copied: trunk/examples/javaee/mdb-bmt/src/org/jboss/javaee/example/MDB_BMTClientExample.java (from rev 7610, trunk/examples/javaee/mdb-bmp/src/org/jboss/javaee/example/MDB_BMPClientExample.java)
===================================================================
--- trunk/examples/javaee/mdb-bmt/src/org/jboss/javaee/example/MDB_BMTClientExample.java	                        (rev 0)
+++ trunk/examples/javaee/mdb-bmt/src/org/jboss/javaee/example/MDB_BMTClientExample.java	2009-07-27 14:47:02 UTC (rev 7613)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.javaee.example;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.InitialContext;
+
+/**
+ * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
+ */
+public class MDB_BMPClientExample
+{
+   public static void main(String[] args) throws Exception
+   {
+      Connection connection = null;
+      InitialContext initialContext = null;
+      try
+      {
+         //Step 1. Create an initial context to perform the JNDI lookup.
+         initialContext = new InitialContext();
+
+         //Step 2. Perfom a lookup on the queue
+         Queue queue = (Queue) initialContext.lookup("/queue/testQueue");
+
+         //Step 3. Perform a lookup on the Connection Factory
+         ConnectionFactory cf = (ConnectionFactory) initialContext.lookup("/ConnectionFactory");
+
+         //Step 4.Create a JMS Connection
+         connection = cf.createConnection();
+
+         //Step 5. Create a JMS Session
+         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+         //Step 6. Create a JMS Message Producer
+         MessageProducer producer = session.createProducer(queue);
+
+         //Step 7. Create a Text Message
+         TextMessage message = session.createTextMessage("This is a text message");
+
+         System.out.println("Sent message: " + message.getText());
+
+         //Step 8. Send the Message
+         producer.send(message);
+
+          //Step 9, 10 and 11 in MDB_BMPExample
+      }
+      finally
+      {
+         //Step 12. Be sure to close our JMS resources!
+         if (initialContext != null)
+         {
+            initialContext.close();
+         }
+         if(connection != null)
+         {
+            connection.close();
+         }
+      }
+   }
+}
\ No newline at end of file

Deleted: trunk/examples/javaee/mdb-bmt/src/org/jboss/javaee/example/server/MDB_BMPExample.java
===================================================================
--- trunk/examples/javaee/mdb-bmp/src/org/jboss/javaee/example/server/MDB_BMPExample.java	2009-07-27 13:26:00 UTC (rev 7610)
+++ trunk/examples/javaee/mdb-bmt/src/org/jboss/javaee/example/server/MDB_BMPExample.java	2009-07-27 14:47:02 UTC (rev 7613)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.javaee.example.server;
-
-import javax.annotation.Resource;
-import javax.ejb.ActivationConfigProperty;
-import javax.ejb.MessageDriven;
-import javax.ejb.MessageDrivenContext;
-import javax.ejb.TransactionManagement;
-import javax.ejb.TransactionManagementType;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.TextMessage;
-import javax.transaction.UserTransaction;
-
-/**
- * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
- */
- at MessageDriven(name = "MDB_BMPExample",
-               activationConfig =
-                     {
-                        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
-                        @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/testQueue"),
-                        @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Dups-ok-acknowledge")
-                     })
- at TransactionManagement(value= TransactionManagementType.BEAN)
-public class MDB_BMPExample implements MessageListener
-{
-   @Resource
-   MessageDrivenContext ctx;
-
-   public void onMessage(Message message)
-   {
-      try
-      {
-         //Step 9. We know the client is sending a text message so we cast
-         TextMessage textMessage = (TextMessage)message;
-
-         //Step 10. get the text from the message.
-         String text = textMessage.getText();
-
-         System.out.println("message " + text + " received");
-
-         //Step 11. lets look at the user transaction to make sure there isn't one.
-         UserTransaction tx = ctx.getUserTransaction();
-
-         if(tx != null)
-         {
-            tx.begin();
-            System.out.println("we're in the middle of a transaction: " + tx);
-            tx.commit();
-         }
-         else
-         {
-            System.out.println("something is wrong, I was expecting a transaction");
-         }
-      }
-      catch (Exception e)
-      {
-         e.printStackTrace();
-      }
-   }
-}
\ No newline at end of file

Copied: trunk/examples/javaee/mdb-bmt/src/org/jboss/javaee/example/server/MDB_BMTExample.java (from rev 7610, trunk/examples/javaee/mdb-bmp/src/org/jboss/javaee/example/server/MDB_BMPExample.java)
===================================================================
--- trunk/examples/javaee/mdb-bmt/src/org/jboss/javaee/example/server/MDB_BMTExample.java	                        (rev 0)
+++ trunk/examples/javaee/mdb-bmt/src/org/jboss/javaee/example/server/MDB_BMTExample.java	2009-07-27 14:47:02 UTC (rev 7613)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.javaee.example.server;
+
+import javax.annotation.Resource;
+import javax.ejb.ActivationConfigProperty;
+import javax.ejb.MessageDriven;
+import javax.ejb.MessageDrivenContext;
+import javax.ejb.TransactionManagement;
+import javax.ejb.TransactionManagementType;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.TextMessage;
+import javax.transaction.UserTransaction;
+
+/**
+ * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
+ */
+ at MessageDriven(name = "MDB_BMTExample",
+               activationConfig =
+                     {
+                        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
+                        @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/testQueue"),
+                        @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Dups-ok-acknowledge")
+                     })
+ at TransactionManagement(value= TransactionManagementType.BEAN)
+public class MDB_BMPExample implements MessageListener
+{
+   @Resource
+   MessageDrivenContext ctx;
+
+   public void onMessage(Message message)
+   {
+      try
+      {
+         //Step 9. We know the client is sending a text message so we cast
+         TextMessage textMessage = (TextMessage)message;
+
+         //Step 10. get the text from the message.
+         String text = textMessage.getText();
+
+         System.out.println("message " + text + " received");
+
+         //Step 11. lets look at the user transaction to make sure there isn't one.
+         UserTransaction tx = ctx.getUserTransaction();
+
+         if(tx != null)
+         {
+            tx.begin();
+            System.out.println("we're in the middle of a transaction: " + tx);
+            tx.commit();
+         }
+         else
+         {
+            System.out.println("something is wrong, I was expecting a transaction");
+         }
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+      }
+   }
+}
\ No newline at end of file

Modified: trunk/examples/javaee/messaging-javaee-examples.iml
===================================================================
--- trunk/examples/javaee/messaging-javaee-examples.iml	2009-07-27 14:43:26 UTC (rev 7612)
+++ trunk/examples/javaee/messaging-javaee-examples.iml	2009-07-27 14:47:02 UTC (rev 7613)
@@ -56,8 +56,8 @@
       <sourceFolder url="file://$MODULE_DIR$/hajndi/src" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/jca-config/src" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/jms-bridge/src" isTestSource="false" />
-      <sourceFolder url="file://$MODULE_DIR$/mdb-bmp/src" isTestSource="true" />
-      <sourceFolder url="file://$MODULE_DIR$/mdb-cmp-setrollbackonly/src" isTestSource="true" />
+      <sourceFolder url="file://$MODULE_DIR$/mdb-bmt/src" isTestSource="true" />
+      <sourceFolder url="file://$MODULE_DIR$/mdb-cmt-setrollbackonly/src" isTestSource="true" />
       <sourceFolder url="file://$MODULE_DIR$/mdb-cmp-tx-local/src" isTestSource="true" />
       <sourceFolder url="file://$MODULE_DIR$/mdb-cmp-tx-not-supported/src" isTestSource="true" />
       <sourceFolder url="file://$MODULE_DIR$/mdb-cmp-tx-required/src" isTestSource="false" />




More information about the jboss-cvs-commits mailing list