예제 #1
0
    @Override
    public void run() {
      locator.setReconnectAttempts(0);

      final ClientSessionFactory sessionFactory;
      ClientSession session;
      try {
        sessionFactory = locator.createSessionFactory(tc);
        if (sessionFactory != null) {
          session = sessionFactory.createSession();
          if (session != null) {
            if (nodeIsDown(total, count.incrementAndGet())) {
              while (latch.getCount() > 0) latch.countDown();
            }
            session.close();
            sessionFactory.close();
          }
        }
      } catch (Exception e) {
        // no-op
      } finally {
        latch.countDown();
        locator.close();
      }
    }
예제 #2
0
 public ServerLocatorInternal createServerLocator() {
   if (tcConfigs != null && tcConfigs.length > 0) {
     if (HornetQServerLogger.LOGGER.isDebugEnabled()) {
       HornetQServerLogger.LOGGER.debug(
           ClusterConnectionImpl.this
               + "Creating a serverLocator for "
               + Arrays.toString(tcConfigs));
     }
     ServerLocatorImpl locator = new ServerLocatorImpl(topology, true, tcConfigs);
     locator.setClusterConnection(true);
     return locator;
   }
   return null;
 }
예제 #3
0
  protected void cleanupPools() {
    OperationContextImpl.clearContext();

    int invmSize = InVMRegistry.instance.size();
    if (invmSize > 0) {
      InVMRegistry.instance.clear();
      fail("invm registry still had acceptors registered");
    }

    if (AsynchronousFileImpl.getTotalMaxIO() != 0) {
      AsynchronousFileImpl.resetMaxAIO();
      Assert.fail("test did not close all its files " + AsynchronousFileImpl.getTotalMaxIO());
    }

    // We shutdown the global pools to give a better isolation between tests
    ServerLocatorImpl.clearThreadPools();
  }