Package org.hornetq.api.core.client

Examples of org.hornetq.api.core.client.SessionFailureListener


      {
         server.start();
         ClientSessionFactory cf = createInVMFactory();
         ClientSession clientSession = cf.createSession(false, true, true);
         final CountDownLatch latch = new CountDownLatch(1);
         clientSession.addFailureListener(new SessionFailureListener()
         {
            public void connectionFailed(final HornetQException me)
            {
               latch.countDown();
            }
View Full Code Here


         final AtomicInteger count = new AtomicInteger(0);

         final CountDownLatch latch = new CountDownLatch(1);

         session.addFailureListener(new SessionFailureListener()
         {

            public void connectionFailed(final HornetQException me)
            {
               count.incrementAndGet();
View Full Code Here

      ClientSession session = csf.createSession(false, true, true);

      Assert.assertEquals(1, ((ClientSessionFactoryInternal)csf).numConnections());

      final CountDownLatch clientLatch = new CountDownLatch(1);
      SessionFailureListener clientListener = new SessionFailureListener()
      {
         public void connectionFailed(final HornetQException me)
         {
            clientLatch.countDown();
         }
View Full Code Here

         final AtomicInteger count = new AtomicInteger(0);

         final CountDownLatch latch = new CountDownLatch(1);

         session.addFailureListener(new SessionFailureListener()
         {

            public void connectionFailed(final HornetQException me, boolean failedOver)
            {
               count.incrementAndGet();
View Full Code Here

      CreateReplicationSessionMessage replicationStartPackage = new CreateReplicationSessionMessage(channelID);

      mainChannel.sendBlocking(replicationStartPackage);

      failureListener = new SessionFailureListener()
      {
         public void connectionFailed(final HornetQException me, boolean failedOver)
         {
            if (me.getCode() == HornetQException.DISCONNECTED)
            {
View Full Code Here

      MyBootstrapContext ctx = new MyBootstrapContext();
      qResourceAdapter.start(ctx);
      // This is just to register a listener
      final CountDownLatch failedLatch = new CountDownLatch(1);
      ClientSessionFactoryInternal factoryListener = (ClientSessionFactoryInternal)qResourceAdapter.getDefaultHornetQConnectionFactory().getServerLocator().createSessionFactory();
      factoryListener.addFailureListener(new SessionFailureListener()
      {
        
         @Override
         public void connectionFailed(HornetQException exception, boolean failedOver)
         {
View Full Code Here

      CreateReplicationSessionMessage replicationStartPackage = new CreateReplicationSessionMessage(channelID);

      mainChannel.sendBlocking(replicationStartPackage);

      failureListener = new SessionFailureListener()
      {
         public void connectionFailed(final HornetQException me)
         {
            if (me.getCode() == HornetQException.DISCONNECTED)
            {
View Full Code Here

         final AtomicInteger count = new AtomicInteger(0);

         final CountDownLatch latch = new CountDownLatch(1);

         session.addFailureListener(new SessionFailureListener()
         {

            public void connectionFailed(final HornetQException me, boolean failedOver)
            {
               count.incrementAndGet();
View Full Code Here

         // One for beforeReconnecto from the Factory, and one for the commit about to be done
         final CountDownLatch latchCommit = new CountDownLatch(2);

         final ArrayList<Thread> threadToBeInterrupted = new ArrayList<Thread>();
        
         factory.addFailureListener(new SessionFailureListener()
         {
           
            @Override
            public void connectionFailed(HornetQException exception, boolean failedOver)
            {
            }
           
            @Override
            public void beforeReconnect(HornetQException exception)
            {
               latchCommit.countDown();
               threadToBeInterrupted.add(Thread.currentThread());
               System.out.println("Thread " + Thread.currentThread() + " reconnecting now");
            }
         });


         final ClientSessionInternal session = (ClientSessionInternal)factory.createSession();

         final AtomicInteger count = new AtomicInteger(0);

         final CountDownLatch latch = new CountDownLatch(1);

         session.addFailureListener(new SessionFailureListener()
         {

            public void connectionFailed(final HornetQException me, boolean failedOver)
            {
               count.incrementAndGet();
View Full Code Here

      CreateReplicationSessionMessage replicationStartPackage = new CreateReplicationSessionMessage(channelID);

      mainChannel.sendBlocking(replicationStartPackage);

      failureListener = new SessionFailureListener()
      {
         public void connectionFailed(final HornetQException me, boolean failedOver)
         {
            if (me.getCode() == HornetQException.DISCONNECTED)
            {
View Full Code Here

TOP

Related Classes of org.hornetq.api.core.client.SessionFailureListener

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.