Examples of ClientSessionInternal


Examples of org.hornetq.core.client.impl.ClientSessionInternal

      // 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

Examples of org.hornetq.core.client.impl.ClientSessionInternal

      // 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

Examples of org.hornetq.core.client.impl.ClientSessionInternal

      // 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

Examples of org.hornetq.core.client.impl.ClientSessionInternal

      // 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

Examples of org.hornetq.core.client.impl.ClientSessionInternal

   protected void crash(final ClientSession... sessions) throws Exception
   {
      for (ClientSession session : sessions)
      {
         ClientSessionInternal internalSession = (ClientSessionInternal) session;
         internalSession.getConnection().fail(new HornetQException(HornetQException.NOT_CONNECTED, "oops"));
      }
   }
View Full Code Here

Examples of org.hornetq.core.client.impl.ClientSessionInternal

      QueueBrowser browser = session1.createBrowser(queue);

      // 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
View Full Code Here

Examples of org.hornetq.core.client.impl.ClientSessionInternal

      QueueBrowser browser = sess.createBrowser(queue);

      // Now fail the underlying connection

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

      RemotingConnection rc = sessi.getConnection();

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

      // Now close the connection
View Full Code Here

Examples of org.hornetq.core.client.impl.ClientSessionInternal

         // Make sure we have a short connection TTL so sessions will be quickly closed on the server
         long ttl = 500;
         server.getConfiguration().setConnectionTTLOverride(ttl);
         server.start();
         ClientSessionFactory cf = createInVMFactory();
         ClientSessionInternal clientSession = (ClientSessionInternal)cf.createSession(false, true, true);
         clientSession.createQueue(queueName, queueName, false);
         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();

         while (true)
         {
View Full Code Here

Examples of org.hornetq.core.client.impl.ClientSessionInternal

      CountDownLatch latch = new CountDownLatch(1);
      MyExceptionListener listener = new MyExceptionListener(latch);

      conn.setExceptionListener(listener);

      ClientSessionInternal coreSession = (ClientSessionInternal)((HornetQConnection)conn).getInitialSession();

      coreSession.getConnection().fail(new HornetQException(HornetQException.INTERNAL_ERROR, "blah"));

      latch.await(5, TimeUnit.SECONDS);

      Assert.assertEquals(1, listener.numCalls);
View Full Code Here

Examples of org.hornetq.core.client.impl.ClientSessionInternal

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

      Session sess3 = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);

      ClientSessionInternal coreSession0 = (ClientSessionInternal)((HornetQConnection)conn).getInitialSession();

      ClientSessionInternal coreSession1 = (ClientSessionInternal)((HornetQSession)sess1).getCoreSession();

      ClientSessionInternal coreSession2 = (ClientSessionInternal)((HornetQSession)sess2).getCoreSession();

      ClientSessionInternal coreSession3 = (ClientSessionInternal)((HornetQSession)sess3).getCoreSession();

      coreSession0.getConnection().fail(new HornetQException(HornetQException.INTERNAL_ERROR, "blah"));

      coreSession1.getConnection().fail(new HornetQException(HornetQException.INTERNAL_ERROR, "blah"));

      coreSession2.getConnection().fail(new HornetQException(HornetQException.INTERNAL_ERROR, "blah"));

      coreSession3.getConnection().fail(new HornetQException(HornetQException.INTERNAL_ERROR, "blah"));

      latch.await(5, TimeUnit.SECONDS);
      // Listener should only be called once even if all sessions connections die
      Assert.assertEquals(1, listener.numCalls);
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.