public EhCachePerfTest(final Configuration configuration) {
    SpringFactory.getApplicationContext(configuration);
    ehcacheBean = SpringFactory.getControllerBean(configuration, TcEhCacheManagerFactoryBean.class);
    if (ehcacheBean == null) {
      log.warn("Cant find TcEhCacheManagerFactoryBean. Load incoherently WON'T work.");
    }

    this.test = configuration.getTestCase().getTest();
    if (test == null) throw new RuntimeException("Test case is null.");
    log.info("XXXXX running test: " + this.test.getClass().getSimpleName());
    test.setDriver(this);
    this.configuration = configuration;
    if (configuration.isStandalone()) {
      ClusteringToolkit toolkit =
          new TerracottaClient(configuration.getExpressTerracottaUrl()).getToolkit();
      this.barrier = toolkit.getBarrier(BARRIER_ROOT, configuration.getNodesNum());
      clusterTestCount = toolkit.getAtomicLong("ehcacheperf-clusterTestCount");
      clusterLatency = toolkit.getAtomicLong("ehcacheperf-clusterLatency");
      clusterWarmup = toolkit.getAtomicLong("ehcacheperf-warmup");
      clusterReads = toolkit.getAtomicLong("ehcacheperf-clusterReads");
      clusterWrites = toolkit.getAtomicLong("ehcacheperf-clusterWrites");
      clusterCacheWarmup = toolkit.getAtomicLong("ehcacheperf-clusterCacheWarmup");

      // Counter for increasing keys over time
      ClusteredAtomicLong atomicLong = toolkit.getAtomicLong("ehcacheperf-currKeyCount");
      atomicLong.set(configuration.getElementNum());
      test.setCurrKeyCount(atomicLong);
    } else {
      this.barrier = new DefaultBarrierImpl(configuration.getNodesNum());
      clusterTestCount = new DefaultAtomicLongImpl();
      clusterLatency = new DefaultAtomicLongImpl();
      clusterWarmup = new DefaultAtomicLongImpl();
      clusterReads = new DefaultAtomicLongImpl();
      clusterWrites = new DefaultAtomicLongImpl();
      clusterCacheWarmup = new DefaultAtomicLongImpl();
    }
    this.nodeId = await();
    test.setNodeId(nodeId);
    test.setNumberOfNodes(configuration.getNodesNum());
  }