コード例 #1
0
ファイル: QuorumManager.java プロジェクト: dcaillia/hornetq
    @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
ファイル: UnitTestCase.java プロジェクト: igorhvr/hornetq
  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();
  }