/// <summary> /// Route requests using a custom rule. /// </summary> /// <param name="rule">The rule.</param> /// <param name="destination">The destination to invoke if the rule accepts the CQS object.</param> /// <exception cref="System.ArgumentNullException"> /// rule /// or /// destination /// </exception> public void RouteRequests(IRoutingRule rule, IRequestReplyBus destination) { if (rule == null) { throw new ArgumentNullException("rule"); } if (destination == null) { throw new ArgumentNullException("destination"); } _requestRoutes.Add(new RoutedRequestReplyBus(rule, destination)); }
/// <summary> /// Route queries using a custom rule. /// </summary> /// <param name="rule">The rule.</param> /// <param name="destination">The destination to invoke if the rule accepts the CQS object.</param> /// <exception cref="System.ArgumentNullException"> /// rule /// or /// destination /// </exception> public void RouteQueries(IRoutingRule rule, IQueryBus destination) { if (rule == null) { throw new ArgumentNullException("rule"); } if (destination == null) { throw new ArgumentNullException("destination"); } _queryRoutes.Add(new RoutedQueryBus(rule, destination)); }
/// <summary> /// Route events using a custom rule. /// </summary> /// <param name="rule">The rule.</param> /// <param name="destination">The destination to invoke if the rule accepts the CQS object.</param> /// <exception cref="System.ArgumentNullException"> /// rule /// or /// destination /// </exception> public void RouteEvents(IRoutingRule rule, IEventBus destination) { if (rule == null) { throw new ArgumentNullException("rule"); } if (destination == null) { throw new ArgumentNullException("destination"); } _eventRoutes.Add(new RoutedEventBus(rule, destination)); }
/// <summary> /// Route commands using a custom rule. /// </summary> /// <param name="rule">The rule.</param> /// <param name="destination">The destination to invoke if the rule accepts the CQS object.</param> /// <exception cref="System.ArgumentNullException"> /// rule /// or /// destination /// </exception> public void RouteCommands(IRoutingRule rule, ICommandBus destination) { if (rule == null) { throw new ArgumentNullException("rule"); } if (destination == null) { throw new ArgumentNullException("destination"); } _commandRoutes.Add(new RoutedCommandBus(rule, destination)); }
private bool MatchMessage(Message msg, IRoutingRule rule) { bool res = false; if (msg == null || rule == null) { return(res); } switch (rule.Type) { default: case RoutingRuleType.MessageType: { if (msg.Header == null || msg.Header.Type == null) { return(res); } XCollection <MessageType> mtlist = rule.MessageTypeList; if (mtlist == null) { return(res); } foreach (MessageType mt in mtlist) { if (msg.Header.Type.EqualsTo(mt)) { res = true; break; } } break; } case RoutingRuleType.ContentBased: { return(MatchMessageContent(msg, rule.ContentCriteria)); } } return(res); }
public static RoutingRuleValidator CreateRoutingRuleValidatorFromCache(IRoutingRule r) { if (r == null) { return(null); } RoutingRuleValidator v = null; lock (_routingRuleValidatorList.SyncRoot) { v = _routingRuleValidatorList[r] as RoutingRuleValidator; if (v == null) { v = new RoutingRuleValidator(r); _routingRuleValidatorList.Add(r, v); } } return(v); }
public RoutingRuleValidator(IRoutingRule rule) { _rule = rule; }
/// <summary> /// Initializes a new instance of the <see cref="RoutedCommandBus"/> class. /// </summary> /// <param name="routingRule">The routing rule.</param> /// <param name="inner">Bus to invoke command on if the rule accepts the command.</param> public RoutedQueryBus(IRoutingRule routingRule, IQueryBus inner) { _routingRule = routingRule; _inner = inner; }
/// <summary> /// Initializes a new instance of the <see cref="RoutedCommandBus"/> class. /// </summary> /// <param name="routingRule">The routing rule.</param> /// <param name="inner">Bus to invoke command on if the rule accepts the command.</param> public RoutedCommandBus(IRoutingRule routingRule, ICommandBus inner) { _routingRule = routingRule; _inner = inner; }
/// <summary> /// Pendent /// </summary> public void AddFirst(IRoutingRule rule, RouteAction action) { AddFirst(new DecoratedRule(rule, action)); }
public DecoratedRule(IRoutingRule inner, RouteAction selectionAction) : this(inner) { this.selectionAction = selectionAction; }
public DecoratedRule(IRoutingRule inner, RouteAction selectionAction) : this(inner) { this.selectionAction = selectionAction; }
public DecoratedRule(IRoutingRule inner) { this.inner = inner; }
/// <summary> /// Initializes a new instance of the <see cref="RoutedCommandBus"/> class. /// </summary> /// <param name="routingRule">The routing rule.</param> /// <param name="inner">Bus to invoke command on if the rule accepts the command.</param> public RoutedEventBus(IRoutingRule routingRule, IEventBus inner) { _routingRule = routingRule; _inner = inner; }
internal MessageTrackExpression(MessagingConfiguration bus, IRoutingRule routing) { _bus = bus; _routing = routing; }
/// <summary> /// Adds the specified rule. /// </summary> /// <param name="rule">The rule.</param> public void AddFirst(IRoutingRule rule) { AddFirst(new DecoratedRule(rule)); }
public DecoratedRule(IRoutingRule inner) { this.inner = inner; }
/// <summary> /// Pendent /// </summary> public void AddFirst(IRoutingRule rule, RouteAction action) { AddFirst(new DecoratedRule(rule, action)); }
/// <summary> /// Adds the specified rule. /// </summary> /// <param name="rule">The rule.</param> public void AddFirst(IRoutingRule rule) { AddFirst(new DecoratedRule(rule)); }
internal MessageTrackExpression(ServiceBusFeature bus, IRoutingRule routing) { _bus = bus; _routing = routing; }
public SendExpression(JasperBusRegistry parent, IRoutingRule routing) { _parent = parent; _routing = routing; }
/// <summary> /// Initializes a new instance of the <see cref="RoutedCommandBus"/> class. /// </summary> /// <param name="routingRule">The routing rule.</param> /// <param name="inner">Bus to invoke request on if the rule accepts the request.</param> public RoutedRequestReplyBus(IRoutingRule routingRule, IRequestReplyBus inner) { _routingRule = routingRule; _inner = inner; }