Exemplo n.º 1
0
        public void Register(IAppHost appHost)
        {
            Init();
            ConfigInfoHandler.RegisterConfigInfoOwner(this);

            if (!Enabled)
            {
                return;
            }

            if (_serviceEnabledMap.Values.Count(enabled => enabled) == 0)
            {
                return;
            }

            _log = LogManager.GetLogger(typeof(DynamicPolicyPlugin));

            SyncDynamicSettings(null, null);
            var mTimer = new Timer();

            mTimer.Interval  = PolicyServiceSyncInterval;//一分钟一次
            mTimer.Enabled   = true;
            mTimer.AutoReset = true;
            mTimer.Elapsed  += new ElapsedEventHandler(SyncDynamicSettings);
        }
Exemplo n.º 2
0
 public virtual void Register(IAppHost appHost)
 {
     Init();
     appHost.PreRequestFilters.Add(FilterWhiteList);
     ConfigInfoHandler.RegisterConfigInfoOwner(this);
 }
Exemplo n.º 3
0
 public void Register(IAppHost appHost)
 {
     Init();
     appHost.PreRequestFilters.Add(CheckRateLimiting);
     ConfigInfoHandler.RegisterConfigInfoOwner(this);
 }
Exemplo n.º 4
0
 public void Register(IAppHost appHost)
 {
     ConfigInfoHandler.RegisterConfigInfoOwner(this);
 }
Exemplo n.º 5
0
 public void Register(IAppHost appHost)
 {
     Init();
     ConfigInfoHandler.RegisterConfigInfoOwner(this);
     appHost.PreRequestFilters.Add(FilterCrossDomain);
 }