public SerialPortMessageChannel(IByteStream byteStream, IMessageParserFactory messageParserFactoryFactory,
                                 IMessageEncoderFactory messageEncoderFactoryFactory)
 {
     _byteStream            = byteStream;
     _messageParserFactory  = messageParserFactoryFactory;
     _messageEncoderFactory = messageEncoderFactoryFactory;
 }
        public void Register(IMessageEncoderFactory factory)
        {
            if (factory == null)
            {
                throw new ArgumentNullException("factory");
            }

            _encoderFactories.Add(factory);
        }
        public void Register(IMessageEncoderFactory factory)
        {
            if (factory == null)
            {
                throw new ArgumentNullException("factory");
            }

            _encoderFactories.Add(factory);
        }
Exemple #4
0
        public void AddMessageEncoder <TMessage>(IMessageEncoderFactory <TMessage> factory)
        {
            if (factory == null)
            {
                throw new ArgumentNullException("factory");
            }

            Type messageType = typeof(TMessage);

            lock (_type2encoderFactory)
            {
                if (_type2encoderFactory.ContainsKey(messageType))
                {
                    throw new InvalidOperationException("The specified message type (" + messageType.Name
                                                        + ") is registered already.");
                }
                _type2encoderFactory[messageType] = factory;
            }
        }
 // methods
 public new IMessageEncoder<QueryMessage> GetEncoder(IMessageEncoderFactory encoderFactory)
 {
     return encoderFactory.GetQueryMessageEncoder();
 }
 // methods
 public new IMessageEncoder <KillCursorsMessage> GetEncoder(IMessageEncoderFactory encoderFactory)
 {
     return(encoderFactory.GetKillCursorsMessageEncoder());
 }
 // public methods
 /// <inheritdoc />
 public override IMessageEncoder GetEncoder(IMessageEncoderFactory encoderFactory)
 {
     return(encoderFactory.GetCommandMessageEncoder());
 }
 // public methods
 /// <inheritdoc />
 public IMessageEncoder GetEncoder(IMessageEncoderFactory encoderFactory)
 {
     return(encoderFactory.GetCommandResponseMessageEncoder());
 }
 protected abstract IMessageEncoder GetNonGenericEncoder(IMessageEncoderFactory encoderFactory);
 protected override IMessageEncoder GetNonGenericEncoder(IMessageEncoderFactory encoderFactory)
 {
     return GetEncoder(encoderFactory);
 }
 // methods
 /// <inheritdoc/>
 public override IMessageEncoder GetEncoder(IMessageEncoderFactory encoderFactory)
 {
     return encoderFactory.GetKillCursorsMessageEncoder();
 }
 // methods
 public new IMessageEncoder<KillCursorsMessage> GetEncoder(IMessageEncoderFactory encoderFactory)
 {
     return encoderFactory.GetKillCursorsMessageEncoder();
 }
 public void AddMessageEncoder <TMessage>(IMessageEncoderFactory <TMessage> factory)
 {
     this.encoder.AddMessageEncoder <TMessage>(factory);
 }
Exemple #14
0
 // methods
 public IMessageEncoder GetEncoder(IMessageEncoderFactory encoderFactory)
 {
     return(GetNonGenericEncoder(encoderFactory));
 }
Exemple #15
0
 protected abstract IMessageEncoder GetNonGenericEncoder(IMessageEncoderFactory encoderFactory);
Exemple #16
0
 // methods
 public new IMessageEncoder <QueryMessage> GetEncoder(IMessageEncoderFactory encoderFactory)
 {
     return(encoderFactory.GetQueryMessageEncoder());
 }
Exemple #17
0
 // methods
 public new IMessageEncoder <UpdateMessage> GetEncoder(IMessageEncoderFactory encoderFactory)
 {
     return(encoderFactory.GetUpdateMessageEncoder());
 }
 // methods        
 /// <inheritdoc/>
 public abstract IMessageEncoder GetEncoder(IMessageEncoderFactory encoderFactory);
 // methods
 /// <inheritdoc />
 public IMessageEncoder GetEncoder(IMessageEncoderFactory encoderFactory)
 {
     return(encoderFactory.GetReplyMessageEncoder <TDocument>(_documentSerializer));
 }
 // methods
 public new IMessageEncoder <GetMoreMessage> GetEncoder(IMessageEncoderFactory encoderFactory)
 {
     return(encoderFactory.GetGetMoreMessageEncoder());
 }
 // methods
 public new IMessageEncoder<UpdateMessage> GetEncoder(IMessageEncoderFactory encoderFactory)
 {
     return encoderFactory.GetUpdateMessageEncoder();
 }
 // methods
 /// <inheritdoc/>
 public override IMessageEncoder GetEncoder(IMessageEncoderFactory encoderFactory)
 {
     return encoderFactory.GetDeleteMessageEncoder();
 }
Exemple #23
0
 // methods
 /// <inheritdoc/>
 public abstract IMessageEncoder GetEncoder(IMessageEncoderFactory encoderFactory);
 // methods
 /// <inheritdoc/>
 public override IMessageEncoder GetEncoder(IMessageEncoderFactory encoderFactory)
 {
     return(encoderFactory.GetReplyMessageEncoder <TDocument>(_serializer));
 }
Exemple #25
0
 // methods
 public new IMessageEncoder <InsertMessage <TDocument> > GetEncoder(IMessageEncoderFactory encoderFactory)
 {
     return(encoderFactory.GetInsertMessageEncoder <TDocument>(_serializer));
 }
Exemple #26
0
 // public methods
 /// <inheritdoc />
 public IMessageEncoder GetEncoder(IMessageEncoderFactory encoderFactory)
 {
     return(encoderFactory.GetCompressedMessageEncoder(_originalEncoderSelector));
 }
 protected override IMessageEncoder GetNonGenericEncoder(IMessageEncoderFactory encoderFactory)
 {
     return(GetEncoder(encoderFactory));
 }
Exemple #28
0
 // methods
 public new IMessageEncoder <DeleteMessage> GetEncoder(IMessageEncoderFactory encoderFactory)
 {
     return(encoderFactory.GetDeleteMessageEncoder());
 }
Exemple #29
0
 // methods
 /// <inheritdoc/>
 public override IMessageEncoder GetEncoder(IMessageEncoderFactory encoderFactory)
 {
     return(encoderFactory.GetGetMoreMessageEncoder());
 }
 /// <inheritdoc />
 public override IMessageEncoder GetEncoder(IMessageEncoderFactory encoderFactory)
 {
     return(encoderFactory.GetCompressedMessageEncoder(null));
 }
Exemple #31
0
 // methods
 /// <inheritdoc/>
 public override IMessageEncoder GetEncoder(IMessageEncoderFactory encoderFactory)
 {
     return(encoderFactory.GetKillCursorsMessageEncoder());
 }
 // methods
 public IMessageEncoder GetEncoder(IMessageEncoderFactory encoderFactory)
 {
     return GetNonGenericEncoder(encoderFactory);
 }