[jboss-cvs] JBoss Messaging SVN: r6882 - in trunk/examples/core/embedded/src/org/jboss: core and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue May 19 09:36:08 EDT 2009


Author: timfox
Date: 2009-05-19 09:36:07 -0400 (Tue, 19 May 2009)
New Revision: 6882

Added:
   trunk/examples/core/embedded/src/org/jboss/core/
   trunk/examples/core/embedded/src/org/jboss/core/example/
   trunk/examples/core/embedded/src/org/jboss/core/example/EmbeddedExample.java
Removed:
   trunk/examples/core/embedded/src/org/jboss/jms/example/EmbeddedExample.java
Log:
used correct package name for core embedded example

Copied: trunk/examples/core/embedded/src/org/jboss/core/example/EmbeddedExample.java (from rev 6881, trunk/examples/core/embedded/src/org/jboss/jms/example/EmbeddedExample.java)
===================================================================
--- trunk/examples/core/embedded/src/org/jboss/core/example/EmbeddedExample.java	                        (rev 0)
+++ trunk/examples/core/embedded/src/org/jboss/core/example/EmbeddedExample.java	2009-05-19 13:36:07 UTC (rev 6882)
@@ -0,0 +1,127 @@
+/*
+   * 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.core.example;
+
+import java.util.Date;
+
+import javax.jms.TextMessage;
+
+import org.jboss.messaging.core.client.ClientConsumer;
+import org.jboss.messaging.core.client.ClientMessage;
+import org.jboss.messaging.core.client.ClientProducer;
+import org.jboss.messaging.core.client.ClientSession;
+import org.jboss.messaging.core.client.ClientSessionFactory;
+import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
+import org.jboss.messaging.core.config.Configuration;
+import org.jboss.messaging.core.config.TransportConfiguration;
+import org.jboss.messaging.core.config.impl.ConfigurationImpl;
+import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
+import org.jboss.messaging.core.server.Messaging;
+import org.jboss.messaging.core.server.MessagingServer;
+
+/**
+ * 
+ * This exammple shows how to run a JBoss Messaging core client and server embedded in your
+ * own application
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ */
+public class EmbeddedExample
+{
+
+   public static void main(String[] args)
+   {
+      try
+      {
+         
+         // Step 1. Create the Configuration, and set the properties accordingly
+         Configuration configuration = new ConfigurationImpl();
+         configuration.setEnablePersistence(false);
+         configuration.setSecurityEnabled(false);
+         
+         // Step 2. Create and start the server
+         MessagingServer server = Messaging.newMessagingServer(configuration);
+         server.start();
+   
+   
+         // Step 3. As we are not using a JNDI environment we instantiate the objects directly         
+         ClientSessionFactory sf = new ClientSessionFactoryImpl (new TransportConfiguration(InVMConnectorFactory.class.getName()));
+         
+         // Step 4. Create a core queue
+         ClientSession coreSession = sf.createSession(false, false, false);
+         
+         final String queueName = "queue.exampleQueue";
+         
+         coreSession.createQueue(queueName, queueName, true);
+         
+         coreSession.close();
+                  
+         ClientSession session = null;
+   
+         try
+         {
+   
+            // Step 5. Create the session, and producer
+            session = sf.createSession();
+                                   
+            ClientProducer producer = session.createProducer(queueName);
+   
+            // Step 6. Create and send a message
+            ClientMessage message = session.createClientMessage(false);
+            
+            final String propName = "myprop";
+            
+            message.putStringProperty(propName, "Hello sent at " + new Date());
+            
+            System.out.println("Sending the message.");
+            
+            producer.send(message);
+
+            // Step 7. Create the message consumer and start the connection
+            ClientConsumer messageConsumer = session.createConsumer(queueName);
+            session.start();
+   
+            // Step 8. Receive the message. 
+            ClientMessage messageReceived = messageConsumer.receive(1000);
+            System.out.println("Received TextMessage:" + messageReceived.getProperty(propName));
+         }
+         finally
+         {
+            // Step 9. Be sure to close our resources!
+            if (session != null)
+            {
+               session.close();
+            }
+            
+            // Step 10. Stop the server
+            server.stop();
+         }
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         System.exit(-1);
+      }
+   }
+
+}

Deleted: trunk/examples/core/embedded/src/org/jboss/jms/example/EmbeddedExample.java
===================================================================
--- trunk/examples/core/embedded/src/org/jboss/jms/example/EmbeddedExample.java	2009-05-19 13:31:34 UTC (rev 6881)
+++ trunk/examples/core/embedded/src/org/jboss/jms/example/EmbeddedExample.java	2009-05-19 13:36:07 UTC (rev 6882)
@@ -1,127 +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.jms.example;
-
-import java.util.Date;
-
-import javax.jms.TextMessage;
-
-import org.jboss.messaging.core.client.ClientConsumer;
-import org.jboss.messaging.core.client.ClientMessage;
-import org.jboss.messaging.core.client.ClientProducer;
-import org.jboss.messaging.core.client.ClientSession;
-import org.jboss.messaging.core.client.ClientSessionFactory;
-import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
-import org.jboss.messaging.core.config.Configuration;
-import org.jboss.messaging.core.config.TransportConfiguration;
-import org.jboss.messaging.core.config.impl.ConfigurationImpl;
-import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
-import org.jboss.messaging.core.server.Messaging;
-import org.jboss.messaging.core.server.MessagingServer;
-
-/**
- * 
- * This exammple shows how to run a JBoss Messaging core client and server embedded in your
- * own application
- *
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- *
- */
-public class EmbeddedExample
-{
-
-   public static void main(String[] args)
-   {
-      try
-      {
-         
-         // Step 1. Create the Configuration, and set the properties accordingly
-         Configuration configuration = new ConfigurationImpl();
-         configuration.setEnablePersistence(false);
-         configuration.setSecurityEnabled(false);
-         
-         // Step 2. Create and start the server
-         MessagingServer server = Messaging.newMessagingServer(configuration);
-         server.start();
-   
-   
-         // Step 3. As we are not using a JNDI environment we instantiate the objects directly         
-         ClientSessionFactory sf = new ClientSessionFactoryImpl (new TransportConfiguration(InVMConnectorFactory.class.getName()));
-         
-         // Step 4. Create a core queue
-         ClientSession coreSession = sf.createSession(false, false, false);
-         
-         final String queueName = "queue.exampleQueue";
-         
-         coreSession.createQueue(queueName, queueName, true);
-         
-         coreSession.close();
-                  
-         ClientSession session = null;
-   
-         try
-         {
-   
-            // Step 5. Create the session, and producer
-            session = sf.createSession();
-                                   
-            ClientProducer producer = session.createProducer(queueName);
-   
-            // Step 6. Create and send a message
-            ClientMessage message = session.createClientMessage(false);
-            
-            final String propName = "myprop";
-            
-            message.putStringProperty(propName, "Hello sent at " + new Date());
-            
-            System.out.println("Sending the message.");
-            
-            producer.send(message);
-
-            // Step 7. Create the message consumer and start the connection
-            ClientConsumer messageConsumer = session.createConsumer(queueName);
-            session.start();
-   
-            // Step 8. Receive the message. 
-            ClientMessage messageReceived = messageConsumer.receive(1000);
-            System.out.println("Received TextMessage:" + messageReceived.getProperty(propName));
-         }
-         finally
-         {
-            // Step 9. Be sure to close our resources!
-            if (session != null)
-            {
-               session.close();
-            }
-            
-            // Step 10. Stop the server
-            server.stop();
-         }
-      }
-      catch (Exception e)
-      {
-         e.printStackTrace();
-         System.exit(-1);
-      }
-   }
-
-}




More information about the jboss-cvs-commits mailing list