private object GetLocalService( string sAppName, string sServiceName, string sServiceInstanceName) { // Validate sAppName if (!StringUtil.IsStringInitialized(sAppName)) { ExceptionUtil.RaiseArgumentNullException( "sAppName", "sAppName parameter must be initialized", MethodInfo.GetCurrentMethod()); } // Validate sServiceName if (!StringUtil.IsStringInitialized(sServiceName)) { ExceptionUtil.RaiseArgumentNullException( "sServiceName", "sServiceName parameter must be initialized", MethodInfo.GetCurrentMethod()); } // Validate sServiceInstanceName if (!StringUtil.IsStringInitialized(sServiceInstanceName)) { ExceptionUtil.RaiseArgumentNullException( "sServiceInstanceName", "sServiceInstanceName parameter must be initialized", MethodInfo.GetCurrentMethod()); } ITisServiceProvider oServiceProvider = null; // Get service provider for the application oServiceProvider = m_oServiceProvidersCache.GetServiceProvider(sAppName); ITisServiceInfo oServiceInfo = CheckedGetServiceInfo(sAppName, sServiceName); // Create service key TisServiceKey oKey = new TisServiceKey( sServiceName, sServiceInstanceName, oServiceInfo); object oService = oServiceProvider.GetService( oKey); return(oService); }
// // Protected // protected object ServicesCache_OnCacheMiss( object oSender, CacheMissEventArgs oArgs) { TisServiceKey oServiceKey = (TisServiceKey)oArgs.Key; //Log.Write( // Log.Severity.DETAILED_DEBUG, // System.Reflection.MethodInfo.GetCurrentMethod(), // "Activating service [{0}] in App [{1}], ServiceCache: {2}", // oServiceKey, // m_sAppName, // GetHashCode()); // Return the service object from real service provider object oObj = m_oServicesActivator.GetService(oServiceKey); if (m_oServicesCache.GetCached(oServiceKey) != null) { return(null); } // Fire pre-activate event FirePreServiceActivate(oServiceKey); if (!m_bDisposing) { // Keep load order UpdateLoadOrder(oServiceKey); } // Fire post-activate event FirePostServiceActivate(oServiceKey, oObj); return(oObj); }