/// <summary> /// Manually remove a plug endpoint from the handler pool. /// </summary> /// <param name="endpoint">Factory instance to remove.</param> public static void RemoveEndpoint(IPlugEndpoint endpoint) { lock(_endpoints) { _endpoints.Remove(endpoint); } }
private static int FindPlugEndpoint(XUri uri, out IPlugEndpoint match, out XUri normalizedUri) { match = null; normalizedUri = null; // determine which plug factory has the best match int maxScore = 0; lock(_endpoints) { // loop over all plug factories to determine best transport mechanism foreach(IPlugEndpoint factory in _endpoints) { XUri newNormalizedUri; int score = factory.GetScoreWithNormalizedUri(uri, out newNormalizedUri); if(score > maxScore) { maxScore = score; normalizedUri = newNormalizedUri; match = factory; } } } return maxScore; }
/// <summary> /// Manually add a plug endpoint for handling invocations. /// </summary> /// <param name="endpoint">Factory instance to add.</param> public static void AddEndpoint(IPlugEndpoint endpoint) { lock(_endpoints) { _endpoints.Add(endpoint); } }