Package org.jboss.jms.server

Examples of org.jboss.jms.server.ConnectionManager


            // I need to do my own cleanup at ConnectionManager level.

            log.debug(this + " failed to handle callback", e);

            ServerConnectionEndpoint sce = sessionEndpoint.getConnectionEndpoint();
            ConnectionManager cm = sce.getServerPeer().getConnectionManager();

            cm.handleClientFailure(sce.getRemotingClientSessionID(), false);

            // we're practically cut, from connection down

            return null;
         }
View Full Code Here


     
      CreateClientOnServerCommand command = new CreateClientOnServerCommand(cf, queue, true);
     
      String remotingSessionId = (String)remoteServer.executeCommand(command);
     
      ConnectionManager cm = localServer.getServerPeer().getConnectionManager();
           
      assertTrue(cm.containsRemotingSession(remotingSessionId));
     
      // Now we should have a client connection from the remote server to the local server
     
      remoteServer.kill();
      log.trace("killed remote server");
       
      // Wait for connection resources to be cleared up
      Thread.sleep(15000);
          
      // See if we still have a connection with this id
      assertTrue(cm.containsRemotingSession(remotingSessionId));
   }
View Full Code Here

     
      CreateClientOnServerCommand command = new CreateClientOnServerCommand(cf, queue, true);
     
      String remotingSessionId = (String)remoteServer.executeCommand(command);
     
      ConnectionManager cm = localServer.getServerPeer().getConnectionManager();
           
      assertTrue(cm.containsRemotingSession(remotingSessionId));
     
      // Now we should have a client connection from the remote server to the local server
     
      remoteServer.kill();
      log.trace("killed remote server");
       
      // Wait for connection resources to be cleared up
      Thread.sleep(15000);
          
      // See if we still have a connection with this id
      assertFalse(cm.containsRemotingSession(remotingSessionId));
   }
View Full Code Here

     
      CreateClientOnServerCommand command = new CreateClientOnServerCommand(cf, queue, true);
     
      String remotingSessionId = (String)remoteServer.executeCommand(command);
     
      ConnectionManager cm = localServer.getServerPeer().getConnectionManager();
           
      assertTrue(cm.containsRemotingSession(remotingSessionId));
     
      // Now we should have a client connection from the remote server to the local server
     
      remoteServer.kill();
      log.trace("killed remote server");
       
      // Wait for connection resources to be cleared up
      Thread.sleep(15000);
          
      // See if we still have a connection with this id
     
      //Connection state shouldn't have been cleared up by now
      assertTrue(cm.containsRemotingSession(remotingSessionId));
   }
View Full Code Here

     
      CreateTwoClientOnServerCommand command = new CreateTwoClientOnServerCommand(cf, topic, true);
     
      String remotingSessionId[] = (String[])remoteServer.executeCommand(command);
     
      ConnectionManager cm = localServer.getServerPeer().getConnectionManager();
           
      log.info("server(0) = " + remotingSessionId[0]);
      log.info("server(1) = " + remotingSessionId[1]);
      log.info("we have = " + ((SimpleConnectionManager)cm).getClients().size() + " clients registered on SimpleconnectionManager");
     
      assertFalse(cm.containsRemotingSession(remotingSessionId[0]));
      assertTrue(cm.containsRemotingSession(remotingSessionId[1]));
     
      // Now we should have a client connection from the remote server to the local server
      remoteServer.kill();
      log.info("killed remote server");
       
      // Wait for connection resources to be cleared up
      Thread.sleep(25000);
          
      // See if we still have a connection with this id
     
      //Connection state should have been cleared up by now
      assertFalse(cm.containsRemotingSession(remotingSessionId[0]));
      assertFalse(cm.containsRemotingSession(remotingSessionId[1]));
     
      log.info("Servers = " + ((SimpleConnectionManager)cm).getClients().size());
     
      assertEquals(0,((SimpleConnectionManager)cm).getClients().size());
   }
View Full Code Here

     
      CreateClientOnServerCommand command = new CreateClientOnServerCommand(cf, queue, true);
     
      String remotingSessionId = (String)remoteServer.executeCommand(command);
     
      ConnectionManager cm = localServer.getServerPeer().getConnectionManager();
           
      assertTrue(cm.containsRemotingSession(remotingSessionId));
     
      // Now we should have a client connection from the remote server to the local server
     
      remoteServer.kill();
      log.trace("killed remote server");
       
      // Wait for connection resources to be cleared up
      Thread.sleep(15000);
          
      // See if we still have a connection with this id
      assertTrue(cm.containsRemotingSession(remotingSessionId));
   }
View Full Code Here

      // we need to disable exception listener otherwise it will clear up the connection itself
     
      ObjectName remoteConnectorName = ServiceContainer.REMOTING_OBJECT_NAME;
     
      ConnectionManager cm = localServer.getServerPeer().getConnectionManager();
     
      localServer.getServerPeer().getServer().
         invoke(remoteConnectorName,
                "removeConnectionListener",
                new Object[] {cm},
                new String[] {"org.jboss.remoting.ConnectionListener"});
      
      InitialContext ic = new InitialContext(InVMInitialContextFactory.getJNDIEnvironment());
     
      ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
     
      Queue queue = (Queue)ic.lookup("/queue/Queue");
     
      CreateHangingConsumerCommand command = new CreateHangingConsumerCommand(cf, queue);
     
      String remotingSessionId = (String)remoteServer.executeCommand(command);
     
      remoteServer.kill();
       
      // we have removed the exception listener so the server side resouces shouldn't be cleared up

      log.info("sleeping for 1 min ...");
      Thread.sleep(60000);
                
      assertTrue(cm.containsRemotingSession(remotingSessionId));
     
      // Now we send a message which should prompt delivery to the dead consumer causing
      // an exception which should cause connection cleanup
                 
      Connection conn = cf.createConnection();
     
      Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
       
      MessageProducer prod = sess.createProducer(queue);

      // sending just one message should be enough to trigger the failure and client smacking
      prod.send(sess.createMessage());

      log.info("sleeping for 45 secs ...");
      Thread.sleep(45000);
     
      assertFalse(cm.containsRemotingSession(remotingSessionId));

      // make sure the message is still in queue

      conn = cf.createConnection();
      conn.start();
View Full Code Here

     
      CreateClientOnServerCommand command = new CreateClientOnServerCommand(cf, queue, true);
     
      String remotingSessionId = (String)remoteServer.executeCommand(command);
     
      ConnectionManager cm = localServer.getServerPeer().getConnectionManager();
           
      assertTrue(cm.containsRemotingSession(remotingSessionId));
     
      // Now we should have a client connection from the remote server to the local server
     
      ServerManagement.kill(0);

      log.trace("killed remote server");
     
      //Wait for connection resources to be cleared up
      Thread.sleep(wait);
          
      // See if we still have a connection with this id
      assertEquals(contains, cm.containsRemotingSession(remotingSessionId));
   }
View Full Code Here

     
      CreateTwoClientOnServerCommand command = new CreateTwoClientOnServerCommand(cf, topic, true);
     
      String remotingSessionId[] = (String[])remoteServer.executeCommand(command);
     
      ConnectionManager cm = localServer.getServerPeer().getConnectionManager();
           
      log.info("server(0) = " + remotingSessionId[0]);
      log.info("server(1) = " + remotingSessionId[1]);
      log.info("we have = " + ((SimpleConnectionManager)cm).getClients().size() + " clients registered on SimpleconnectionManager");
     
      assertFalse(cm.containsRemotingSession(remotingSessionId[0]));
      assertTrue(cm.containsRemotingSession(remotingSessionId[1]));
     
      ServerManagement.kill(0);
     
      // Now we should have a client connection from the remote server to the local server
     
      log.info("killed remote server");
       
      // Wait for connection resources to be cleared up
      Thread.sleep(8000);
          
      // See if we still have a connection with this id
     
      //Connection state should have been cleared up by now
      assertFalse(cm.containsRemotingSession(remotingSessionId[0]));
      assertFalse(cm.containsRemotingSession(remotingSessionId[1]));
     
      log.info("Servers = " + ((SimpleConnectionManager)cm).getClients().size());
     
      assertEquals(0,((SimpleConnectionManager)cm).getClients().size());
   }
View Full Code Here

TOP

Related Classes of org.jboss.jms.server.ConnectionManager

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.