Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        public static void SetNoSqlContext(string profile, INoSqlContext ctx)
        {
            ContextGroup grp = GetContextGroup(profile);

            grp.NoSqlContext = ctx;
        }
Example #4
0
        public static void SetNoSqlContext(INoSqlContext ctx)
        {
            ContextGroup grp = GetContextGroup(FactoryContextUtils.DefaultProfileName);

            grp.NoSqlContext = ctx;
        }
Example #5
0
        public static INoSqlContext GetNoSqlContext(string profile)
        {
            ContextGroup grp = GetContextGroup(profile);

            return(grp.NoSqlContext);
        }
Example #6
0
        public static INoSqlContext GetNoSqlContext()
        {
            ContextGroup grp = GetContextGroup(FactoryContextUtils.DefaultProfileName);

            return(grp.NoSqlContext);
        }
Example #7
0
        public static void SetDatabaseContext(string profile, BaseDbContext ctx)
        {
            ContextGroup grp = GetContextGroup(profile);

            grp.DatabaseContext = ctx;
        }
Example #8
0
        public static BaseDbContext GetDatabaseContext(string profile)
        {
            ContextGroup grp = GetContextGroup(profile);

            return(grp.DatabaseContext);
        }
Example #9
0
        public static void SetDatabaseContext(BaseDbContext ctx)
        {
            ContextGroup grp = GetContextGroup(FactoryContextUtils.DefaultProfileName);

            grp.DatabaseContext = ctx;
        }
Example #10
0
        public static BaseDbContext GetDatabaseContext()
        {
            ContextGroup grp = GetContextGroup(FactoryContextUtils.DefaultProfileName);

            return(grp.DatabaseContext);
        }
Example #11
0
        public static void SetSmtpContext(string profile, ISmtpContext ctx)
        {
            ContextGroup grp = GetContextGroup(profile);

            grp.SmtpContext = ctx;
        }
Example #12
0
        public static ISmtpContext GetSmtpContext(string profile)
        {
            ContextGroup grp = GetContextGroup(profile);

            return(grp.SmtpContext);
        }
Example #13
0
        public static void SetStorageContext(IStorageContext ctx)
        {
            ContextGroup grp = GetContextGroup(FactoryContextUtils.DefaultProfileName);

            grp.StorageContext = ctx;
        }
Example #14
0
        public static IStorageContext GetStorageContext()
        {
            ContextGroup grp = GetContextGroup(FactoryContextUtils.DefaultProfileName);

            return(grp.StorageContext);
        }