Example #1
0
        private IMessageHandler GetHandler(IShuttleMessageEntry entry)
        {
            Contract.Requires(entry != null);

            // get handler from entry
            var handler = entry.MessageHandler;

            // if handler is cached, return handler
            if (handler != null)
            {
                return(handler);
            }

            // create handler
            handler = CreateHandler(entry.MessageHandlerType);
            Contract.Assume(handler != null);

            // if handler is reusable, cache in entry
            if (handler.IsReusable)
            {
                entry.MessageHandler = handler;
            }

            return(handler);
        }
 public void Add(IShuttleMessageEntry entry)
 {
     Contract.Requires(entry != null);
 }
Example #3
0
 public void Add(IShuttleMessageEntry entry)
 {
     _entries.Add(entry.MessageType, entry);
 }