Package org.hornetq.spi.core.protocol

Examples of org.hornetq.spi.core.protocol.RemotingConnection


      // Now we ensure that no connections will process any more packets after this method is
      // complete then send a disconnect packet
      for (Entry<Object, ConnectionEntry> entry : connectionEntries.entrySet())
      {
         RemotingConnection conn = entry.getValue().connection;

         if (conn.equals(connectionToKeepOpen))
            continue;

         if (HornetQServerLogger.LOGGER.isTraceEnabled())
         {
            HornetQServerLogger.LOGGER.trace("Sending connection.disconnection packet to " + conn);
         }

         if (!conn.isClient())
         {
            conn.disconnect(false);
            connections.remove(entry.getKey());
         }
      }

   }
View Full Code Here


      // Now we ensure that no connections will process any more packets after this method is complete
      // then send a disconnect packet
      for (ConnectionEntry entry : connectionEntries)
      {
         RemotingConnection conn = entry.connection;

         if (HornetQServerLogger.LOGGER.isTraceEnabled())
         {
            HornetQServerLogger.LOGGER.trace("Sending connection.disconnection packet to " + conn);
         }

         conn.disconnect(criticalError);
      }

      for (Acceptor acceptor : acceptors.values())
      {
         acceptor.stop();
View Full Code Here

               Set<Object> idsToRemove = new HashSet<Object>();

               for (ConnectionEntry entry : connections.values())
               {
                  RemotingConnection conn = entry.connection;

                  boolean flush = true;

                  if (entry.ttl != -1)
                  {
                     if (!conn.checkDataReceived())
                     {
                        if (now >= entry.lastCheck + entry.ttl)
                        {
                           idsToRemove.add(conn.getID());

                           flush = false;
                        }
                     }
                     else
                     {
                        entry.lastCheck = now;
                     }
                  }

                  if (flush)
                  {
                     conn.flush();
                  }
               }

               for (Object id : idsToRemove)
               {
                  RemotingConnection conn = removeConnection(id);
                  if (conn != null)
                  {
                     conn.fail(HornetQMessageBundle.BUNDLE.clientExited(conn.getRemoteAddress()));
                  }
               }

               if (latch.await(pauseInterval, TimeUnit.MILLISECONDS))
                  return;
View Full Code Here

      synchronized (recordsGuard)
      {
         Map<String, String> nodes = new HashMap<String, String>();
         for (Entry<String, MessageFlowRecord> entry : records.entrySet())
         {
            RemotingConnection fwdConnection = entry.getValue().getBridge().getForwardingConnection();
            if (fwdConnection != null)
            {
               nodes.put(entry.getKey(), fwdConnection.getRemoteAddress());
            }
         }
         return nodes;
      }
   }
View Full Code Here

      // ClusterListener

      public void nodeUP(TopologyMember member, boolean last)
      {
         ClientSessionInternal sessionToUse = session;
         RemotingConnection connectionToUse = sessionToUse != null? sessionToUse.getConnection(): null;

         if (member != null && BridgeImpl.this.targetNodeID != null && BridgeImpl.this.targetNodeID.equals(member.getNodeId()))
         {
            // this could be an update of the topology say after a backup started
            BridgeImpl.this.targetNode = member;
View Full Code Here

            ClientSession createSession = sf.createSession(true, true);

            createSession.createQueue(FailoverTestBase.ADDRESS, FailoverTestBase.ADDRESS, null, true);

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

            Thread t = new Thread(runnable);

            t.setName("MainTEST");
View Full Code Here

      // Now fail the underlying connection

      ClientSessionInternal sessi = (ClientSessionInternal)((HornetQSession)session1).getCoreSession();

      RemotingConnection rc = sessi.getConnection();

      rc.fail(new HornetQException(HornetQException.INTERNAL_ERROR));

      // Now close the connection

      conn.close();
View Full Code Here

         ClientProducer producer = clientSession.createProducer();
         ClientConsumer consumer = clientSession.createConsumer(queueName);

         Assert.assertEquals(1, server.getRemotingService().getConnections().size());

         RemotingConnection rc = clientSession.getConnection();

         rc.fail(new HornetQException(HornetQException.INTERNAL_ERROR));

         clientSession.close();

         long start = System.currentTimeMillis();
View Full Code Here

            producer.send(message);
         }

         ClientConsumer consumer = session.createConsumer(ReattachTest.ADDRESS);

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

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

         session.start();

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

      ClientConsumer consumer = session.createConsumer(ReattachTest.ADDRESS);

      InVMConnector.failOnCreateConnection = true;

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

      Thread t = new Thread()
      {
         @Override
         public void run()
         {
            try
            {
               Thread.sleep(retryInterval * 3);
            }
            catch (InterruptedException ignore)
            {
            }

            InVMConnector.failOnCreateConnection = false;
         }
      };

      t.start();

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

      session.start();

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

TOP

Related Classes of org.hornetq.spi.core.protocol.RemotingConnection

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.