Beispiel #1
0
        /// <summary>
        /// Register an instantiated INodeProvider with the node manager. The node manager will query the nodeprovider
        /// for a list of its node descriptions, and add these nodes to a master list of nodes which can be used
        /// by the scheduler. QUESTION: Do we allow duplicate Node Providers?
        /// </summary>
        /// <param name="providerToRegister"></param>
        /// <returns></returns>
        internal bool RegisterNodeProvider(INodeProvider nodeProviderToRegister)
        {
            ErrorUtilities.VerifyThrowArgumentNull(nodeProviderToRegister, "nodeProviderToRegister");

            INodeDescription[] nodeDescriptions = nodeProviderToRegister.QueryNodeDescriptions();

            int[] nodeIds = new int[nodeDescriptions.Length];
            for (int i = 0; i < nodeIds.Length; i++)
            {
                nodeIds[i] = parentEngine.GetNextNodeId();
            }
            nodeProviderToRegister.AssignNodeIdentifiers(nodeIds);

            // Go through all of the nodes as described by nodeDescriptions and add them to out list of nodes
            for (int i = 0; i < nodeDescriptions.Length; i++)
            {
                ProvidersNodeInformation nodeToAddFromProvider =
                    new ProvidersNodeInformation(i, nodeIds[i], nodeDescriptions[i], nodeProviderToRegister);
                nodeList.Add(nodeToAddFromProvider);
            }

            nodeProviders.Add(nodeProviderToRegister);

            return(true);
        }
Beispiel #2
0
        /// <summary>
        /// Register an instantiated INodeProvider with the node manager. The node manager will query the nodeprovider
        /// for a list of its node descriptions, and add these nodes to a master list of nodes which can be used
        /// by the scheduler. QUESTION: Do we allow duplicate Node Providers?
        /// </summary>
        /// <param name="providerToRegister"></param>
        /// <returns></returns>
        internal bool RegisterNodeProvider(INodeProvider nodeProviderToRegister)
        {
            ErrorUtilities.VerifyThrowArgumentNull(nodeProviderToRegister,"nodeProviderToRegister");

            INodeDescription[] nodeDescriptions = nodeProviderToRegister.QueryNodeDescriptions();

            int[] nodeIds = new int[nodeDescriptions.Length];
            for (int i = 0; i < nodeIds.Length; i++)
            {
                nodeIds[i] = parentEngine.GetNextNodeId();
            }
            nodeProviderToRegister.AssignNodeIdentifiers(nodeIds);

            // Go through all of the nodes as described by nodeDescriptions and add them to out list of nodes
            for(int i=0; i < nodeDescriptions.Length;i++)
            {
                ProvidersNodeInformation nodeToAddFromProvider = 
                    new ProvidersNodeInformation(i, nodeIds[i], nodeDescriptions[i], nodeProviderToRegister);
                nodeList.Add(nodeToAddFromProvider);
            }

            nodeProviders.Add(nodeProviderToRegister);

            return true;
        }