/// <summary> /// Creates the to component. /// </summary> /// <param name="to">Valid component name.</param> /// <param name="headers">Dictionary of headers</param> /// <param name="serviceProvider">DI Service provider.</param> /// <returns>Returns an instance of the <see cref="IToComponent"/> interface.</returns> protected IToComponent CreateTo(string to, Dictionary <string, string> headers, IServiceProvider serviceProvider) { IToComponent response = null; try { response = this.GetOasis(to).CreateToComponent(headers, serviceProvider); } catch (Exception ex) { throw new Exceptions.ActivationException(Resources.ERROR_ACTIVATION_TO, ex, "To"); } return(response); }
/// <summary> /// Initializes a new instance of the <see cref="To"/> class. /// </summary> /// <param name="logger">Logger class.</param> /// <param name="toComponent">To component.</param> /// <param name="identity">Identity of route.</param> public To(ILogger logger, IToComponent toComponent, string identity) : base(logger, identity) { this.toComponent = toComponent; this.toComponent.OnLog += this.OnLog; }