Package org.hornetq.integration.bootstrap

Examples of org.hornetq.integration.bootstrap.HornetQBootstrapServer


      Assert.assertTrue(DummyBean.started);
   }

   public void testRun() throws Exception
   {
      HornetQBootstrapServer bootstrap = new HornetQBootstrapServer(HornetQBootstrapServerTest.beans1);
      bootstrap.run();
      Assert.assertTrue(DummyBean.started);
      bootstrap.shutDown();
      Assert.assertFalse(DummyBean.started);
   }
View Full Code Here


   public void testRunWithConfig() throws Exception
   {
      Properties properties = new Properties();
      properties.setProperty("test", "foo");
      HornetQBootstrapServer bootstrap = new HornetQBootstrapServer(new PropertyKernelConfig(properties),
                                                                    HornetQBootstrapServerTest.beans1);
      bootstrap.run();
      Assert.assertTrue(DummyBean.started);
      bootstrap.shutDown();
      Assert.assertFalse(DummyBean.started);
   }
View Full Code Here

      Assert.assertFalse(DummyBean.started);
   }

   public void testDeploy() throws Throwable
   {
      HornetQBootstrapServer bootstrap = new HornetQBootstrapServer(new String[] {});
      bootstrap.run();
      Assert.assertFalse(DummyBean.started);
      KernelDeployment kernelDeployment = bootstrap.deploy(HornetQBootstrapServerTest.beans1);
      Assert.assertTrue(DummyBean.started);
      bootstrap.undeploy(kernelDeployment);
      Assert.assertFalse(DummyBean.started);
      bootstrap.shutDown();
   }
View Full Code Here

      bootstrap.shutDown();
   }

   public void testDeployXml() throws Throwable
   {
      HornetQBootstrapServer bootstrap = new HornetQBootstrapServer(new String[] {});
      bootstrap.run();
      Assert.assertFalse(DummyBean.started);
      KernelDeployment kernelDeployment = bootstrap.deploy("test", HornetQBootstrapServerTest.xml);
      Assert.assertTrue(DummyBean.started);
      bootstrap.undeploy(kernelDeployment);
      Assert.assertFalse(DummyBean.started);
      bootstrap.shutDown();
   }
View Full Code Here

{

   public static void main(final String[] args)
   {

      HornetQBootstrapServer hornetQ = null;
      try
      {

         // Step 1. Start the server
         hornetQ = new HornetQBootstrapServer("./server0/hornetq-beans.xml");
         hornetQ.run();

         // Step 2. As we are not using a JNDI environment we instantiate the objects directly
         ServerLocator serverLocator = HornetQClient.createServerLocatorWithoutHA(new TransportConfiguration(NettyConnectorFactory.class.getName()));
         ClientSessionFactory sf = serverLocator.createSessionFactory();

         // Step 3. 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 4. Create the session, and producer
            session = sf.createSession();

            ClientProducer producer = session.createProducer(queueName);

            // Step 5. Create and send a message
            ClientMessage message = session.createMessage(false);

            final String propName = "myprop";

            message.putStringProperty(propName, "Hello sent at " + new Date());

            System.out.println("Sending the message.");

            producer.send(message);

            // Step 6. Create the message consumer and start the connection
            ClientConsumer messageConsumer = session.createConsumer(queueName);
            session.start();

            // Step 7. Receive the message.
            ClientMessage messageReceived = messageConsumer.receive(1000);

            System.out.println("Received TextMessage:" + messageReceived.getStringProperty(propName));
         }
         finally
         {
            // Step 8. Be sure to close our resources!
            if (sf != null)
            {
               sf.close();
            }

            // Step 9. Shutdown the container
            if (hornetQ != null)
            {
               hornetQ.shutDown();
            }
         }
      }
      catch (Exception e)
      {
View Full Code Here

         LocalTestServer.log.info("Deleted dir: " + dir.getAbsolutePath() + " deleted: " + deleted);
      }

      PropertyKernelConfig propertyKernelConfig = new PropertyKernelConfig(System.getProperties());
      bootstrap = new HornetQBootstrapServer(propertyKernelConfig, containerConfig);
      System.setProperty(Constants.SERVER_INDEX_PROPERTY_NAME, "" + getServerID());
      bootstrap.run();
      started = true;

   }
View Full Code Here

   }
  */

   public void testRun() throws Exception
   {
      HornetQBootstrapServer bootstrap = new HornetQBootstrapServer(HornetQBootstrapServerTest.beans1);
      bootstrap.run();
      Assert.assertTrue(DummyBean.started);
      bootstrap.shutDown();
      Assert.assertFalse(DummyBean.started);
   }
View Full Code Here

   public void testRunWithConfig() throws Exception
   {
      Properties properties = new Properties();
      properties.setProperty("test", "foo");
      HornetQBootstrapServer bootstrap = new HornetQBootstrapServer(new PropertyKernelConfig(properties),
                                                                    HornetQBootstrapServerTest.beans1);
      bootstrap.run();
      Assert.assertTrue(DummyBean.started);
      bootstrap.shutDown();
      Assert.assertFalse(DummyBean.started);
   }
View Full Code Here

      Assert.assertFalse(DummyBean.started);
   }

   public void testDeploy() throws Throwable
   {
      HornetQBootstrapServer bootstrap = new HornetQBootstrapServer(new String[] {});
      bootstrap.run();
      Assert.assertFalse(DummyBean.started);
      KernelDeployment kernelDeployment = bootstrap.deploy(HornetQBootstrapServerTest.beans1);
      Assert.assertTrue(DummyBean.started);
      bootstrap.undeploy(kernelDeployment);
      Assert.assertFalse(DummyBean.started);
      bootstrap.shutDown();
   }
View Full Code Here

      bootstrap.shutDown();
   }

   public void testDeployXml() throws Throwable
   {
      HornetQBootstrapServer bootstrap = new HornetQBootstrapServer(new String[] {});
      bootstrap.run();
      Assert.assertFalse(DummyBean.started);
      KernelDeployment kernelDeployment = bootstrap.deploy("test", HornetQBootstrapServerTest.xml);
      Assert.assertTrue(DummyBean.started);
      bootstrap.undeploy(kernelDeployment);
      Assert.assertFalse(DummyBean.started);
      bootstrap.shutDown();
   }
View Full Code Here

TOP

Related Classes of org.hornetq.integration.bootstrap.HornetQBootstrapServer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.