/// <summary>
        /// Initializes a new instance of the <see cref="ProducerMethodQueue" /> class.
        /// </summary>
        /// <param name="queue">The queue.</param>
        /// <param name="serializer">The serializer.</param>
        /// <param name="compositeSerialization">The composite serialization.</param>
        public ProducerMethodQueue(IProducerQueue<MessageExpression> queue,
            IExpressionSerializer serializer, 
            ICompositeSerialization compositeSerialization)
        {
            Guard.NotNull(() => queue, queue);
            Guard.NotNull(() => serializer, serializer);
            Guard.NotNull(() => compositeSerialization, compositeSerialization);

            _queue = queue;
            _serializer = serializer;
            _compositeSerialization = compositeSerialization;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="RpcMethodQueue" /> class.
        /// </summary>
        /// <param name="queue">The queue.</param>
        /// <param name="serializer">The serializer.</param>
        /// <param name="compositeSerialization">The composite serialization.</param>
        public RpcMethodQueue(IRpcQueue<object, MessageExpression> queue,
            IExpressionSerializer serializer, 
            ICompositeSerialization compositeSerialization)
        {
            Guard.NotNull(() => queue, queue);
            Guard.NotNull(() => serializer, serializer);
            Guard.NotNull(() => compositeSerialization, compositeSerialization);

            _queue = queue;
            _serializer = serializer;
            _compositeSerialization = compositeSerialization;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ExpressionSerializerDecorator" /> class.
        /// </summary>
        /// <param name="metrics">The metrics factory.</param>
        /// <param name="handler">The handler.</param>
        /// <param name="connectionInformation">The connection information.</param>
        public ExpressionSerializerDecorator(IMetrics metrics,
            IExpressionSerializer handler,
            IConnectionInformation connectionInformation)
        {
            var name = handler.GetType().Name;
            _methodToBytesTimer = metrics.Timer($"{connectionInformation.QueueName}.{name}.ConvertMethodToBytesTimer", Units.Calls);
            _bytesToMethodTimer = metrics.Timer($"{connectionInformation.QueueName}.{name}.ConvertBytesToMethodTimer", Units.Calls);
            _resultMethodSizeHistogram = metrics.Histogram($"{connectionInformation.QueueName}.{name}.ConvertMethodToBytesHistogram", Units.Bytes,
                SamplingTypes.LongTerm);

            _functionToBytesTimer = metrics.Timer($"{connectionInformation.QueueName}.{name}.ConvertFunctionToBytesTimer", Units.Calls);
            _bytesToFunctionTimer = metrics.Timer($"{connectionInformation.QueueName}.{name}.ConvertBytesToFunctionTimer", Units.Calls);
            _resultFunctionSizeHistogram = metrics.Histogram($"{connectionInformation.QueueName}.{name}.ConvertFunctionToBytesHistogram", Units.Bytes,
                SamplingTypes.LongTerm);

            _handler = handler;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MessageMethodHandling" /> class.
        /// </summary>
        /// <param name="serializer">The serializer.</param>
        /// <param name="queueContainer">The queue container.</param>
        /// <param name="log">The log.</param>
        /// <param name="linqCompiler">The method compiler.</param>
        /// <param name="compositeSerialization">The composite serialization.</param>
        public MessageMethodHandling(IExpressionSerializer serializer,
            IQueueContainer queueContainer,
            ILogFactory log, 
            ILinqCompiler linqCompiler, 
            ICompositeSerialization compositeSerialization)
        {
            Guard.NotNull(() => serializer, serializer);
            Guard.NotNull(() => queueContainer, queueContainer);
            Guard.NotNull(() => log, log);
            Guard.NotNull(() => linqCompiler, linqCompiler);
            Guard.NotNull(() => compositeSerialization, compositeSerialization);

            _serializer = serializer;
            _queueContainer = queueContainer;
            _linqCompiler = linqCompiler;
            _compositeSerialization = compositeSerialization;
            _log = log.Create();

            _rpcQueues = new Dictionary<IConnectionInformation, IProducerQueueRpc<object>>();
        }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InvocationSerializer"/> class
 /// with a base serializer for recurision.
 /// </summary>
 /// <param name="serializer">The base serializer.</param>
 public InvocationSerializer(IExpressionSerializer <Expression, SerializableExpression> serializer)
     : base(serializer)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ParameterSerializer"/> class.
 /// </summary>
 /// <param name="serializer">The serializer to use.</param>
 public ParameterSerializer(IExpressionSerializer <Expression, SerializableExpression> serializer)
     : base(serializer)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CtorSerializer"/> class.
 /// </summary>
 /// <param name="serializer">The base serializer.</param>
 public CtorSerializer(
     IExpressionSerializer <Expression, SerializableExpression> serializer)
     : base(serializer)
 {
 }
Example #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BaseSerializer{T, TSerializable}"/> class with a default serializer.
 /// </summary>
 /// <param name="serializer">The default serializer.</param>
 /// <exception cref="System.ArgumentNullException">Thrown when serializer is null.</exception>
 public BaseSerializer(
     IExpressionSerializer <Expression, SerializableExpression> serializer)
 {
     Ensure.NotNull(() => serializer);
     Serializer = serializer;
 }
Example #9
0
 public DefaultDynamicContentEvaluatorImpl(Func <IMarketingRepository> repositoryFactory, IDynamicContentService dynamicContentService, IExpressionSerializer expressionSerializer, ILog logger)
 {
     _repositoryFactory     = repositoryFactory;
     _dynamicContentService = dynamicContentService;
     _expressionSerializer  = expressionSerializer;
     _logger = logger;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ConstantSerializer"/> class.
 /// </summary>
 /// <param name="serializer">The serializer to use.</param>
 public ConstantSerializer(IExpressionSerializer <Expression, SerializableExpression> serializer)
     : base(serializer)
 {
 }
Example #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BinarySerializer"/> class with a
 /// base serializer for recursion.
 /// </summary>
 /// <param name="serializer">The base serializer.</param>
 public BinarySerializer(IExpressionSerializer <Expression, SerializableExpression> serializer)
     : base(serializer)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NewArraySerializer"/> class with a
 /// base serializer for recurision.
 /// </summary>
 /// <param name="serializer">The base serializer.</param>
 public NewArraySerializer(IExpressionSerializer <Expression, SerializableExpression> serializer)
     : base(serializer)
 {
 }
 public MarketingModuleDynamicContentController(IDynamicContentService dynamicContentService, IMarketingExtensionManager marketingExtensionManager,
                                                IMarketingDynamicContentEvaluator dynamicContentEvaluator, IExpressionSerializer expressionSerializer, IDynamicContentSearchService dynamicConentSearchService)
 {
     _dynamicContentService      = dynamicContentService;
     _marketingExtensionManager  = marketingExtensionManager;
     _dynamicContentEvaluator    = dynamicContentEvaluator;
     _expressionSerializer       = expressionSerializer;
     _dynamicConentSearchService = dynamicConentSearchService;
 }
        /// <summary>
        /// Instantiates a converter for expressions.
        /// </summary>
        /// <param name="expressionSerializer">Serialization callback for expressions.</param>
        public ExpressionJsonConverter(IExpressionSerializer expressionSerializer)
        {
            Debug.Assert(expressionSerializer != null);

            _expressionSerializer = expressionSerializer;
        }
 public PricingServiceImpl(Func <IPricingRepository> repositoryFactory, IItemService productService, ILog logger, ICacheManager <object> cacheManager, IExpressionSerializer expressionSerializer,
                           IPricingExtensionManager extensionManager, IPricingPriorityFilterPolicy pricingFilterPolicy, IEventPublisher eventPublisher)
 {
     _repositoryFactory           = repositoryFactory;
     _productService              = productService;
     _logger                      = logger;
     _cacheManager                = cacheManager;
     _expressionSerializer        = expressionSerializer;
     _extensionManager            = extensionManager;
     _pricingPriorityFilterPolicy = pricingFilterPolicy;
     _eventPublisher              = eventPublisher;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MethodSerializer"/> class.
 /// </summary>
 /// <param name="serializer">The base serializer.</param>
 public MethodSerializer(
     IExpressionSerializer <Expression, SerializableExpression> serializer)
     : base(serializer)
 {
 }
Example #17
0
 public static LoggerFactoryConfiguration Load(Stream jsonStream, IExpressionSerializer serializer = null)
 {
     return((serializer ?? ExpressionSerializerFactory.CreateSerializer()).Deserialize <LoggerFactoryConfiguration>(jsonStream));
 }
Example #18
0
 public Runner(IExpressionSerializer <Model> expressionSerializer, ILogger <Runner> logger)
 {
     this._expressionSerializer = expressionSerializer ?? throw new ArgumentNullException(nameof(expressionSerializer));
     this._logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Example #19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MemberInitSerializer"/> class.
 /// </summary>
 /// <param name="serializer">The base serializer.</param>
 public MemberInitSerializer(
     IExpressionSerializer <Expression, SerializableExpression> serializer)
     : base(serializer)
 {
 }
 public DynamicPromotionMoq(IExpressionSerializer expressionSerializer, ICouponService couponService,
                            IPromotionUsageService usageService) : base(expressionSerializer, couponService, usageService)
 {
 }