예제 #1
0
        public void Invoke(ReceivePhysicalMessageContext context, Action next)
        {
            context.PhysicalMessage.Headers[Headers.HasLicenseExpired] = LicenseExpired.ToString().ToLower();

            next();

            if (Debugger.IsAttached)
            {
                if (LicenseManager.HasLicenseExpired())
                {
                    Log.Error("Your license has expired");
                }
            }
        }
예제 #2
0
        public void Init()
        {
            var expiredLicense = true;

            try
            {
                LicenseManager.InitializeLicense();

                expiredLicense = LicenseManager.HasLicenseExpired();
            }
            catch (Exception ex)
            {
                //we only log here to prevent licensing issue to abort startup and cause production outages
                Logger.Fatal("Failed to initialize the license", ex);
            }


            Configure.Component <LicenseBehavior>(DependencyLifecycle.InstancePerCall)
            .ConfigureProperty(p => p.LicenseExpired, expiredLicense);
        }