code: public int getTemplatesSize() {
          int length = 0;
          if (!this.disableTemplatesSupport) {
              try {
                  rwLock.readLock().lock();
                  length = template_cache.size();
              } finally {
                  rwLock.readLock().unlock();
              }
              if (length < 0) {
                  length = 0;
              }
          }
          return length;
      }
docs: ***********************************************************************
  getTemplatesSize()
  This method is used by CacheMonitor to get the number of templates from the disk.
  ***********************************************************************