protected virtual void DoModuleAfterInitApplication()
        {
            const string FROM = INIT_FROM + ".mod";

            if (m_Module != null)
            {
                WriteLog(MessageType.Trace, FROM, "Call module root DI and .ApplicationAfterInit()");
                try
                {
                    this.DependencyInjector.InjectInto(m_Module);
                }
                catch (Exception error)
                {
                    var msg = "Error performing DI into module root:" + error.ToMessageWithType();
                    WriteLog(MessageType.CatastrophicError, FROM, msg, error);
                    throw new AzosException(msg, error);
                }
                try
                {
                    m_Module.ApplicationAfterInit();
                }
                catch (Exception error)
                {
                    var msg = "Error in call module root .ApplicationAfterInit()" + error.ToMessageWithType();
                    WriteLog(MessageType.CatastrophicError, FROM, msg, error);
                    throw new AzosException(msg, error);
                }
            }

            WriteLog(MessageType.Trace, FROM, "Common application initialized in '{0}' time location".Args(this.TimeLocation));

            var related = WriteLog(MessageType.Trace, FROM, "Component dump:");

            foreach (var cmp in ApplicationComponent.AllComponents(this))
            {
                WriteLog(MessageType.Info,
                         FROM,
                         "  -> Component: {0}  '{1}'  '{2}' ".Args(cmp.ComponentSID, cmp.GetType().FullName, cmp.ComponentCommonName),
                         related: related);
            }
        }
Example #2
0
 /// <summary>
 /// Returns an existing application component instance by its ComponentCommonName or null. The search is case-insensitive
 /// </summary>
 public IApplicationComponent GetComponentByCommonName(string name)
 {
     return(ApplicationComponent.GetAppComponentByCommonName(this, name));
 }
Example #3
0
 /// <summary>
 /// Returns a component by SID or null
 /// </summary>
 public IApplicationComponent GetComponentBySID(ulong sid)
 {
     return(ApplicationComponent.GetAppComponentBySID(this, sid));
 }
Example #4
0
 /// <summary>
 /// Returns an existing application component instance by its ComponentCommonName or null. The search is case-insensitive
 /// </summary>
 public IApplicationComponent GetComponentByCommonName(string name)
 => ApplicationComponent.GetAppComponentByCommonName(this, name);
Example #5
0
 /// <summary>
 /// Returns a component by SID or null
 /// </summary>
 public IApplicationComponent GetComponentBySID(ulong sid)
 => ApplicationComponent.GetAppComponentBySID(this, sid);