public UserContextService(CremaService service, IUserContextEventCallback callback) : base(service, callback) { this.UserContext = this.CremaHost.GetService(typeof(IUserContext)) as IUserContext; this.UserCollection = this.CremaHost.GetService(typeof(IUserCollection)) as IUserCollection; this.LogService.Debug($"{nameof(UserContextService)} Constructor"); }
public DomainContextService(CremaService service, IDomainContextEventCallback callback) : base(service, callback) { this.UserContext = this.CremaHost.GetService(typeof(IUserContext)) as IUserContext; this.DomainContext = this.CremaHost.GetService(typeof(IDomainContext)) as IDomainContext; this.DataBaseContext = this.CremaHost.GetService(typeof(IDataBaseContext)) as IDataBaseContext; this.LogService.Debug($"{nameof(DomainContextService)} Constructor"); }
protected override void OnStart(string[] args) { base.OnStart(args); var baseArgs = Environment.GetCommandLineArgs(); var path = baseArgs[1]; var port = int.Parse(baseArgs[2]); this.cremaService = new CremaService() { BasePath = path, Port = port, }; CremaLog.Debug("service base path : {0}", path); CremaLog.Debug("service port : {0}", port); try { CremaLog.Debug(args.Length); if (args.Any() == true) { var settings = new Settings() { BasePath = this.cremaService.BasePath, Port = this.cremaService.Port, RepositoryModule = this.cremaService.RepositoryModule, RepositoryName = this.cremaService.RepositoryName, }; var parser = new CommandLineParser("setting", settings); parser.Parse(string.Join(" ", "setting", string.Join(" ", args))); this.cremaService.BasePath = settings.BasePath; this.cremaService.Port = settings.Port; this.cremaService.RepositoryModule = settings.RepositoryModule; this.cremaService.RepositoryName = settings.RepositoryName; CremaLog.Debug("========================================================="); CremaLog.Debug("new settings"); CremaLog.Debug("service base path : {0}", settings.BasePath); CremaLog.Debug("service port : {0}", settings.Port); CremaLog.Debug("service repo name : {0}", settings.RepositoryName); CremaLog.Debug("service repo module : {0}", settings.RepositoryModule); CremaLog.Debug("========================================================="); } } catch (Exception e) { CremaLog.Error(e); throw e; } CremaLog.Debug("service open"); this.cremaService.Open(); this.cremaHost = this.cremaService.CremaHost; this.cremaHost.Closed += CremaHost_Closed; CremaLog.Debug("service opened."); }
public HttpCommandsService(ICremaHost cremaHost, CremaService cremaService) : base(cremaHost.GetService(typeof(ILogService)) as ILogService) { this.cremaHost = cremaHost; this.cremaService = cremaService; this.logService = cremaHost.GetService(typeof(ILogService)) as ILogService; this.userContext = cremaHost.GetService(typeof(IUserContext)) as IUserContext; this.logService.Debug($"{nameof(HttpCommandsService)} Constructor"); }
public ConsoleCommandContext(ICremaHost cremaHost, CremaService service, [ImportMany] IEnumerable <IConsoleDrive> rootItems, [ImportMany] IEnumerable <IConsoleCommand> commands) : base(rootItems, commands) { this.cremaHost = cremaHost; this.cremaHost.Opened += CremaHost_Opened; this.service = service; }
public ShellViewModel(CremaService service, CremaSettings settings, IAppConfiguration configs, AppSettings appSettings) { this.service = service; this.settings = settings; this.configs = configs; this.DisplayName = "Crema Server"; this.Dispatcher.InvokeAsync(() => { this.configs.Update(this); this.Initialize(appSettings); }); }
public override IEnumerable <Tuple <System.Type, object> > GetParts() { var service = new CremaService(this); foreach (var item in base.GetParts()) { yield return(item); } yield return(new Tuple <Type, object>(typeof(CremaApplication), this)); yield return(new Tuple <Type, object>(typeof(CremaService), service)); yield return(new Tuple <Type, object>(typeof(ICremaService), service)); }
public UserServiceHost(ICremaHost cremaHost, int port, CremaService cremaService) : base(cremaHost, typeof(UserService), address, port) { this.cremaService = cremaService; this.AddServiceEndpoint(typeof(IUserService), CreateNetTcpBinding(), string.Empty); this.Description.Behaviors.Add(new InstanceProviderBehavior()); #if DEBUG if (Environment.OSVersion.Platform != PlatformID.Unix) { this.Description.Behaviors.Add(new ServiceMetadataBehavior()); this.AddServiceEndpoint(typeof(IMetadataExchange), MetadataExchangeBindings.CreateMexTcpBinding(), "mex"); } #endif }
public HttpCommandsServiceHost(ICremaHost cremaHost, int port, CremaService cremaService) : base(cremaHost, typeof(HttpCommandsService), address, port) { this.cremaService = cremaService; var endpoint = this.AddServiceEndpoint(typeof(IHttpCommandsService), CreateWebHttpBinding(), string.Empty); endpoint.Behaviors.Add(new WebHttpBehavior()); endpoint.Behaviors.Add(new ErrorHandlerBehavior()); this.Description.Behaviors.Add(new InstanceProviderBehavior()); #if DEBUG if (Environment.OSVersion.Platform != PlatformID.Unix) { this.Description.Behaviors.Add(new ServiceMetadataBehavior()); this.AddServiceEndpoint(typeof(IMetadataExchange), MetadataExchangeBindings.CreateMexHttpBinding(), "mex"); } #endif }
private void InitCremaService() { var repoPath = DirectoryUtility.Prepare(CremaDbPath, "_repo"); using (var bootstrap = new CremaBootstrapper()) { bootstrap.CreateRepository(repoPath, "crema", false); } Service = new CremaService(); Service.BasePath = repoPath; Service.MultiThreading = true; Service.Port = 4004; Service.HttpPort = AddressUtility.GetDefaultHttpPort(Service.Port); Service.Open(); CremaHost = Service.GetService <ICremaHost>(); }
public DataBaseContextServiceHostProvider(CremaService service) { this.service = service; }
public ShellViewModel(CremaService service, [ImportMany] IEnumerable <IRepositoryProvider> repoProviders) { this.service = service; this.repoProviders = repoProviders.ToArray(); this.repositoryModule = CremaBootstrapper.DefaultRepositoryModule; }
public HttpCommandServiceHost(ICremaHost cremaHost, CremaService cremaService) { this.cremaHost = cremaHost; this.cremaService = cremaService; }
protected override void OnStart(string[] args) { base.OnStart(args); try { var environmentCommandLineArgs = Environment.GetCommandLineArgs(); var baseArgs = IsMonoRuntime ? environmentCommandLineArgs.Skip(environmentCommandLineArgs.Length - MonoRuntimeCommandLineArgsCount - 1).Take(MonoRuntimeCommandLineArgsCount + 1).ToArray() : environmentCommandLineArgs; var path = baseArgs[1]; var port = int.Parse(baseArgs[2]); var httpPort = int.Parse(baseArgs[3]); this.cremaService = new CremaService() { BasePath = path, Port = port, HttpPort = httpPort }; CremaLog.Debug(args.Length); if (!IsMonoRuntime && args.Any()) { var settings = new Settings() { BasePath = this.cremaService.BasePath, Port = this.cremaService.Port, HttpPort = this.cremaService.HttpPort.Value, RepositoryModule = this.cremaService.RepositoryModule, RepositoryName = this.cremaService.RepositoryName, }; var parser = new CommandLineParser("setting", settings); parser.Parse(string.Join(" ", "setting", string.Join(" ", args))); this.cremaService.BasePath = settings.BasePath; this.cremaService.Port = settings.Port; this.cremaService.RepositoryModule = settings.RepositoryModule; this.cremaService.RepositoryName = settings.RepositoryName; CremaLog.Debug("========================================================="); CremaLog.Debug("new settings"); CremaLog.Debug("service base path : {0}", settings.BasePath); CremaLog.Debug("service port : {0}", settings.Port); CremaLog.Debug("service http port : {0}", settings.HttpPort); CremaLog.Debug("service repo name : {0}", settings.RepositoryName); CremaLog.Debug("service repo module : {0}", settings.RepositoryModule); CremaLog.Debug("========================================================="); } else if (args.Any()) { CremaLog.Debug("service base path : {0}", this.cremaService.BasePath); CremaLog.Debug("service port : {0}", this.cremaService.Port); CremaLog.Debug("service http port : {0}", this.cremaService.HttpPort ?? -1); CremaLog.Debug("service repo name : {0}", this.cremaService.RepositoryName); CremaLog.Debug("service repo module: {0}", this.cremaService.RepositoryModule); } } catch (Exception e) { CremaLog.Error(e); throw e; } CremaLog.Debug("service open"); this.cremaService.Open(); this.cremaHost = this.cremaService.CremaHost; this.cremaHost.Closed += CremaHost_Closed; CremaLog.Debug("service opened."); }
public HttpCommandsServiceHostProvider(ICremaHost cremaHost, CremaService cremaService) { this.cremaHost = cremaHost; this.cremaService = cremaService; }
public UserContextServiceHostProvider(CremaService cremaService) { this.cremaService = cremaService; }
public DomainContextServiceHost(CremaService service) { this.service = service; }
public AppBootstrapperDescriptor() { this.service = new CremaService(this); }
public UserServiceHostProvider(ICremaHost cremaHost, CremaService cremaService) { this.cremaHost = cremaHost; this.cremaService = cremaService; }
public HttpDescriptorService(CremaService service, ICremaHost cremaHost) { this.service = service; this.cremaHost = cremaHost; }
public DataBaseServiceHost(CremaService service) { this.service = service; }
public HttpDescriptorServiceHostProvider(ICremaHost cremaHost, CremaService cremaService) { this.cremaHost = cremaHost; this.cremaService = cremaService; }
public UserContextServiceHost(CremaService service) { this.service = service; }
public CremaApplication() { this.service = this.GetService(typeof(CremaService)) as CremaService; }