Beispiel #1
0
        public InteropContext(Plexus.UniqueId trustedLauncherId, string metadataDir, IRegistryProvider registryProvider)
        {
            RegistryProvider = registryProvider;
            var appRegistryProvider = new JsonFileAppRegistryProvider(Path.Combine(metadataDir, "apps.json"));

            _appLifecycleManagerClientClientRepository = new AppLifecycleManagerClientClientRepository();
            var appLaunchedEventProvider = new AppLaunchedEventProvider();

            _appLifecycleManager = new AppLifecycleManager(appRegistryProvider, appLaunchedEventProvider, _appLifecycleManagerClientClientRepository);
            _appLifecycleManager.RegisterAppInstance(trustedLauncherId);
            _appLaunchedEventSubscriber = new AppLaunchedEventSubscriber(_appLifecycleManager, registryProvider, appLaunchedEventProvider, _appLifecycleManagerClientClientRepository);

            var nativeLauncherInstanceId = Plexus.UniqueId.Generate();

            _appLifecycleManager.RegisterAppInstanceConnection(Generated.NativeAppLauncherClient.Id, nativeLauncherInstanceId);
            _nativeAppLauncherClient = new NativeAppLauncherClient(metadataDir, nativeLauncherInstanceId);

            _appMetadataService     = new AppMetadataServiceImpl(appRegistryProvider, registryProvider);
            _appLifecycleService    = new AppLifecycleServiceImpl(_appLifecycleManager);
            _contextLinkageService  = new ContextLinkageServiceImpl(registryProvider, _appLifecycleManager, appLaunchedEventProvider);
            _appRegistrationService = new AppRegistrationServiceImpl(_appLifecycleManager);

            OnStop(_nativeAppLauncherClient.Stop);
            OnStop(_appLifecycleManagerClientClientRepository.Stop);
        }
Beispiel #2
0
        private AppLifecycleManagerClient CreateAppLifecycleManagerClient()
        {
            var id = Plexus.UniqueId.Generate();

            _appLifecycleManager.RegisterAppInstanceConnection(AppLifecycleManagerClient.Id, id);
            return(new AppLifecycleManagerClient(
                       _appLifecycleService,
                       _appMetadataService,
                       _contextLinkageService,
                       _appRegistrationService,
                       s => s.WithAppInstanceId(id).WithBrokerWorkingDir(Directory.GetCurrentDirectory())));
        }