public PluginService(IPluginDataService pluginDataService, IPackageInstaller packageInstaller, ILog logger, IDexterContainer container) { this.pluginDataService = pluginDataService; this.packageInstaller = packageInstaller; this.logger = logger; this.container = container; }
public void ServiceRegistrationComplete(IDexterContainer container) { Mapper.CreateMap<DateTimeOffset, DateTime>().ConvertUsing<DateTimeTypeConverter>(); Mapper.CreateMap<Uri, string>().ConvertUsing<UriToStringTypeConverter>(); Mapper.CreateMap<string, Uri>().ConvertUsing<StringToUriTypeConverter>(); Mapper.CreateMap<string, MailAddress>().ConvertUsing<MailAddressypeConverter>(); }
public void ServiceRegistration(IDexterContainer container) { container.Register <ICallContextFactory, DexterCallContextFactory>(LifeCycle.Singleton); container.Register <IAsyncCallContext, AsyncCallContext>(LifeCycle.Singleton); container.Register <IWebCallContext, WebCallContext>(LifeCycle.Singleton); container.Register <ITaskExecutor, TaskExecutor.TaskExecutor>(LifeCycle.Singleton); }
public void ServiceRegistration(IDexterContainer container) { container.Register<ICallContextFactory, DexterCallContextFactory>(LifeCycle.Singleton); container.Register<IAsyncCallContext, AsyncCallContext>(LifeCycle.Singleton); container.Register<IWebCallContext, WebCallContext>(LifeCycle.Singleton); container.Register<ITaskExecutor, TaskExecutor.TaskExecutor>(LifeCycle.Singleton); }
/// <summary> /// Installs all the component needed by the assembly. /// </summary> /// <param name="container"> The container. </param> public void ServiceRegistration(IDexterContainer container) { container.Register <IHttpModule, PerWebRequestLifestyleModule>(LifeCycle.Singleton); container.Register <IDependencyResolver, DexterDependencyResolver>(LifeCycle.Singleton); container.Register <System.Web.Http.Dependencies.IDependencyResolver, Web.WebApi.DexterDependencyResolver>(LifeCycle.Singleton); container.Register <IHttpControllerActivator, Web.WebApi.DexterHttpControllerActivator>(LifeCycle.Singleton); }
public PluginService(IPluginDataService pluginDataService, IPackageInstaller packageInstaller, ILog logger, IDexterContainer container) { this.pluginDataService = pluginDataService; this.packageInstaller = packageInstaller; this.logger = logger; this.container = container; }
/// <summary> /// Installs all the component needed by the assembly. /// </summary> /// <param name="container"> The container. </param> public void ServiceRegistration(IDexterContainer container) { container.Register<IHttpModule, PerWebRequestLifestyleModule>(LifeCycle.Singleton); container.Register<IDependencyResolver, DexterDependencyResolver>(LifeCycle.Singleton); container.Register<System.Web.Http.Dependencies.IDependencyResolver, Web.WebApi.DexterDependencyResolver>(LifeCycle.Singleton); container.Register<IHttpControllerActivator, Web.WebApi.DexterHttpControllerActivator>(LifeCycle.Singleton); }
public void ServiceRegistrationComplete(IDexterContainer container) { Mapper.CreateMap <DateTimeOffset, DateTime>().ConvertUsing <DateTimeTypeConverter>(); Mapper.CreateMap <Uri, string>().ConvertUsing <UriToStringTypeConverter>(); Mapper.CreateMap <string, Uri>().ConvertUsing <StringToUriTypeConverter>(); Mapper.CreateMap <string, MailAddress>().ConvertUsing <MailAddressypeConverter>(); }
public void ServiceRegistrationComplete(IDexterContainer container) { container.Resolve <IScheduler>().StartDelayed(TimeSpan.FromSeconds(10)); container.RegisterMinutesIntervalJob <EmailNotificationJob>(5); container.RegisterMinutesIntervalJob <PluginUpdateJob>(5); container.RegisterDailyJob <PluginUpdateJob>(TimeOfDay.HourAndMinuteOfDay(01, 30)); }
public void ServiceRegistrationComplete(IDexterContainer container) { container.Resolve<IScheduler>().StartDelayed(TimeSpan.FromSeconds(10)); container.RegisterMinutesIntervalJob<EmailNotificationJob>(5); container.RegisterMinutesIntervalJob<PluginUpdateJob>(5); container.RegisterDailyJob<PluginUpdateJob>(TimeOfDay.HourAndMinuteOfDay(01, 30)); }
public void ApplicationStarted(IDexterContainer container) { GlobalConfiguration.Configuration.Formatters.Add(new SyndicationFeedFormatter()); // Configure json response JsonMediaTypeFormatter json = GlobalConfiguration.Configuration.Formatters.JsonFormatter; json.SerializerSettings.NullValueHandling = NullValueHandling.Ignore; json.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); }
public static void SetCurrent(IDexterContainer newEngine) { if (Engine != null) { Engine.Shutdown(); } Engine = newEngine; }
public void ServiceRegistration(IDexterContainer container) { container.Register<IPostService, PostService>(LifeCycle.Singleton); container.Register<IPageService, PageService>(LifeCycle.Singleton); container.Register<IConfigurationService, ConfigurationService>(LifeCycle.Singleton); container.Register<ICommentService, CommentService>(LifeCycle.Singleton); container.Register<ISetupService, SetupService>(LifeCycle.Singleton); container.Register<ICategoryService, CategoryService>(LifeCycle.Singleton); container.Register<IPluginService, PluginService>(LifeCycle.Singleton); }
public void ApplicationStarted(IDexterContainer container) { GlobalConfiguration.Configuration.Formatters.Add(new SyndicationFeedFormatter()); // Configure json response JsonMediaTypeFormatter json = GlobalConfiguration.Configuration.Formatters.JsonFormatter; json.SerializerSettings.NullValueHandling = NullValueHandling.Ignore; json.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); }
public void ServiceRegistration(IDexterContainer container) { container.Register <IPostService, PostService>(LifeCycle.Singleton); container.Register <IPageService, PageService>(LifeCycle.Singleton); container.Register <IConfigurationService, ConfigurationService>(LifeCycle.Singleton); container.Register <ICommentService, CommentService>(LifeCycle.Singleton); container.Register <ISetupService, SetupService>(LifeCycle.Singleton); container.Register <ICategoryService, CategoryService>(LifeCycle.Singleton); container.Register <IPluginService, PluginService>(LifeCycle.Singleton); }
public void ServiceRegistration(IDexterContainer container) { container.Register<IJobFactory, DexterJobFactory>(LifeCycle.Singleton); StdSchedulerFactory stdSchedulerFactory = new StdSchedulerFactory(); IScheduler scheduler = stdSchedulerFactory.GetScheduler(); scheduler.JobFactory = container.Resolve<IJobFactory>(); container.Register(typeof(ISchedulerFactory), stdSchedulerFactory, LifeCycle.Singleton); container.Register(typeof(IScheduler), scheduler, LifeCycle.Singleton); }
public void ServiceRegistration(IDexterContainer container) { container.Register <IJobFactory, DexterJobFactory>(LifeCycle.Singleton); StdSchedulerFactory stdSchedulerFactory = new StdSchedulerFactory(); IScheduler scheduler = stdSchedulerFactory.GetScheduler(); scheduler.JobFactory = container.Resolve <IJobFactory>(); container.Register(typeof(ISchedulerFactory), stdSchedulerFactory, LifeCycle.Singleton); container.Register(typeof(IScheduler), scheduler, LifeCycle.Singleton); }
public void ApplicationStarted(IDexterContainer container) { IScheduler scheduler = container.Resolve<IScheduler>(); IJobListener[] jobListeners = container.ResolveAll<IJobListener>(); foreach (IJobListener jobListener in jobListeners) { scheduler.ListenerManager.AddJobListener(jobListener); } scheduler.Start(); }
public void ApplicationStarted(IDexterContainer container) { IScheduler scheduler = container.Resolve <IScheduler>(); IJobListener[] jobListeners = container.ResolveAll <IJobListener>(); foreach (IJobListener jobListener in jobListeners) { scheduler.ListenerManager.AddJobListener(jobListener); } scheduler.Start(); }
public void ServiceRegistration(IDexterContainer container) { container.Register <IUrlBuilder, UrlBuilder>(LifeCycle.Singleton); container.Register <IAdminUrlBuilder, AdminUrlBuilder>(LifeCycle.Singleton); container.Register <IPostUrlBuilder, PostUrlBuilder>(LifeCycle.Singleton); container.Register <IPageUrlBuilder, PageUrlBuilder>(LifeCycle.Singleton); container.Register <ICategoryUrlBuilder, CategoryUrlBuilder>(LifeCycle.Singleton); container.Register <IAdminPageUrlBuilder, AdminPageUrlBuilder>(LifeCycle.Singleton); container.Register <IAdminPostUrlBuilder, AdminPostUrlBuilder>(LifeCycle.Singleton); container.Register <IAdminCategoryUrlBuilder, AdminCategoryUrlBuilder>(LifeCycle.Singleton); container.Register <IAdminAccountUrlBuilder, AdminAccountUrlBuilder>(LifeCycle.Singleton); container.Register <IFeedUrlBuilder, FeedUrlBuilder>(LifeCycle.Singleton); container.Register <IServiceUrlBuilder, ServiceUrlBuilder>(LifeCycle.Singleton); }
public void ServiceRegistration(IDexterContainer container) { container.Register<IUrlBuilder, UrlBuilder>(LifeCycle.Singleton); container.Register<IAdminUrlBuilder, AdminUrlBuilder>(LifeCycle.Singleton); container.Register<IPostUrlBuilder, PostUrlBuilder>(LifeCycle.Singleton); container.Register<IPageUrlBuilder, PageUrlBuilder>(LifeCycle.Singleton); container.Register<ICategoryUrlBuilder, CategoryUrlBuilder>(LifeCycle.Singleton); container.Register<IAdminPageUrlBuilder, AdminPageUrlBuilder>(LifeCycle.Singleton); container.Register<IAdminPostUrlBuilder, AdminPostUrlBuilder>(LifeCycle.Singleton); container.Register<IAdminCategoryUrlBuilder, AdminCategoryUrlBuilder>(LifeCycle.Singleton); container.Register<IAdminAccountUrlBuilder, AdminAccountUrlBuilder>(LifeCycle.Singleton); container.Register<IFeedUrlBuilder, FeedUrlBuilder>(LifeCycle.Singleton); container.Register<IServiceUrlBuilder, ServiceUrlBuilder>(LifeCycle.Singleton); }
public static void RegisterDaysOfTheWeekJob <T>(this IDexterContainer container, TimeOfDay timeOf, bool enabled = true) where T : IJob { string triggerName = string.Format("{0}_For_{1}_", timeOf, typeof(T).Name); ITrigger trigger = TriggerBuilder.Create() .WithDailyTimeIntervalSchedule(x => x.OnDaysOfTheWeek().StartingDailyAt(timeOf).WithMisfireHandlingInstructionFireAndProceed()) .WithIdentity(triggerName) .Build(); IJobDetail job = JobBuilder.Create <T>() .WithIdentity(typeof(T).Name) .Build(); Register <T>(container, job, trigger, enabled); }
public static void RegisterCronJob <T>(this IDexterContainer container, string cronPattern, bool enabled = true) where T : IJob { string triggerName = string.Format("{0}_For_{1}_", cronPattern, typeof(T).Name); ITrigger trigger = TriggerBuilder.Create() .WithCronSchedule(cronPattern) .WithIdentity(triggerName) .Build(); IJobDetail job = JobBuilder.Create <T>() .WithIdentity(typeof(T).Name) .Build(); Register <T>(container, job, trigger, enabled); }
private static void RegisterSeconds <T>(IDexterContainer container, int seconds, bool enabled) where T : IJob { string triggerName = string.Format("{0}_Seconds_Trigger_For_{1}", seconds, typeof(T).Name); ITrigger trigger = TriggerBuilder.Create() .WithSimpleSchedule(x => x.WithIntervalInSeconds(seconds).WithMisfireHandlingInstructionFireNow().RepeatForever()) .WithIdentity(triggerName) .Build(); IJobDetail job = JobBuilder.Create <T>() .WithIdentity(typeof(T).Name) .Build(); Register <T>(container, job, trigger, enabled); }
public void ServiceRegistration(IDexterContainer container) { container.Register<IPostDataService, PostDataService>(LifeCycle.Singleton); container.Register<IPageDataService, PageDataService>(LifeCycle.Singleton); container.Register<ICommentDataService, CommentDataService>(LifeCycle.Singleton); container.Register<IConfigurationDataService, ConfigurationDataService>(LifeCycle.Singleton); container.Register<ICategoryDataService, CategoryDataService>(LifeCycle.Singleton); container.Register<IDexterCall, DexterCall>(LifeCycle.Singleton); container.Register<ISessionFactory, SessionFactory>(LifeCycle.Singleton); container.Register<IPluginDataService, PluginDataService>(LifeCycle.Singleton); container.Register<IRepositoryFactory, RepositoryFactory>(LifeCycle.Singleton); this.InitializeDocumentStore(); container.Register(typeof(IDocumentStore), store, LifeCycle.Singleton); }
public void ServiceRegistration(IDexterContainer container) { container.Register <IPostDataService, PostDataService>(LifeCycle.Singleton); container.Register <IPageDataService, PageDataService>(LifeCycle.Singleton); container.Register <ICommentDataService, CommentDataService>(LifeCycle.Singleton); container.Register <IConfigurationDataService, ConfigurationDataService>(LifeCycle.Singleton); container.Register <ICategoryDataService, CategoryDataService>(LifeCycle.Singleton); container.Register <IDexterCall, DexterCall>(LifeCycle.Singleton); container.Register <ISessionFactory, SessionFactory>(LifeCycle.Singleton); container.Register <IPluginDataService, PluginDataService>(LifeCycle.Singleton); container.Register <IRepositoryFactory, RepositoryFactory>(LifeCycle.Singleton); this.InitializeDocumentStore(); container.Register(typeof(IDocumentStore), store, LifeCycle.Singleton); }
/// <summary> /// Initializes a new instance of the <see cref="T:System.Web.HttpApplication"/> class. /// </summary> public DexterApplication() { this.logger = LogManager.GetCurrentClassLogger(); DexterContainer.StartUp(); this.container = DexterContainer.Resolve <IDexterContainer>(); this.dexterCall = DexterContainer.Resolve <IDexterCall>(); this.routingService = DexterContainer.Resolve <IRoutingService>(); this.taskExecutor = DexterContainer.Resolve <ITaskExecutor>(); this.pluginService = DexterContainer.Resolve <IPluginService>(); this.pluginService.LoadAllEnabledPlugins(); base.BeginRequest += (o, args) => this.BeginRequest(); base.EndRequest += (o, args) => this.EndRequest(); this.Init(); }
/// <summary> /// Starts up. /// </summary> public static void StartUp() { if (started) { return; } ReadOnlyCollection <Assembly> alpAssemblies = new ReadOnlyCollection <Assembly>(BuildManager.GetReferencedAssemblies().Cast <Assembly>().Where(x => x.FullName.StartsWith("Dexter")).ToList()); Type containerType = null; foreach (Assembly a in alpAssemblies) { foreach (Type t in a.GetTypes()) { if (!t.IsInterface && !t.IsAbstract && typeof(IDexterContainerFactory).IsAssignableFrom(t)) { containerType = t; } } } if (containerType == null) { throw new ArgumentException("Unable to find the DI Implementation."); } IDexterContainerFactory factory = Activator.CreateInstance(containerType) as IDexterContainerFactory; if (factory == null) { throw new ConfigurationErrorsException(string.Format("The type {0} does not implement the IDexterContainerFactory interface.", containerType.FullName)); } Engine = factory.Create(); Engine.Register(typeof(IDexterContainer), Engine, LifeCycle.Singleton); alpAssemblies.ForEach(x => Engine.Register <ILayerInstaller>(x, LifeCycle.Singleton)); ILayerInstaller[] coreInstaller = Engine.ResolveAll <ILayerInstaller>(); coreInstaller.ForEach(x => x.ServiceRegistration(Engine)); coreInstaller.ForEach(x => x.ServiceRegistrationComplete(Engine)); coreInstaller.ForEach(x => x.ApplicationStarted(Engine)); started = true; }
private static void Register <T>(IDexterContainer container, IJobDetail job, ITrigger trigger, bool enabled) { IScheduler scheduler = container.Resolve <IScheduler>(); if (scheduler.CheckExists(job.Key) == false) { scheduler.ScheduleJob(job, trigger); } else { if (!enabled) { IList <ITrigger> dbTrigger = scheduler.GetTriggersOfJob(job.Key); scheduler.UnscheduleJobs(dbTrigger.Select(x => x.Key).ToList()); } else { scheduler.RescheduleJob(trigger.Key, trigger); } } container.Register(typeof(T), typeof(T), LifeCycle.Transient); }
public void ServiceRegistration(IDexterContainer container) { container.RegisterComponentsByBaseClass<Controller>(this.GetType().Assembly, LifeCycle.Transient); container.RegisterComponentsByBaseClass<System.Web.Http.Controllers.IHttpController>(this.GetType().Assembly, LifeCycle.Transient); }
public void ServiceRegistration(IDexterContainer container) { container.Register<ILocalizationProvider, LocalizationProvider>(LifeCycle.Singleton); }
public void ServiceRegistration(IDexterContainer container) { container.Register<IUserContext, UserContext.UserContext>(LifeCycle.Singleton); }
public void ServiceRegistration(IDexterContainer container) { container.Register <FilterAttribute, ExceptionHandlingAttribute>(LifeCycle.Singleton); }
public void ServiceRegistration(IDexterContainer container) { container.Register<FilterAttribute, ExceptionHandlingAttribute>(LifeCycle.Singleton); }
public void ServiceRegistration(IDexterContainer container) { container.Register<IRoutingService, RoutingService>(LifeCycle.Singleton); }
public DexterDependencyResolver(IDexterContainer container) { this.container = container; }
/// <summary> /// Installs all the component needed by the assembly. /// </summary> /// <param name="container"> The container. </param> public void ServiceRegistration(IDexterContainer container) { container.Register<ICacheProvider, InProcCacheProvider>(LifeCycle.PerWebRequest); }
public void ApplicationStarted(IDexterContainer container) { this.InitializeRavenProfiler(); }
public void ServiceRegistration(IDexterContainer container) { container.Register <IUserContext, UserContext.UserContext>(LifeCycle.Singleton); }
/// <summary> /// Initializes a new instance of the <see cref="T:System.Web.Mvc.DefaultControllerFactory" /> class using a controller activator. /// </summary> /// <param name="controllerActivator"> An object that implements the controller activator interface. </param> /// <param name="logger"> The logger. </param> /// <param name="container"> The container. </param> public DexterControllerFactory(IControllerActivator controllerActivator, ILog logger, IDexterContainer container) : base(controllerActivator) { this.logger = logger; this.container = container; }
public DexterDependencyResolver(IDexterContainer container) { this.container = container; }
public void ServiceRegistrationComplete(IDexterContainer container) { BuildingBlocks.Membership.RepositoryFactory.Initialize(container.Resolve<IRepositoryFactory>()); AutoMapperConfiguration.Configure(); }
public void ServiceRegistration(IDexterContainer container) { container.Register<IPackageManager, PackageManager>(LifeCycle.Singleton); container.Register<IPackageInstaller, Services.PackageInstaller>(LifeCycle.Singleton); }
public void ServiceRegistrationComplete(IDexterContainer container) { AutoMapperConfiguration.Configure(); }
/// <summary> /// Initializes a new instance of the <see cref="T:System.Web.Mvc.DefaultControllerFactory" /> class. /// </summary> /// <param name="logger"> The logger. </param> /// <param name="container"> The container. </param> public DexterControllerFactory(ILog logger, IDexterContainer container) { this.logger = logger; this.container = container; }
/// <summary> /// Initializes a new instance of the <see cref="T:System.Web.Mvc.DefaultControllerFactory" /> class. /// </summary> /// <param name="logger"> The logger. </param> /// <param name="container"> The container. </param> public DexterControllerFactory(ILog logger, IDexterContainer container) { this.logger = logger; this.container = container; }
/// <summary> /// Initializes a new instance of the <see cref="T:System.Web.Mvc.DefaultControllerFactory" /> class using a controller activator. /// </summary> /// <param name="controllerActivator"> An object that implements the controller activator interface. </param> /// <param name="logger"> The logger. </param> /// <param name="container"> The container. </param> public DexterControllerFactory(IControllerActivator controllerActivator, ILog logger, IDexterContainer container) : base(controllerActivator) { this.logger = logger; this.container = container; }
public void ApplicationStarted(IDexterContainer container) { }
/// <summary> /// Installs all the component needed by the assembly. /// </summary> /// <param name="container"> The container. </param> public void ServiceRegistration(IDexterContainer container) { container.Register <ICacheProvider, InProcCacheProvider>(LifeCycle.PerWebRequest); }
public void ServiceRegistrationComplete(IDexterContainer container) { }
/// <summary> /// Initializes a new instance of the <see cref="DexterJobFactory"/> class. /// </summary> /// <param name="container">The container.</param> /// <param name="logger">The logger.</param> public DexterJobFactory(IDexterContainer container, ILog logger) { this.container = container; this.logger = logger; }
public DexterControllerActivator(IDexterContainer container) { this.container = container; }
public void ServiceRegistration(IDexterContainer container) { container.RegisterComponentsByBaseClass <Controller>(this.GetType().Assembly, LifeCycle.Transient); container.RegisterComponentsByBaseClass <System.Web.Http.Controllers.IHttpController>(this.GetType().Assembly, LifeCycle.Transient); }
public void ServiceRegistration(IDexterContainer container) { }
public DexterControllerActivator(IDexterContainer container) { this.container = container; }
public void ApplicationStarted(IDexterContainer container) { }
/// <summary> /// Initializes a new instance of the <see cref="T:System.Object" /> class. /// </summary> public DexterHttpControllerActivator(IDexterContainer container, ILog logger) { this.container = container; this.logger = logger; }
public void ServiceRegistrationComplete(IDexterContainer container) { AutoMapperConfiguration.Configure(); }
/// <summary> /// Initializes a new instance of the <see cref="DexterJobFactory"/> class. /// </summary> /// <param name="container">The container.</param> /// <param name="logger">The logger.</param> public DexterJobFactory(IDexterContainer container, ILog logger) { this.container = container; this.logger = logger; }