public LoginViewModel(IEventAggregator messageBus) { _messageBus = messageBus; LoginCommand = new DelegateCommand <object>(Login); _serviceFacade = ((ServiceLocator)App.Current.Resources["ServiceLocator"]).ServiceFacade; _serviceFacade.LoginCompletedEvent += new EventHandler <HsrOrderApp.UI.Silverlight.AuthenticationService.LoginCompletedEventArgs>(LoginViewModel_LoginCompletedEvent); }
/** * Verify the correct getLocale() behavior for the given service. * @param requestedLocale the locale to request. This MUST BE * FAKE. In other words, it should be something like * en_US_FAKEVARIANT so this method can verify correct fallback * behavior. * @param svc a factory object that can create the object to be * tested. * @param sub an object that can be used to retrieve a subobject * which should also be tested. May be null. * @param reg an object that supplies the registration and * unregistration functionality to be tested. May be null. */ internal void CheckService(String requestedLocale, IServiceFacade svc, ISubobject sub, IRegistrar reg) { UCultureInfo req = new UCultureInfo(requestedLocale); Object obj = svc.Create(req); CheckObject(requestedLocale, obj, "gt", "ge"); if (sub != null) { Object subobj = sub.Get(obj); CheckObject(requestedLocale, subobj, "gt", "ge"); } if (reg != null) { Logln("Info: Registering service"); Object key = reg.Register(req, obj); Object objReg = svc.Create(req); CheckObject(requestedLocale, objReg, "eq", "eq"); if (sub != null) { Object subobj = sub.Get(obj); // Assume subobjects don't come from services, so // their metadata should be structured normally. CheckObject(requestedLocale, subobj, "gt", "ge"); } Logln("Info: Unregistering service"); if (!reg.Unregister(key)) { Errln("FAIL: unregister failed"); } Object objUnreg = svc.Create(req); CheckObject(requestedLocale, objUnreg, "gt", "ge"); } }
/// <summary> /// Registers the configuration /// </summary> public static IContainer Register(IAppBuilder app, HttpConfiguration configuration, IServiceFacade serviceFacade = null) { Condition.Requires(configuration, "configuration").IsNotNull(); var builder = new ContainerBuilder(); builder.RegisterModule(new ServiceModule(serviceFacade)); // controllers builder.RegisterApiControllers(typeof (ControllerBase).Assembly); // request builder.RegisterHttpRequestMessage(configuration); // authorization builder.RegisterType<AuthorizationServerProvider>().As<IOAuthAuthorizationServerProvider>().SingleInstance(); // set resolver var container = builder.Build(); // set the dependency resolver for Web API var resolver = new AutofacWebApiDependencyResolver(container); configuration.DependencyResolver = resolver; app.UseAutofacMiddleware(container); app.UseAutofacWebApi(configuration); ConfigureOAuth(app, container); app.UseWebApi(configuration); return container; }
public Adapter(ISettings settings, IServiceFacade udapiServiceFacade, IAdapterPlugin platformConnector, IStreamListenerManager listenersManager) { _listenersManager = listenersManager; Settings = settings; UDAPIService = udapiServiceFacade; PlatformConnector = platformConnector; var statemanager = new StateManager(settings, platformConnector); StateManager = statemanager; StateProviderProxy.Init(statemanager); listenersManager.StateManager = statemanager; if (settings.StatsEnabled) { StatsManager.Configure(); } // we just need the initialisation new SuspensionManager(statemanager, PlatformConnector); platformConnector.Initialise(); statemanager.AddRules(platformConnector.MarketRules); ThreadPool.SetMinThreads(500, 500); _sports = new List <string>(); _stats = StatsManager.Instance["adapter.core"].GetHandle(); PopuplateAdapterVersionInfo(); }
public override void LoadData() { _serviceFacade = ((ServiceLocator)App.Current.Resources["ServiceLocator"]).ServiceFacade; _serviceFacade.CustomerServiceClient.GetOrdersByCriteriaCompleted += CustomerServiceClient_GetOrdersByCriteriaCompleted; _serviceFacade.CustomerServiceClient.GetOrdersByCriteriaAsync(new GetOrdersRequest() { CustomerId = 5, Id = 1 }); }
public LoginViewModel(IEventAggregator messageBus) { _messageBus = messageBus; LoginCommand = new DelegateCommand<object>(Login); _serviceFacade = ((ServiceLocator)App.Current.Resources["ServiceLocator"]).ServiceFacade; _serviceFacade.LoginCompletedEvent += new EventHandler<HsrOrderApp.UI.Silverlight.AuthenticationService.LoginCompletedEventArgs>(LoginViewModel_LoginCompletedEvent); }
public Adapter(ISettings settings, IServiceFacade udapiServiceFacade, IAdapterPlugin platformConnector, IStreamListenerManager listenersManager) { _listenersManager = listenersManager; Settings = settings; UDAPIService = udapiServiceFacade; PlatformConnector = platformConnector; var statemanager = new StateManager(settings,platformConnector); StateManager = statemanager; StateProviderProxy.Init(statemanager); listenersManager.StateManager = statemanager; if (settings.StatsEnabled) StatsManager.Configure(); // we just need the initialisation new SuspensionManager(statemanager, PlatformConnector); platformConnector.Initialise(); statemanager.AddRules(platformConnector.MarketRules); ThreadPool.SetMinThreads(500, 500); _sports = new List<string>(); _stats = StatsManager.Instance["adapter.core"].GetHandle(); PopuplateAdapterVersionInfo(); }
public SystemInitializer(IServiceFacade facade, IUnitOfWork unitOfWork, ILogger <SystemInitializer> logger) { _unitOfWork = unitOfWork; _results = new Dictionary <string, Guid>(); _facade = facade; _logger = logger; }
public Adapter( ISettings settings, IServiceFacade udapiServiceFacade, IAdapterPlugin platformConnector, IStateManager stateManager, IStateProvider stateProvider, ISuspensionManager suspensionManager, IStreamHealthCheckValidation streamHealthCheckValidation, IFixtureValidation fixtureValidation) { _settings = settings ?? throw new ArgumentNullException(nameof(settings)); _udapiServiceFacade = udapiServiceFacade ?? throw new ArgumentNullException(nameof(udapiServiceFacade)); _platformConnector = platformConnector ?? throw new ArgumentNullException(nameof(platformConnector)); _stateManager = stateManager ?? throw new ArgumentNullException(nameof(stateManager)); _suspensionManager = suspensionManager ?? throw new ArgumentNullException(nameof(suspensionManager)); _streamHealthCheckValidation = streamHealthCheckValidation ?? throw new ArgumentNullException(nameof(streamHealthCheckValidation)); _fixtureValidation = fixtureValidation ?? throw new ArgumentNullException(nameof(fixtureValidation)); StateProviderProxy.Init(stateProvider); if (settings.StatsEnabled) { StatsManager.Configure(); } platformConnector.Initialise(); stateManager.AddRules(platformConnector.MarketRules); ThreadPool.SetMinThreads(500, 500); _stats = StatsManager.Instance["adapter.core"].GetHandle(); PopuplateAdapterVersionInfo(); }
public void initialiseServices() { ServicesFacade facade = new ServicesFacade(); facade.initialise(); this.facade = facade; }
public RentersController() { _serviceFacade = new RentalServiceFacade(); _paymentServiceFacade = new PayTracePaymentService(); _masterServiceFacade = new MasterServiceFacade(); _generalFacade = new ServiceFacade(); }
/// <summary> /// /// </summary> /// <param name="settings"></param> /// <param name="udApiService"></param> /// <param name="adapterPlugin"></param> /// <param name="stateManager"></param> /// <param name="suspensionManager"></param> /// <param name="streamHealthCheckValidation"></param> /// <param name="fixtureValidation"></param> public static void Init( ISettings settings, IServiceFacade udApiService, IAdapterPlugin adapterPlugin, IStateManager stateManager, ISuspensionManager suspensionManager, IStreamHealthCheckValidation streamHealthCheckValidation, IFixtureValidation fixtureValidation) { _actorSystem = ActorSystem.Create("AdapterSystem"); var fileStoreProvider = new FileStoreProvider(settings.StateProviderPath); CreateFixtureStateActor(settings, fileStoreProvider); CreateStreamListenerManagerActor(settings, adapterPlugin, stateManager, suspensionManager, streamHealthCheckValidation, fixtureValidation); CreateSportProcessorRouterActor(settings, udApiService); CreateSportsProcessorActor(settings, udApiService); // Setup an actor that will handle deadletter type messages var deadletterWatchMonitorProps = Props.Create(() => new AdapterDeadletterMonitorActor()); var deadletterWatchActorRef = _actorSystem.ActorOf(deadletterWatchMonitorProps, "AdapterDeadletterMonitorActor"); // subscribe to the event stream for messages of type "DeadLetter" _actorSystem.EventStream.Subscribe(deadletterWatchActorRef, typeof(DeadLetter)); }
private void CreateProxy() { string SearchAddress = string.Format("net.tcp://{0}:8000/TcpService", GetSelectedIP()); string StreamingAddress = string.Format("net.tcp://{0}:8001/TcpService", GetSelectedIP()); StreamServerProxy = ServiceProxy.ProxyFactory.CreateProxy <IStreamPlayer>(StreamingAddress); SearchProxy = ServiceProxy.ProxyFactory.CreateProxy <IServiceFacade>(SearchAddress); }
static public IServiceFacade GetServiceFacade() { if (null == serviceFacade) { serviceFacade = ServiceFacade.ServiceFacade.Instance; } return(serviceFacade); }
public MainPageViewModel(IEventAggregator messageBus) { NavigateCommand = new DelegateCommand <string>(Navigate); LogoutCommand = new DelegateCommand <object>(Logout); _serviceFacade = ((ServiceLocator)App.Current.Resources["ServiceLocator"]).ServiceFacade; _messageBus = messageBus; _messageBus.GetEvent <Messages.NavigateMessage>().Subscribe(Navigate); _selectedPage = new Uri("/Views/Login/LoginWindow.xaml", UriKind.Relative); }
static public IServiceFacade GetServiceFacade() { if (null == serviceFacade) { serviceFacade = new ServiceFacade.ServiceFacade(); } return(serviceFacade); }
public void Load(OrderListDTO obj) { _serviceFacade = ((ServiceLocator)App.Current.Resources["ServiceLocator"]).ServiceFacade; _serviceFacade.CustomerServiceClient.GetOrderByIdCompleted += new EventHandler <GetOrderByIdCompletedEventArgs>(CustomerServiceClient_GetOrderByIdCompleted); _serviceFacade.CustomerServiceClient.GetOrderByIdAsync(new GetOrderRequest() { Id = obj.Id }); }
static public IServiceFacade getServiceFacade() { IServiceFacade serviceFacade = null; if (serviceFacade == null) { serviceFacade = Service.ServiceFacade.Instance; } return(serviceFacade); }
public MainPageViewModel(IEventAggregator messageBus) { NavigateCommand = new DelegateCommand<string>(Navigate); LogoutCommand = new DelegateCommand<object>(Logout); _serviceFacade = ((ServiceLocator)App.Current.Resources["ServiceLocator"]).ServiceFacade; _messageBus = messageBus; _messageBus.GetEvent<Messages.NavigateMessage>().Subscribe(Navigate); _selectedPage = new Uri("/Views/Login/LoginWindow.xaml", UriKind.Relative); }
public Startup(IConfiguration configuration, IServiceFacade facade, ILogger <Startup> logger, NotificationsCenter notificationsCenter, PipelineManager pipelineManager , SystemInitializer systemInitializer) { Configuration = configuration; _facade = facade; _logger = logger; _notificationsCenter = notificationsCenter; _pipelineManager = pipelineManager; _systemInitializer = systemInitializer; }
public override void LoadData() { //Get the ServiceFacade _facade = ((ServiceLocator)App.Current.Resources["ServiceLocator"]).ServiceFacade; _facade.CustomerServiceClient.GetCustomerCompleted += new System.EventHandler <GetCustomerCompletedEventArgs>(CustomerServiceClient_GetCustomerCompleted); _facade.CustomerServiceClient.GetCustomerAsync(); SaveCustomerCommand = new DelegateCommand <object>(SaveCustomer); //Commands DataLoaded = false; }
public override void LoadData() { //Get the ServiceFacade _facade= ((ServiceLocator)App.Current.Resources["ServiceLocator"]).ServiceFacade; _facade.CustomerServiceClient.GetCustomerCompleted += new System.EventHandler<GetCustomerCompletedEventArgs>(CustomerServiceClient_GetCustomerCompleted); _facade.CustomerServiceClient.GetCustomerAsync(); SaveCustomerCommand = new DelegateCommand<object>(SaveCustomer); //Commands DataLoaded = false; }
static void Main(string[] args) { Console.WriteLine("Running Dataloader"); var config = new ConfigurationBuilder() .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .AddEnvironmentVariables(); IConfigurationRoot configuration = config.Build(); var services = new ServiceCollection(); services.AddDbContext <DihlDbContext>(options => { options.UseSqlServer(configuration.GetConnectionString("DIHLDbConnection")); }); services.AddAutofac(); //TODO: pull in from config services.AddApplicationInsightsTelemetry("TEST"); var builder = new ContainerBuilder(); builder.RegisterModule <AutofacModule>(); builder.Populate(services); var applicationContainer = builder.Build(); var serviceProvider = new AutofacServiceProvider(applicationContainer); IServiceFacade serviceFacade = serviceProvider.GetService <IServiceFacade>(); //TODO: Add this to configuration ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.AddArguments(@"load-extension=C:\Users\BrendonC\AppData\Local\Google\Chrome\User Data\Default\Extensions\gighmmpiobklfepjocnamgkkbiglidom\3.31.2_0"); IWebDriver driver = new OpenQA.Selenium.Chrome.ChromeDriver("..\\..\\..\\Tools", chromeOptions); ScheduleAndScoresPage page = new ScheduleAndScoresPage(driver, Season.WinterDIHL2018); page.Navigate(); Console.WriteLine("Retrieving Game Ids..."); var gameIds = page.GetGameIds(); foreach (var gameId in gameIds) { GamePage gamePage = new GamePage(driver, gameId); gamePage.Navigate(); var info = gamePage.RetrieveGameDetails(); serviceFacade.SaveGameInformation(info).GetAwaiter().GetResult(); Console.WriteLine("Game Saved!"); Console.WriteLine(); Console.WriteLine(); } }
public FsBaseGenericHost( IServiceFacade serviceFace, ILogger <FsBaseGenericHost> logger, IConfiguration configuration, IHostingEnvironment environment, IApplicationLifetime appLifetime ) { _logger = logger ?? throw new Exception("No logger found"); _serviceface = serviceFace ?? throw new Exception("no service facade found"); _configuration = configuration; _environment = environment; _appLifetime = appLifetime; }
private static void CreateSportProcessorRouterActor(ISettings settings, IServiceFacade udApiService) { try { _sportProcessorRouterActor = ActorSystem.ActorOf( Props.Create(() => new SportProcessorRouterActor(udApiService)) .WithRouter(new SmallestMailboxPool(settings.FixtureCreationConcurrency)), SportProcessorRouterActor.ActorName); } catch (Exception e) { _logger.Fatal($"Error creating SportProcessorRouterActor {e}"); throw; } }
/// <summary> /// /// </summary> /// <param name="settings"></param> /// <param name="serviceFacade"></param> /// <param name="sportProcessorRouterActor"></param> public SportsProcessorActor( ISettings settings, IServiceFacade serviceFacade, IActorRef sportProcessorRouterActor) { _serviceFacade = serviceFacade ?? throw new ArgumentNullException(nameof(serviceFacade)); _sportProcessorRouterActor = sportProcessorRouterActor ?? throw new ArgumentNullException(nameof(sportProcessorRouterActor)); Receive <ProcessSportsMsg>(o => ProcessSportsMsgHandler()); _processSportsMsgSchedule = Context.System.Scheduler.ScheduleTellRepeatedlyCancelable( TimeSpan.FromSeconds(10), TimeSpan.FromMilliseconds(settings.FixtureCheckerFrequency), Self, new ProcessSportsMsg(), Self); }
/// <summary> /// Configures the application /// </summary> /// <param name="app">The app builder</param> /// <param name="serviceFacade">An instance of the service facade ofr mocking unit tests</param> public void Configuration(IAppBuilder app, IServiceFacade serviceFacade) { var config = new HttpConfiguration(); ApiRouteConfig.Register(config); FormattersConfig.Register(config); MapperConfig.Initialize(); DocumentationConfig.Register(config); // authorize all requests config.Filters.Add(new AuthorizeAttribute()); // ioc container ContainerConfig.Register(app, config, serviceFacade); // cors app.UseCors(CorsOptions.AllowAll); }
private static void CreateSportsProcessorActor(ISettings settings, IServiceFacade udApiService) { try { _sportsProcessorActor = ActorSystem.ActorOf( Props.Create(() => new SportsProcessorActor( settings, udApiService, _sportProcessorRouterActor)), SportsProcessorActor.ActorName); } catch (Exception e) { _logger.Fatal($"Error creating SportsProcessorActor {e}"); throw; } }
/// <summary> /// /// </summary> /// <param name="settings"></param> /// <param name="udApiService"></param> /// <param name="adapterPlugin"></param> /// <param name="stateManager"></param> /// <param name="suspensionManager"></param> /// <param name="streamHealthCheckValidation"></param> /// <param name="fixtureValidation"></param> public static void Init( ISettings settings, IServiceFacade udApiService, IAdapterPlugin adapterPlugin, IStateManager stateManager, ISuspensionManager suspensionManager, IStreamHealthCheckValidation streamHealthCheckValidation, IFixtureValidation fixtureValidation) { _actorSystem = ActorSystem.Create("AdapterSystem"); var fileStoreProvider = new FileStoreProvider(settings.StateProviderPath); _fixtureStateActor = ActorSystem.ActorOf( Props.Create(() => new FixtureStateActor( settings, fileStoreProvider)), FixtureStateActor.ActorName); _streamListenerManagerActor = ActorSystem.ActorOf( Props.Create(() => new StreamListenerManagerActor( settings, adapterPlugin, stateManager, suspensionManager, streamHealthCheckValidation, fixtureValidation)), StreamListenerManagerActor.ActorName); _sportProcessorRouterActor = ActorSystem.ActorOf( Props.Create(() => new SportProcessorRouterActor(udApiService)) .WithRouter(new SmallestMailboxPool(settings.FixtureCreationConcurrency)), SportProcessorRouterActor.ActorName); _sportsProcessorActor = ActorSystem.ActorOf( Props.Create(() => new SportsProcessorActor( settings, udApiService, _sportProcessorRouterActor)), SportsProcessorActor.ActorName); }
public SellerController(IServiceFacade serviceFacade, ILogger <SellerController> logger) { _logger = logger; _serviceFacade = serviceFacade; }
/// <summary> /// Creates a new catalog controller instance /// </summary> /// <param name="services">The service facade</param> public CatalogController(IServiceFacade services) : base(services) { }
/// <summary> /// Registers the configuration /// </summary> public static IContainer Register(IAppBuilder app, HttpConfiguration configuration, IServiceFacade serviceFacade = null) { Condition.Requires(configuration, "configuration").IsNotNull(); var builder = new ContainerBuilder(); builder.RegisterModule(new ServiceModule(serviceFacade)); // controllers builder.RegisterApiControllers(typeof(ControllerBase).Assembly); // request builder.RegisterHttpRequestMessage(configuration); // authorization builder.RegisterType <AuthorizationServerProvider>().As <IOAuthAuthorizationServerProvider>().SingleInstance(); // set resolver var container = builder.Build(); // set the dependency resolver for Web API var resolver = new AutofacWebApiDependencyResolver(container); configuration.DependencyResolver = resolver; app.UseAutofacMiddleware(container); app.UseAutofacWebApi(configuration); ConfigureOAuth(app, container); app.UseWebApi(configuration); return(container); }
public ServiceModule(IServiceFacade serviceFacade = null) { _serviceFacade = serviceFacade; }
public PostController() { _serviceFacade = MvcApplication.NinjectKernel.Get <IServiceFacade>(); }
public void Load(OrderListDTO obj) { _serviceFacade = ((ServiceLocator)App.Current.Resources["ServiceLocator"]).ServiceFacade; _serviceFacade.CustomerServiceClient.GetOrderByIdCompleted += new EventHandler<GetOrderByIdCompletedEventArgs>(CustomerServiceClient_GetOrderByIdCompleted); _serviceFacade.CustomerServiceClient.GetOrderByIdAsync(new GetOrderRequest() { Id = obj.Id }); }
public BuildscreenApiController(IServiceFacade serviceFacade) { _serviceFacade = serviceFacade; }
public void Initialize() { mockBuilder = new Mockery(); serviceFacade = mockBuilder.NewMock <IServiceFacade>(); }
/// <summary> /// Protected abstract constructor. /// </summary> /// <param name="services">Instance of the services facade</param> protected ControllerBase(IServiceFacade services) { Condition.Requires(services, "services").IsNotNull(); Services = services; }
/// <summary> /// Creates a new products controller instance /// </summary> /// <param name="services"></param> public ProductsController(IServiceFacade services) : base(services) { }
public void Initialize() { mockBuilder = new Mockery(); serviceFacade = mockBuilder.NewMock<IServiceFacade>(); }
public void Initialize() { mockBuilder = new Mockery(); service = mockBuilder.NewMock<IAdminService>(); serviceFacade = ServiceFacade.GetInstance(service); }
public UserServices(IServiceFacade serviceFacade, ILogger <UserServices> logger) { _serviceFacade = serviceFacade; _logger = logger; }
private void CreateProxy() { string SearchAddress = string.Format("net.tcp://{0}:8000/TcpService", GetSelectedIP()); string StreamingAddress = string.Format("net.tcp://{0}:8001/TcpService", GetSelectedIP()); StreamServerProxy = ServiceProxy.ProxyFactory.CreateProxy<IStreamPlayer>(StreamingAddress); SearchProxy = ServiceProxy.ProxyFactory.CreateProxy<IServiceFacade>(SearchAddress); }
public AccountController(UserServices userServices, IServiceFacade serviceFacade, ILogger <AccountController> logger) { _userServices = userServices; _serviceFacade = serviceFacade; _logger = logger; }
public Services() { _serviceFacade = new ServiceFacade(); }