public static IBusinessOperation CreateBusinessOperationObject(string profile, string name) { if (!classMaps.ContainsKey(name)) { throw new ArgumentNullException(String.Format("Operation not found [{0}]", name)); } PluginEntry entry = classMaps[name]; Assembly asm = Assembly.Load(entry.Asm.GetName()); IBusinessOperation obj = (IBusinessOperation)asm.CreateInstance(entry.Fqdn); ContextGroup grp = GetContextGroup(profile); obj.SetNoSqlContext(grp.NoSqlContext); obj.SetStorageContext(grp.StorageContext); obj.SetSmtpContext(grp.SmtpContext); obj.SetDatabaseContext(grp.DatabaseContext); if (loggerFactory != null) { Type t = obj.GetType(); ILogger logger = loggerFactory.CreateLogger(t); obj.SetLogger(logger); } return(obj); }
private static ContextGroup GetContextGroup(string profile) { ContextGroup grp = null; if (contextProfiles.Contains(profile)) { grp = (ContextGroup)contextProfiles[profile]; } else { grp = new ContextGroup(); contextProfiles[profile] = grp; } return(grp); }
public static void SetNoSqlContext(string profile, INoSqlContext ctx) { ContextGroup grp = GetContextGroup(profile); grp.NoSqlContext = ctx; }
public static void SetNoSqlContext(INoSqlContext ctx) { ContextGroup grp = GetContextGroup(FactoryContextUtils.DefaultProfileName); grp.NoSqlContext = ctx; }
public static INoSqlContext GetNoSqlContext(string profile) { ContextGroup grp = GetContextGroup(profile); return(grp.NoSqlContext); }
public static INoSqlContext GetNoSqlContext() { ContextGroup grp = GetContextGroup(FactoryContextUtils.DefaultProfileName); return(grp.NoSqlContext); }
public static void SetDatabaseContext(string profile, BaseDbContext ctx) { ContextGroup grp = GetContextGroup(profile); grp.DatabaseContext = ctx; }
public static BaseDbContext GetDatabaseContext(string profile) { ContextGroup grp = GetContextGroup(profile); return(grp.DatabaseContext); }
public static void SetDatabaseContext(BaseDbContext ctx) { ContextGroup grp = GetContextGroup(FactoryContextUtils.DefaultProfileName); grp.DatabaseContext = ctx; }
public static BaseDbContext GetDatabaseContext() { ContextGroup grp = GetContextGroup(FactoryContextUtils.DefaultProfileName); return(grp.DatabaseContext); }
public static void SetSmtpContext(string profile, ISmtpContext ctx) { ContextGroup grp = GetContextGroup(profile); grp.SmtpContext = ctx; }
public static ISmtpContext GetSmtpContext(string profile) { ContextGroup grp = GetContextGroup(profile); return(grp.SmtpContext); }
public static void SetStorageContext(IStorageContext ctx) { ContextGroup grp = GetContextGroup(FactoryContextUtils.DefaultProfileName); grp.StorageContext = ctx; }
public static IStorageContext GetStorageContext() { ContextGroup grp = GetContextGroup(FactoryContextUtils.DefaultProfileName); return(grp.StorageContext); }