Ejemplo n.º 1
0
        public void TestSinkFactory()
        {
            IAOPConfig cfg = AOPConfig.AOPConfiguration;
            Type       t   = cfg.LoadSinkFactory();

            Assert.AreEqual(typeof(RexToy.AOP.Services.ServiceSinkFactory), t);
        }
Ejemplo n.º 2
0
        static SinkContext()
        {
            IAOPConfig cfg     = AOPConfig.AOPConfiguration;
            Type       factory = cfg.LoadSinkFactory();

            if (factory == null)
            {
                _instance = new DefaultSinkFactory();
            }
            else
            {
                _instance = (ISinkFactory)Activator.CreateInstance(factory);
            }
        }
Ejemplo n.º 3
0
        public void ReadConfig()
        {
            IAOPConfig cfg = AOPConfig.AOPConfiguration;
            XDoc       doc = XDoc.LoadFromFile(cfg.LoadAOPInfoPath());

            var xAdvisors = doc.NavigateToList(ADVISOR);

            foreach (var xAdvisor in xAdvisors)
            {
                string name = xAdvisor.GetStringValue(NAME_ATTR);
                Type   type = Reflector.LoadType(xAdvisor.GetStringValue(CLASS));
                _advisors.Add(name, type);
            }

            var xJoinPoints = doc.NavigateToList(JOIN_POINT);

            foreach (var xJoinPoint in xJoinPoints)
            {
                Position position    = EnumEx.Parse <Position>(xJoinPoint.GetStringValue(POSITION), true);
                string   pattern     = xJoinPoint.GetStringValue(PATTERN);
                string   advisorName = xJoinPoint.GetStringValue(EXECUTE);
                _jointPointDefinations.Add(new JoinPointDefination(position, advisorName, pattern));
            }
        }
Ejemplo n.º 4
0
        public void TestGetPath()
        {
            IAOPConfig cfg = AOPConfig.AOPConfiguration;

            Assert.AreEqual(Runtime.GetPath(@".\aop.xml"), cfg.LoadAOPInfoPath());
        }
Ejemplo n.º 5
0
 public static void Initialize(IAOPConfig aop_cfg)
 {
     _aop_cfg = aop_cfg;
 }
Ejemplo n.º 6
0
 public static void Initialize(IAOPConfig aop_cfg)
 {
     _aop_cfg = aop_cfg;
 }