public void SetAssociation <TClass, TAspect>(IMessageMatcher matcher)
            where TAspect : AspectBase
        {
            var        ci         = typeof(TAspect).GetConstructor(Type.EmptyTypes);
            AspectBase controller = Activator.CreateInstance <TAspect>() as AspectBase;

            _associations[typeof(TClass)] = new AspectControllerInfo(controller, matcher);
        }
Beispiel #2
0
        public virtual IMessage SyncProcessMessage(IMessageSink sink, IMessage msg)
        {
            AspectControllerInfo cinfo = AspectConfiguration.Instance.GetAssociation(GetType());

            if ((cinfo != null) && (cinfo.Controller != null))
            {
                if ((cinfo.Matcher == null) || cinfo.Matcher.IsMatch(msg))
                {
                    return(cinfo.Controller.SyncProcessMessage(this, sink, msg));
                }
            }

            return(sink.SyncProcessMessage(msg));
        }