code: public NodeTypeIterator registerNodeTypes( Iterable<NodeTypeDefinition> nodeTypes )
          throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, AccessDeniedException, RepositoryException {
  
          try {
              session.checkWorkspacePermission(session.workspaceName(), ModeShapePermissions.REGISTER_TYPE);
          } catch (AccessControlException ace) {
              throw new AccessDeniedException(ace);
          }
  
          List<JcrNodeType> jcrNodeTypes = this.repositoryTypeManager.registerNodeTypes(nodeTypes);
          this.schemata = null; //clear the cached schemata to make sure it is reloaded
          return new JcrNodeTypeIterator(jcrNodeTypes);
      }
docs: Registers the node types from the given {@code JcrNodeTypeSource}. This method is used to register or update a set of node
  types with mutual dependencies. Returns an iterator over the resulting {@code NodeType} objects.
  <p>
  The effect of the method is "all or nothing"; if an error occurs, no node types are registered or updated.
  </p>
  
  @param nodeTypes the iterable object containing the new node types to register
  @return the {@code newly created node types}
  @throws InvalidNodeTypeDefinitionException if a {@code NodeTypeDefinition} within the collection is invalid
  @throws NodeTypeExistsException if {@code allowUpdate} is false and a {@code NodeTypeDefinition} within the collection
  specifies a node type name that already exists
  @throws AccessDeniedException if the current session does not have the {@link ModeShapePermissions#REGISTER_TYPE register
  type permission}.
  @throws RepositoryException if another error occurs