Package org.hornetq.spi.core.protocol

Examples of org.hornetq.spi.core.protocol.RemotingConnection.fail()


         // Now fail the underlying connection

         RemotingConnection connection = ((ClientSessionInternal)((HornetQSession)session).getCoreSession()).getConnection();

         connection.fail(new HornetQException(HornetQException.NOT_CONNECTED));

         // Now try and use the producer

         try
         {
View Full Code Here


            MyListener listener = this.listener;

            // Simulate failure on connection
            synchronized (lockFail)
            {
               conn.fail(new HornetQException(HornetQException.NOT_CONNECTED));
            }

            if (listener != null)
            {
               boolean ok = listener.latch.await(10000, TimeUnit.MILLISECONDS);
View Full Code Here

      session.addFailureListener(new MyListener());

      RemotingConnection conn = ((ClientSessionInternal)session).getConnection();

      // Simulate failure on connection
      conn.fail(new HornetQException(HornetQException.NOT_CONNECTED));

      // Wait to be informed of failure

      boolean ok = latch.await(1000, TimeUnit.MILLISECONDS);
View Full Code Here

         final Connection conn1 = cf1.createConnection();

         Session sess1 = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE);
         RemotingConnection rc1 = ((ClientSessionInternal)((HornetQSession)sess1).getCoreSession()).getConnection();

         rc1.fail(new HornetQException(HornetQException.NOT_CONNECTED, "blah"));

         Session sess2 = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE);

         conn1.close();
      }
View Full Code Here

      Thread.sleep(2000);

      HornetQException me = new HornetQException(HornetQException.NOT_CONNECTED);

      coreConn.fail(me);
     
      //It should reconnect to the same node

      for (int i = 0; i < numMessages; i++)
      {
View Full Code Here

      Thread.sleep(2000);

      HornetQException me = new HornetQException(HornetQException.NOT_CONNECTED);

      coreConn.fail(me);

      for (int i = 0; i < numMessages; i++)
      {
         JMSFailoverTest.log.info("got message " + i);
View Full Code Here

      // Note we block on P send to make sure all messages get to server before failover

      HornetQException me = new HornetQException(HornetQException.NOT_CONNECTED);

      coreConnLive.fail(me);

      Assert.assertNotNull(listener.e);

      JMSException je = listener.e;
View Full Code Here

   {

      RemotingConnection conn = ((ClientSessionInternal)session).getConnection();

      // Simulate failure on connection
      conn.fail(new HornetQException(HornetQException.NOT_CONNECTED));

      // Wait to be informed of failure

      boolean ok = latch.await(1000, TimeUnit.MILLISECONDS);
View Full Code Here

      session2.end(xid, XAResource.TMSUCCESS);

      RemotingConnection conn = ((ClientSessionInternal)session2).getConnection();

      // Simulate failure on connection
      conn.fail(new HornetQException(HornetQException.NOT_CONNECTED));

      // Wait to be informed of failure

      boolean ok = latch.await(1000, TimeUnit.MILLISECONDS);
View Full Code Here

      RemotingConnection conn = ((ClientSessionInternal)session).getConnection();

      conn.addFailureListener(new MyListener());

      // Simulate failure on connection
      conn.fail(new HornetQException(HornetQException.NOT_CONNECTED));

      // Wait to be informed of failure

      boolean ok = latch.await(1000, TimeUnit.MILLISECONDS);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.