code: private void terminate()
      {
          if (this.container != null) {
              final Cache<String, Integer> cache = this.container
                              .<String, Integer>getCache(InfinispanCache.COUNTERCACHE);
              Integer count = cache.get(InfinispanCache.COUNTERCACHE);
              if (count == null || count < 2) {
                  this.container.stop();
              } else {
                  count = count - 1;
                  cache.put(InfinispanCache.COUNTERCACHE, count);
              }
          }
      }
docs: Terminate the manager.