public SerializationMapper(IMessageMapper mapper, Conventions conventions, Configure configure) { jsonSerializer = new JsonMessageSerializer(mapper); xmlSerializer = new XmlMessageSerializer(mapper, conventions); List<Type> messageTypes = configure.TypesToScan.Where(conventions.IsMessageType).ToList(); xmlSerializer.Initialize(messageTypes); }
/// <summary> /// Initializes an instance of a <see cref="XmlMessageSerializer" />. /// </summary> /// <param name="mapper">Message Mapper.</param> /// <param name="conventions">The endpoint conventions.</param> public XmlMessageSerializer(IMessageMapper mapper, Conventions conventions) { Guard.AgainstNull(nameof(mapper), mapper); Guard.AgainstNull(nameof(conventions), conventions); this.mapper = mapper; this.conventions = conventions; }
public IMessageProcessor Create(IUnitOfWork unitOfWork, IMessageMapper mappingEngine, CommandEngineConfiguration configuration) { return(new MessageProcessor(mappingEngine, new CommandInvoker(new ValidationEngine(new ValidationRuleFactory()), new CommandFactory()), unitOfWork, configuration)); }
public XmlDeserialization(IMessageMapper mapper, XmlSerializerCache cache, bool skipWrappingRawXml, bool sanitizeInput) { this.mapper = mapper; this.cache = cache; this.skipWrappingRawXml = skipWrappingRawXml; this.sanitizeInput = sanitizeInput; }
public StoreEvents(IEventStoreConnection client, IMessageMapper mapper, int readsize, bool compress) { _client = client; _mapper = mapper; _readsize = readsize; _compress = compress; }
public MultiDeserializer(Configure config, Conventions conventions, IMessageSerializer defaultSerializer, IMessageMapper mapper, LogicalMessageFactory logicalMessageFactory, MessageMetadataRegistry metadataRegistry) { _defaultSerializer = defaultSerializer; _logicalMessageFactory = logicalMessageFactory; _metadataRegistry = metadataRegistry; var json = new JsonMessageSerializer(mapper); serializers.Add(json.ContentType, json); var bson = new BsonMessageSerializer(mapper); serializers.Add(bson.ContentType, bson); var binary = new BinaryMessageSerializer(); serializers.Add(binary.ContentType, binary); var xml = new XmlMessageSerializer(mapper, conventions); List <Type> messageTypes = config.TypesToScan.Where(conventions.IsMessageType).ToList(); xml.Initialize(messageTypes); serializers.Add(xml.ContentType, xml); if (!serializers.ContainsKey(_defaultSerializer.ContentType)) { serializers.Add(_defaultSerializer.ContentType, _defaultSerializer); } }
public SerializationMapper(IMessageMapper mapper, Conventions conventions, Configure configure) { jsonSerializer = new JsonMessageSerializer(mapper); xmlSerializer = new XmlMessageSerializer(mapper, conventions); var messageTypes = configure.TypesToScan.Where(conventions.IsMessageType).ToList(); xmlSerializer.Initialize(messageTypes); }
public StoreEvents(IMessageMapper mapper, int readsize, Compression compress, IEventStoreConnection[] connections) { _clients = connections; _mapper = mapper; _readsize = readsize; _compress = compress; }
/// <summary> /// Initializes a new instance of <see cref="JsonMessageSerializer" />. /// </summary> public JsonMessageSerializer(IMessageMapper messageMapper, Encoding encoding) { this.messageMapper = messageMapper; this.encoding = encoding; messageContractResolver = new MessageContractResolver(messageMapper); }
public EventStoreConsumer(IMessageMapper mapper, IEventStoreConnection[] clients, int readSize, bool extraStats) { _clients = clients; _readSize = readSize; _extraStats = extraStats; _subLock = new object(); _subscriptions = new List <EventStoreCatchUpSubscription>(); _persistentSubs = new List <EventStorePersistentSubscriptionBase>(); _outstandingEvents = new ConcurrentDictionary <Guid, Tuple <EventStorePersistentSubscriptionBase, Guid> >(); _settings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Auto, SerializationBinder = new EventSerializationBinder(mapper), ContractResolver = new EventContractResolver(mapper), Converters = new[] { new Newtonsoft.Json.Converters.StringEnumConverter() } }; if (clients.Any(x => x.Settings.GossipSeeds == null || !x.Settings.GossipSeeds.Any())) { throw new ArgumentException( "Eventstore connection settings does not contain gossip seeds (even if single host call SetGossipSeedEndPoints and SetClusterGossipPort)"); } }
public UnitOfWork(IRepositoryFactory repoFactory, IMessageMapper mapper) { _repoFactory = repoFactory; _mapper = mapper; _repositories = new Dictionary <Type, IRepository>(); _workHeaders = new Dictionary <String, String>(); }
/// <summary> /// Initializes a new instance of the <see cref="T:RestBus.RabbitMQ.RestBusClient" /> class. /// </summary> /// <param name="messageMapper">The <see cref="IMessageMapper" /> the client uses to route messages.</param> /// <param name="settings">Client settings.</param> public RestBusClient(IMessageMapper messageMapper, ClientSettings settings) : base(new HttpClientHandler(), true) { //Set default HttpClient related fields timeout = TimeSpan.FromSeconds(100); MaxResponseContentBufferSize = int.MaxValue; //TODO: Setup cancellation token here. //Ensure messageMapper server uris are valid AmqpConnectionInfo.EnsureValid(messageMapper.ServerUris, "messageMapper.ServerUris"); //Configure RestBus fields/properties this.messageMapper = messageMapper; this.messagingConfig = messageMapper.MessagingConfig; //Fetched only once. if (messagingConfig == null) { throw new ArgumentException("messageMapper.MessagingConfig returned null"); } //Set ClientSettings this.Settings = settings ?? new ClientSettings(); // Always have a default instance, if it wasn't passed in. this.Settings.Client = this; //Indicate that the settings is owned by this client. //Instantiate connection manager and RPC strategies; connectionMgr = new ConnectionManager(messageMapper.ServerUris); directStrategy = new DirectReplyToRPCStrategy(); callbackStrategy = new CallbackQueueRPCStrategy(this.Settings, messageMapper.GetServiceName(null)); }
public IMessageProcessor Create(IUnitOfWork unitOfWork, IMessageMapper mappingEngine, CommandEngineConfiguration configuration) { return new MessageProcessor(mappingEngine, new CommandInvoker(new ValidationEngine(new ValidationRuleFactory()), new CommandFactory()), unitOfWork, configuration); }
/// <summary> /// Initislizes a new instance of the <see cref="RestBusSubscriber"/> /// </summary> /// <param name="messageMapper">The <see cref="IMessageMapper"/> used by the subscriber.</param> /// <param name="settings">The subscriber settings</param> public RestBusSubscriber(IMessageMapper messageMapper, SubscriberSettings settings) { this.messageMapper = messageMapper; messagingConfig = messageMapper.MessagingConfig; //Fetched only once if (messagingConfig == null) { throw new ArgumentException("messageMapper.MessagingConfig returned null", "messageMapper"); } if (messageMapper.SupportedExchangeKinds == default(ExchangeKind)) { throw new ArgumentException("messageMapper.SupportedExchangeKinds is not set up.", "messageMapper"); } serviceName = (messageMapper.GetServiceName(null) ?? String.Empty).Trim(); subscriberIdHeader = new string[] { AmqpUtils.GetNewExclusiveQueueId() }; this.connectionFactory = new ConnectionFactory(); connectionFactory.Uri = new Uri(messageMapper.ServerUris[0].Uri); ConnectionNames = messageMapper.ServerUris.Select(u => u.FriendlyName ?? String.Empty).ToArray(); connectionFactory.RequestedHeartbeat = Client.RPCStrategyHelpers.HEART_BEAT; this.Settings = settings ?? new SubscriberSettings(); //Make sure a default value is set, if not supplied by user. this.Settings.Subscriber = this; //Indicate that the subcriber settings is owned by this subscriber. }
/// <summary> /// Initializes a new instance of <see cref="JsonMessageSerializer"/>. /// </summary> public JsonMessageSerializer(IMessageMapper messageMapper) { Guard.AgainstNull(messageMapper, "messageMapper"); this.messageMapper = messageMapper; messageContractResolver = new MessageContractResolver(messageMapper); settings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All, Converters = { new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.RoundtripKind } } }; writerCreator = stream => { var streamWriter = new StreamWriter(stream, Encoding.UTF8); return(new JsonTextWriter(streamWriter) { Formatting = Formatting.None }); }; readerCreator = stream => { var streamReader = new StreamReader(stream, Encoding.UTF8); return(new JsonTextReader(streamReader)); }; }
public SerializationMapper(IMessageMapper mapper, ReadOnlySettings settings) { xmlSerializer = new XmlSerializer() .Configure(settings)(mapper); jsonSerializer = new JsonSerializer() .Configure(settings)(mapper); }
public SerializationMapper(IMessageMapper mapper,Conventions conventions, ReadOnlySettings settings) { jsonSerializer = new JsonMessageSerializer(mapper); xmlSerializer = new XmlMessageSerializer(mapper, conventions); List<Type> messageTypes = settings.GetAvailableTypes().Where(conventions.IsMessageType).ToList(); xmlSerializer.Initialize(messageTypes); }
public HomeController(IMessageEncryptor encryptor, IMessageRepository repository, IMessageValidator validator, IMessageMapper mapper) { this.encryptor = encryptor; this.repository = repository; this.validator = validator; this.mapper = mapper; }
public UnitOfWork(IRepositoryFactory repoFactory, IMessageMapper mapper) { _repoFactory = repoFactory; _mapper = mapper; _repositories = new Dictionary <string, IRepository>(); _pocoRepositories = new Dictionary <string, IRepository>(); CurrentHeaders = new Dictionary <string, string>(); }
public SerializationMapper(IMessageMapper mapper, Conventions conventions, ReadOnlySettings settings) { jsonSerializer = new JsonMessageSerializer(mapper); xmlSerializer = new XmlMessageSerializer(mapper, conventions); List <Type> messageTypes = settings.GetAvailableTypes().Where(conventions.IsMessageType).ToList(); xmlSerializer.Initialize(messageTypes); }
public MessageProcessor(IMessageValidator validator, IMessageMapper mapper, IIdDeDuplicator idDeDuplicator, MessageProcessorOptions options) { this.mapper = mapper; this.idDeDuplicator = idDeDuplicator; this.options = options; this.validator = validator; }
public RestBusSubscriber(IMessageMapper messageMapper) { exchangeInfo = messageMapper.GetExchangeInfo(); subscriberId = AmqpUtils.GetRandomId(); this.connectionFactory = new ConnectionFactory(); connectionFactory.Uri = exchangeInfo.ServerAddress; connectionFactory.RequestedHeartbeat = Client.RestBusClient.HEART_BEAT; }
public MessageProcessor(IMessageMapper mappingEngine, ICommandInvoker commandInvoker, IUnitOfWork unitOfWork, CommandEngineConfiguration configuration ) { _mappingEngine = mappingEngine; _commandInvoker = commandInvoker; _unitOfWork = unitOfWork; _configuration = configuration; }
public MessageService(MessengerConfiguration configuration, ILog log, IMessageMapper mapper, IMessageProviderFactory factory) { this.State = MessengerState.Stopped; this.logger = log; this.Configuration = configuration; this.ProviderFactory = factory; this.Mapper = mapper; }
public UnitOfWork(IRiakClient client, IMessageMapper mapper) { _client = client; _mapper = mapper; _tracked = new ConcurrentDictionary <RiakObjectId, RiakObject>(); _saves = new ConcurrentDictionary <RiakObjectId, RiakObject>(); _updates = new ConcurrentDictionary <RiakObjectId, RiakObject>(); _deletions = new ConcurrentBag <RiakObjectId>(); }
public RestBusSubscriber(IMessageMapper messageMapper ) { exchangeInfo = messageMapper.GetExchangeInfo(); subscriberId = AmqpUtils.GetRandomId(); this.connectionFactory = new ConnectionFactory(); connectionFactory.Uri = exchangeInfo.ServerAddress; connectionFactory.RequestedHeartbeat = Client.RestBusClient.HEART_BEAT; }
private static XMLMessageSerializer CreateSerializer(IMessageMapper mapper, Type type) { var xmlSerializer = new XMLMessageSerializer(); xmlSerializer.MessageMapper = mapper; xmlSerializer.MessageTypes = new List <Type> { type }; return(xmlSerializer); }
public StoreEvents(IEventStoreConnection client, IBuilder builder, IMessageMapper mapper, IStoreSnapshots snapshots, ReadOnlySettings nsbSettings, IStreamCache cache) { _client = client; _mapper = mapper; _snapshots = snapshots; _nsbSettings = nsbSettings; _builder = builder; _cache = cache; _shouldCache = _nsbSettings.Get <Boolean>("ShouldCacheEntities"); }
public void MessageBoardService_Constructor_ThrowsNullException_When_MessageMapper_Is_Null() { // Arrange IMessageMapper mapper = null; var options = new DbContextOptions <MessageBoardDbContext>(); var dbContext = new MessageBoardDbContext(options); // Act and Assert Assert.Throws <ArgumentNullException>(() => new MessageBoardService(mapper, dbContext)); }
public DelayedSubscriber(IMessageMapper mapper, IEventStoreConnection[] connections, int maxDelayed) { _clients = connections; _maxDelayed = maxDelayed; _settings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Auto, Binder = new EventSerializationBinder(mapper), ContractResolver = new EventContractResolver(mapper) }; }
static IMessageSerializer CreateMessageSerializer(Tuple<SerializationDefinition, SettingsHolder> definitionAndSettings, IMessageMapper mapper, ReadOnlySettings mainSettings) { var definition = definitionAndSettings.Item1; var deserializerSettings = definitionAndSettings.Item2; deserializerSettings.Merge(mainSettings); deserializerSettings.PreventChanges(); var serializerFactory = definition.Configure(deserializerSettings); var serializer = serializerFactory(mapper); return serializer; }
public Dequeuer( ISQSClient sqsClient, ILogger logger, IActorFactory factory, IMessageMapper mapper) { _sqsClient = sqsClient ?? throw new ArgumentNullException(nameof(sqsClient)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _factory = factory ?? throw new ArgumentNullException(nameof(factory)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); }
public ChatController(UserManager <User> userManager, IMessageManager messageManager, IHostingEnvironment environment, IOptions <PhotoConfig> photoOptions, IMessageMapper messageMapper) { _userManager = userManager; _messageManager = messageManager; _environment = environment; _photoOptions = photoOptions; _messageMapper = messageMapper; }
/// <summary> /// Constructor. /// </summary> public JsonMessageSerializer(IMessageMapper messageMapper, Options options = null) { this.messageMapper = messageMapper; if (options == null) { this.options = Options.Default; } else { this.options = options; } }
public ServiceBrokerTransportReceiver(ServiceBrokerServiceBusReceiverConfiguration receiverConfiguration, ServiceBrokerServiceBusConfiguration configuration) { messageMapper = configuration.MessageMapper; messageEncoder = configuration.MessageEncoder; ServiceBrokerMessageType = configuration.ServiceBrokerMessageType; if (string.IsNullOrWhiteSpace(ServiceBrokerMessageType)) { throw new InvalidConfigurationException("ServiceBrokerMessageType cannot be null or whitespace."); } ServiceBrokerContract = configuration.ServiceBrokerContract; if (string.IsNullOrWhiteSpace(ServiceBrokerContract)) { throw new InvalidConfigurationException("ServiceBrokerContract cannot be null or whitespace."); } ServiceBrokerService = receiverConfiguration.ServiceBrokerService; if (string.IsNullOrWhiteSpace(ServiceBrokerService)) { throw new InvalidConfigurationException("ServiceBrokerService cannot be null or whitespace."); } ServiceBrokerQueue = receiverConfiguration.ServiceBrokerQueue; if (string.IsNullOrWhiteSpace(ServiceBrokerQueue)) { throw new InvalidConfigurationException("ServiceBrokerQueue cannot be null or whitespace."); } ConnectionString = configuration.ServiceBrokerConnectionString; if (string.IsNullOrWhiteSpace(ConnectionString) && !string.IsNullOrWhiteSpace(configuration.ServiceBrokerConnectionStringName) && ConfigurationManager.ConnectionStrings[configuration.ServiceBrokerConnectionStringName] != null) { ConnectionString = ConfigurationManager.ConnectionStrings[configuration.ServiceBrokerConnectionStringName].ConnectionString; } if (string.IsNullOrWhiteSpace(ConnectionString)) { throw new InvalidConfigurationException("ServiceBrokerConnectionString cannot be null or whitespace."); } MaxRetries = receiverConfiguration.MaxRetries; if (MaxRetries < 0) { MaxRetries = 0; } MaxConcurrency = receiverConfiguration.MaxConcurrency; if (MaxConcurrency < 0) { MaxConcurrency = 0; } if (MaxConcurrency > 0) { workerThreadPool = new Semaphore(MaxConcurrency, MaxConcurrency); } faultManager = new TransportMessageFaultManager(MaxRetries); }
public MagnetClientBuilder AddMessageType <TMessageType>( string name, IMessageMapper <TMessageType> mapper) { var typeReg = new MessageTypeRegistration { MessageType = typeof(TMessageType), Name = name, Mapper = mapper }; _services.AddSingleton(typeReg); return(this); }
public EventSubscriber(MessageHandlerRegistry registry, IMessageMapper mapper, MessageMetadataRegistry messageMeta, IEventStoreConnection[] connections, int concurrency) { _registry = registry; _clients = connections; _messageMeta = messageMeta; _concurrency = concurrency; _settings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Auto, SerializationBinder = new EventSerializationBinder(mapper), ContractResolver = new EventContractResolver(mapper) }; }
public void Initialize(Assembly assembly, IMessageMapper messageMapper) { if (_mappingEngine == null) { lock (_lock) { if (_configuration == null) { Configuration = new CommandEngineConfiguration(); Configuration.Initialize(assembly); _mappingEngine = messageMapper; } } } }
/// <summary> /// "Reimagines" a well-formatted XML file using a renderer of your choice. /// </summary> /// <param name="messageFilePath">XML file containing SMS log</param> /// <param name="outputPath">directory in which to place output</param> /// <param name="mapper"><see cref="IMessageMapper" /> for configuring AutoMapper</param> /// <param name="renderer"><see cref="IConversationRenderer" /> with which to process the data</param> public static void Process( string messageFilePath, string outputPath, IMessageMapper mapper, IConversationRenderer renderer ) { mapper.Configure(); Directory.CreateDirectory( outputPath ); var serializer = new XmlSerializer( typeof(smses) ); var data = (smses) serializer.Deserialize( new StreamReader( messageFilePath ) ); var bucket = Mapper.Map<MessageBucket>( data ); var conversations = bucket.SelectConversations(); renderer.Render( conversations, outputPath ); }
public AmqpTransportReceiver(AmqpMessageReceiverConfiguration config, AmqpServiceBusConfiguration serviceBusConfig) { amqpAddress = serviceBusConfig.AmqpAddress; ReceiverLinkAddress = config.ReceiverLinkAddress; MaxRetries = config.MaxRetries; if (MaxRetries < 0) { MaxRetries = 0; } MaxConcurrency = config.MaxConcurrency; if (MaxConcurrency < 0) { MaxConcurrency = 0; } messageMapper = serviceBusConfig.MessageMapper; messageEncoder = serviceBusConfig.MessageEncoder; faultManager = new TransportMessageFaultManager(MaxRetries); }
/// <summary>Initializes a new instance of the <see cref="T:RestBus.RabbitMQ.RestBusClient" /> class.</summary> public RestBusClient(IMessageMapper messageMapper) : base(new HttpClientHandler(), true) { //Set default HttpClient related fields timeout = TimeSpan.FromSeconds(100); MaxResponseContentBufferSize = int.MaxValue; //TODO: Setup cancellation token here. //Configure RestBus fields/properties this.messageMapper = messageMapper; this.exchangeInfo = messageMapper.GetExchangeInfo(); this.clientId = AmqpUtils.GetRandomId(); this.exchangeName = AmqpUtils.GetExchangeName(exchangeInfo); this.callbackQueueName = AmqpUtils.GetCallbackQueueName(exchangeInfo, clientId); //Map request to RabbitMQ Host and exchange, this.connectionFactory = new ConnectionFactory(); connectionFactory.Uri = exchangeInfo.ServerAddress; connectionFactory.RequestedHeartbeat = HEART_BEAT; }
public ServiceBrokerTransportSender(ServiceBrokerServiceBusConfiguration configuration) { ServiceBrokerMessageType = configuration.ServiceBrokerMessageType; if (string.IsNullOrWhiteSpace(ServiceBrokerMessageType)) { throw new InvalidConfigurationException("ServiceBrokerMessageType cannot be null or whitespace."); } ServiceBrokerContract = configuration.ServiceBrokerContract; if (string.IsNullOrWhiteSpace(ServiceBrokerContract)) { throw new InvalidConfigurationException("ServiceBrokerContract cannot be null or whitespace."); } ServiceBrokerSendingService = configuration.ServiceBrokerSendingService; if (string.IsNullOrWhiteSpace(ServiceBrokerSendingService)) { throw new InvalidConfigurationException("ServiceBrokerSendingService cannot be null or whitespace."); } ConnectionString = configuration.ServiceBrokerConnectionString; if (string.IsNullOrWhiteSpace(ConnectionString) && !string.IsNullOrWhiteSpace(configuration.ServiceBrokerConnectionStringName) && ConfigurationManager.ConnectionStrings[configuration.ServiceBrokerConnectionStringName] != null) { ConnectionString = ConfigurationManager.ConnectionStrings[configuration.ServiceBrokerConnectionStringName].ConnectionString; } if (string.IsNullOrWhiteSpace(ConnectionString)) { throw new InvalidConfigurationException("ServiceBrokerConnectionString cannot be null or whitespace."); } messageEncoder = configuration.MessageEncoder; if (messageEncoder == null) { throw new InvalidConfigurationException("MessageEncoder cannot be null."); } messageMapper = configuration.MessageMapper; if (messageMapper == null) { throw new InvalidConfigurationException("MessageMapper cannot be null."); } }
/// <summary> /// Initislizes a new instance of the <see cref="RestBusSubscriber"/> /// </summary> /// <param name="messageMapper">The <see cref="IMessageMapper"/> used by the subscriber.</param> /// <param name="settings">The subscriber settings</param> public RestBusSubscriber(IMessageMapper messageMapper, SubscriberSettings settings) { this.messageMapper = messageMapper; messagingConfig = messageMapper.MessagingConfig; //Fetched only once if (messagingConfig == null) throw new ArgumentException("messageMapper.MessagingConfig returned null", "messageMapper"); if (messageMapper.SupportedExchangeKinds == default(ExchangeKind)) { throw new ArgumentException("messageMapper.SupportedExchangeKinds is not set up.", "messageMapper"); } serviceName = (messageMapper.GetServiceName(null) ?? String.Empty).Trim(); subscriberIdHeader = new string[] { AmqpUtils.GetNewExclusiveQueueId() }; AmqpConnectionInfo.EnsureValid(messageMapper.ServerUris, "messageMapper.ServerUris"); this.connectionFactory = new ConnectionFactory(); connectionFactory.Uri = messageMapper.ServerUris[0].Uri; ConnectionNames = messageMapper.ServerUris.Select(u => u.FriendlyName ?? String.Empty).ToArray(); connectionFactory.RequestedHeartbeat = Client.RPCStrategyHelpers.HEART_BEAT; this.Settings = settings ?? new SubscriberSettings(); //Make sure a default value is set, if not supplied by user. this.Settings.Subscriber = this; //Indicate that the subcriber settings is owned by this subscriber. }
/// <summary> /// Initializes a new instance of the <see cref="T:RestBus.RabbitMQ.RestBusClient" /> class. /// </summary> /// <param name="messageMapper">The <see cref="IMessageMapper" /> the client uses to route messages.</param> /// <param name="settings">Client settings.</param> public RestBusClient(IMessageMapper messageMapper, ClientSettings settings ) : base(new HttpClientHandler(), true) { //Set default HttpClient related fields timeout = TimeSpan.FromSeconds(100); MaxResponseContentBufferSize = int.MaxValue; //TODO: Setup cancellation token here. //Ensure messageMapper server uris are valid AmqpConnectionInfo.EnsureValid(messageMapper.ServerUris, "messageMapper.ServerUris"); //Configure RestBus fields/properties this.messageMapper = messageMapper; this.messagingConfig = messageMapper.MessagingConfig; //Fetched only once. if (messagingConfig == null) throw new ArgumentException("messageMapper.MessagingConfig returned null"); //Set ClientSettings this.Settings = settings ?? new ClientSettings(); // Always have a default instance, if it wasn't passed in. this.Settings.Client = this; //Indicate that the settings is owned by this client. //Instantiate connection manager and RPC strategies; connectionMgr = new ConnectionManager(messageMapper.ServerUris); directStrategy = new DirectReplyToRPCStrategy(); callbackStrategy = new CallbackQueueRPCStrategy(this.Settings, messageMapper.GetServiceName(null)); }
public MessageContractResolver(IMessageMapper messageMapper) : base(true) { _messageMapper = messageMapper; }
public XmlTransportMessageSerializer(IMessageMapper mapper, IMessageRegisterer registerer, XmlMessageSerializer serializer) { _mapper = mapper; _registrar = registerer; _serializer = serializer; }
public void SetUp() { mapper = new MessageMapper.Reflection.MessageMapper(); }
/// <summary> /// Initializes a new instance of <see cref="JsonMessageSerializer" />. /// </summary> public JsonMessageSerializer(IMessageMapper messageMapper) : this(messageMapper, Encoding.UTF8) { }
protected JsonMessageSerializerBase(IMessageMapper messageMapper) { _messageMapper = messageMapper; }
/// <summary> /// Ctor /// </summary> /// <param name="messageMetadataRegistry"></param> /// <param name="messageMapper"></param> /// <param name="pipelineExecutor"></param> public LogicalMessageFactory(MessageMetadataRegistry messageMetadataRegistry, IMessageMapper messageMapper, PipelineExecutor pipelineExecutor) { this.messageMetadataRegistry = messageMetadataRegistry; this.messageMapper = messageMapper; this.pipelineExecutor = pipelineExecutor; }
public MessageContractResolver(IMessageMapper messageMapper) { this.messageMapper = messageMapper; }
/// <summary> /// Initializes an instance of a <see cref="XmlMessageSerializer"/>. /// </summary> /// <param name="mapper">Message Mapper</param> public XmlMessageSerializer(IMessageMapper mapper) { this.mapper = mapper; }
private static List<string> GetNamespaces(IMessage[] messages, IMessageMapper mapper) { var result = new List<string>(); foreach (IMessage m in messages) { string ns = mapper.GetMappedTypeFor(m.GetType()).Namespace; if (!result.Contains(ns)) result.Add(ns); } return result; }
private static List<string> GetBaseTypes(IMessage[] messages, IMessageMapper mapper) { var result = new List<string>(); foreach (IMessage m in messages) { Type t = mapper.GetMappedTypeFor(m.GetType()); Type baseType = t.BaseType; while (baseType != typeof(object) && baseType != null) { if (typeof(IMessage).IsAssignableFrom(baseType)) if (!result.Contains(baseType.FullName)) result.Add(baseType.FullName); baseType = baseType.BaseType; } foreach (Type i in t.GetInterfaces()) if (i != typeof(IMessage) && typeof(IMessage).IsAssignableFrom(i)) if (!result.Contains(i.FullName)) result.Add(i.FullName); } return result; }
public JsonMessageSerializer(IMessageMapper messageMapper) : base(messageMapper) { }
public MessageSerializationBinder(IMessageMapper messageMapper) { _messageMapper = messageMapper; }