code: private CmsUgcSession createSession(CmsObject cms, CmsUgcConfiguration config) throws CmsUgcException {
  
          if (getQueue(config).waitForSlot()) {
              try {
                  return new CmsUgcSession(m_adminCms, cms, config);
              } catch (CmsException e) {
                  LOG.error(e.getLocalizedMessage(), e);
                  throw new CmsUgcException(e);
              }
          } else {
              String message = Messages.get().container(Messages.ERR_WAIT_QUEUE_EXCEEDED_0).key(
                  cms.getRequestContext().getLocale());
              throw new CmsUgcException(CmsUgcConstants.ErrorCode.errMaxQueueLengthExceeded, message);
          }
      }
docs: Creates a new editing session.<p>
  
  @param cms the cms context
  @param config the configuration
  
  @return the form session
  
  @throws CmsUgcException if the session creation fails