[jboss-cvs] JBoss Messaging SVN: r7617 - in trunk/examples/javaee: mdb-cmt-tx-not-supported and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jul 27 10:54:44 EDT 2009


Author: ataylor
Date: 2009-07-27 10:54:44 -0400 (Mon, 27 Jul 2009)
New Revision: 7617

Added:
   trunk/examples/javaee/mdb-cmt-tx-not-supported/
   trunk/examples/javaee/mdb-cmt-tx-not-supported/src/org/jboss/javaee/example/MDB_CMT_TxNotSupportedClientExample.java
   trunk/examples/javaee/mdb-cmt-tx-not-supported/src/org/jboss/javaee/example/server/MDB_CMT_TxNotSupported.java
Removed:
   trunk/examples/javaee/mdb-cmp-tx-not-supported/
   trunk/examples/javaee/mdb-cmt-tx-not-supported/src/org/jboss/javaee/example/MDB_CMP_TxNotSupportedClientExample.java
   trunk/examples/javaee/mdb-cmt-tx-not-supported/src/org/jboss/javaee/example/server/MDB_CMP_TxNotSupported.java
Modified:
   trunk/examples/javaee/mdb-cmt-tx-not-supported/build.xml
   trunk/examples/javaee/mdb-cmt-tx-not-supported/config/ant.properties
   trunk/examples/javaee/mdb-cmt-tx-not-supported/readme.html
   trunk/examples/javaee/messaging-javaee-examples.iml
Log:
renamed examples

Copied: trunk/examples/javaee/mdb-cmt-tx-not-supported (from rev 7610, trunk/examples/javaee/mdb-cmp-tx-not-supported)

Modified: trunk/examples/javaee/mdb-cmt-tx-not-supported/build.xml
===================================================================
--- trunk/examples/javaee/mdb-cmp-tx-not-supported/build.xml	2009-07-27 13:26:00 UTC (rev 7610)
+++ trunk/examples/javaee/mdb-cmt-tx-not-supported/build.xml	2009-07-27 14:54:44 UTC (rev 7617)
@@ -31,7 +31,7 @@
    
    <target name="run">
       <antcall target="runExample">
-         <param name="example.classname" value="org.jboss.javaee.example.MDB_CMP_TxNotSupportedClientExample"/>
+         <param name="example.classname" value="org.jboss.javaee.example.MDB_CMT_TxNotSupportedClientExample"/>
       </antcall>
    </target>
 </project>
\ No newline at end of file

Modified: trunk/examples/javaee/mdb-cmt-tx-not-supported/config/ant.properties
===================================================================
--- trunk/examples/javaee/mdb-cmp-tx-not-supported/config/ant.properties	2009-07-27 13:26:00 UTC (rev 7610)
+++ trunk/examples/javaee/mdb-cmt-tx-not-supported/config/ant.properties	2009-07-27 14:54:44 UTC (rev 7617)
@@ -1 +1 @@
-example.name=mdb-cmp-tx-not-required
\ No newline at end of file
+example.name=mdb-cmt-tx-not-required
\ No newline at end of file

Modified: trunk/examples/javaee/mdb-cmt-tx-not-supported/readme.html
===================================================================
--- trunk/examples/javaee/mdb-cmp-tx-not-supported/readme.html	2009-07-27 13:26:00 UTC (rev 7610)
+++ trunk/examples/javaee/mdb-cmt-tx-not-supported/readme.html	2009-07-27 14:54:44 UTC (rev 7617)
@@ -1,14 +1,14 @@
 <html>
   <head>
-    <title>JBoss Messaging Java EE MDB CMP with NOT_SUPPORTED transaction Example</title>
+    <title>JBoss Messaging Java EE MDB Container Managed Transaction with NOT_SUPPORTED transaction Example</title>
     <link rel="stylesheet" type="text/css" href="../../common/common.css">
   </head>
   <body>
-     <h1>Java EE MDB  with NOT_SUPPORTED transaction Example</h1>
+     <h1>Java EE MDB Container Managed Transaction with NOT_SUPPORTED transaction Example</h1>
      <br>
      <p>This example shows you how to send a message to an MDB</p>
      <p>
-         The example will send deploy a simple MDB and demonstrate sending a message and the MDB consuming it but with a transaction as this MDB does not suuport one.
+         The example will send deploy a simple MDB and demonstrate sending a message and the MDB consuming it but with a transaction as this MDB does not support one.
      </p>
      
      <h2>JBoss AS configuration</h2>

Deleted: trunk/examples/javaee/mdb-cmt-tx-not-supported/src/org/jboss/javaee/example/MDB_CMP_TxNotSupportedClientExample.java
===================================================================
--- trunk/examples/javaee/mdb-cmp-tx-not-supported/src/org/jboss/javaee/example/MDB_CMP_TxNotSupportedClientExample.java	2009-07-27 13:26:00 UTC (rev 7610)
+++ trunk/examples/javaee/mdb-cmt-tx-not-supported/src/org/jboss/javaee/example/MDB_CMP_TxNotSupportedClientExample.java	2009-07-27 14:54:44 UTC (rev 7617)
@@ -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_CMP_TxNotSupportedClientExample
-{
-   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_CMP_TxNotSupported
-      }
-      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-cmt-tx-not-supported/src/org/jboss/javaee/example/MDB_CMT_TxNotSupportedClientExample.java (from rev 7610, trunk/examples/javaee/mdb-cmp-tx-not-supported/src/org/jboss/javaee/example/MDB_CMP_TxNotSupportedClientExample.java)
===================================================================
--- trunk/examples/javaee/mdb-cmt-tx-not-supported/src/org/jboss/javaee/example/MDB_CMT_TxNotSupportedClientExample.java	                        (rev 0)
+++ trunk/examples/javaee/mdb-cmt-tx-not-supported/src/org/jboss/javaee/example/MDB_CMT_TxNotSupportedClientExample.java	2009-07-27 14:54:44 UTC (rev 7617)
@@ -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_CMT_TxNotSupportedClientExample
+{
+   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_CMP_TxNotSupported
+      }
+      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-cmt-tx-not-supported/src/org/jboss/javaee/example/server/MDB_CMP_TxNotSupported.java
===================================================================
--- trunk/examples/javaee/mdb-cmp-tx-not-supported/src/org/jboss/javaee/example/server/MDB_CMP_TxNotSupported.java	2009-07-27 13:26:00 UTC (rev 7610)
+++ trunk/examples/javaee/mdb-cmt-tx-not-supported/src/org/jboss/javaee/example/server/MDB_CMP_TxNotSupported.java	2009-07-27 14:54:44 UTC (rev 7617)
@@ -1,83 +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.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
-import javax.ejb.TransactionManagement;
-import javax.ejb.TransactionManagementType;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.TextMessage;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-
-/**
- * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
- */
- at MessageDriven(name = "MDB_CMP_TxNotSupported",
-               activationConfig =
-                     {
-                        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
-                        @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/testQueue"),
-                        @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge")
-                     })
- at TransactionManagement(value= TransactionManagementType.CONTAINER)
- at TransactionAttribute(value= TransactionAttributeType.NOT_SUPPORTED)
-public class MDB_CMP_TxNotSupported implements MessageListener
-{
-   @Resource(mappedName = "java:/TransactionManager")
-   private TransactionManager tm;
-
-   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 transaction to make sure there isn't one.
-         Transaction tx = tm.getTransaction();
-
-         if(tx == null)
-         {
-            System.out.println("tx is null, just as expected");
-         }
-         else
-         {
-            System.out.println("something is wrong, I wasn't expecting a transaction");
-         }
-      }
-      catch (Exception e)
-      {
-         e.printStackTrace();
-      }
-   }
-}
\ No newline at end of file

Copied: trunk/examples/javaee/mdb-cmt-tx-not-supported/src/org/jboss/javaee/example/server/MDB_CMT_TxNotSupported.java (from rev 7610, trunk/examples/javaee/mdb-cmp-tx-not-supported/src/org/jboss/javaee/example/server/MDB_CMP_TxNotSupported.java)
===================================================================
--- trunk/examples/javaee/mdb-cmt-tx-not-supported/src/org/jboss/javaee/example/server/MDB_CMT_TxNotSupported.java	                        (rev 0)
+++ trunk/examples/javaee/mdb-cmt-tx-not-supported/src/org/jboss/javaee/example/server/MDB_CMT_TxNotSupported.java	2009-07-27 14:54:44 UTC (rev 7617)
@@ -0,0 +1,83 @@
+/*
+ * 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.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.ejb.TransactionManagement;
+import javax.ejb.TransactionManagementType;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.TextMessage;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+
+/**
+ * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
+ */
+ at MessageDriven(name = "MDB_CMT_TxNotSupported",
+               activationConfig =
+                     {
+                        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
+                        @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/testQueue"),
+                        @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge")
+                     })
+ at TransactionManagement(value= TransactionManagementType.CONTAINER)
+ at TransactionAttribute(value= TransactionAttributeType.NOT_SUPPORTED)
+public class MDB_CMT_TxNotSupported implements MessageListener
+{
+   @Resource(mappedName = "java:/TransactionManager")
+   private TransactionManager tm;
+
+   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 transaction to make sure there isn't one.
+         Transaction tx = tm.getTransaction();
+
+         if(tx == null)
+         {
+            System.out.println("tx is null, just as expected");
+         }
+         else
+         {
+            System.out.println("something is wrong, I wasn't 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:52:26 UTC (rev 7616)
+++ trunk/examples/javaee/messaging-javaee-examples.iml	2009-07-27 14:54:44 UTC (rev 7617)
@@ -58,8 +58,8 @@
       <sourceFolder url="file://$MODULE_DIR$/jms-bridge/src" isTestSource="false" />
       <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-cmt-tx-local/src" isTestSource="true" />
+      <sourceFolder url="file://$MODULE_DIR$/mdb-cmt-tx-not-supported/src" isTestSource="true" />
       <sourceFolder url="file://$MODULE_DIR$/mdb-cmp-tx-required/src" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/mdb-message-selector/src" isTestSource="true" />
       <sourceFolder url="file://$MODULE_DIR$/mdb-tx-send/src" isTestSource="true" />




More information about the jboss-cvs-commits mailing list