code: @Override
     public int getChildNodesCount(final NodeData parent) throws RepositoryException
     {
  
        if (cache.isEnabled())
        {
           int childCount = cache.getChildNodesCount(parent);
           if (childCount >= 0)
           {
              return childCount;
           }
        }
        final DataRequest request = new DataRequest(parent.getIdentifier(), DataRequest.GET_NODES);
  
        try
        {
           request.start();
           if (cache.isEnabled())
           {
              // Try first to get the value from the cache since a
              // request could have been launched just before
              int childCount = cache.getChildNodesCount(parent);
              if (childCount >= 0)
              {
                 return childCount;
              }
           }
  
           return executeAction(new PrivilegedExceptionAction<Integer>()
           {
              public Integer run() throws RepositoryException
              {
                 int childCount = CacheableWorkspaceDataManager.super.getChildNodesCount(parent);
                 if (cache.isEnabled())
                 {
                    cache.addChildNodesCount(parent, childCount);
                 }
                 return childCount;
              }
           });
        }
        finally
        {
           request.done();
        }
     }
docs: {@inheritDoc}