• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# RavenConfiguration类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中RavenConfiguration的典型用法代码示例。如果您正苦于以下问题:C# RavenConfiguration类的具体用法?C# RavenConfiguration怎么用?C# RavenConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RavenConfiguration类属于命名空间,在下文中一共展示了RavenConfiguration类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: HttpListenerContextAdpater

		public HttpListenerContextAdpater(HttpListenerContext ctx, RavenConfiguration configuration)
		{
			this.ctx = ctx;
			this.configuration = configuration;
			Request = new HttpListenerRequestAdapter(ctx.Request);
			ResponseInternal = new HttpListenerResponseAdapter(ctx.Response);
		}
开发者ID:ajaishankar,项目名称:ravendb,代码行数:7,代码来源:HttpListenerContextAdpater.cs


示例2: Init

		public static void Init()
		{
			if (database != null)
				return;

			lock (locker)
			{
				if (database != null)
					return;

				try
				{
					var ravenConfiguration = new RavenConfiguration();
					HttpEndpointRegistration.RegisterHttpEndpointTarget();
					database = new DocumentDatabase(ravenConfiguration);
					database.SpinBackgroundWorkers();
					server = new HttpServer(ravenConfiguration, database);
					server.Init();
				}
				catch
				{
					if (database != null)
					{
						database.Dispose();
						database = null;
					}
					if (server != null)
					{
						server.Dispose();
						server = null;
					}
					throw;
				}
			}
		}
开发者ID:pjboudrx,项目名称:ravendb,代码行数:35,代码来源:ForwardToRavenRespondersFactory.cs


示例3: TcpHttpContext

 public TcpHttpContext(TcpClient client, RavenConfiguration configuration)
 {
     _client = client;
     _configuration = configuration;
     _request = new TcpHttpRequest(_client, configuration.Port);
     _response = new TcpHttpResponse(_client);
 }
开发者ID:jlundstocholm,项目名称:ravendb,代码行数:7,代码来源:TcpHttpContext.cs


示例4: HttpContextAdapter

		public HttpContextAdapter(HttpContext context, RavenConfiguration configuration)
		{
			this.context = context;
			this.configuration = configuration;
			request = new HttpRequestAdapter(context.Request);
			response = new HttpResponseAdapter(context.Response);
		}
开发者ID:markrendle,项目名称:ravendb,代码行数:7,代码来源:HttpContextAdapter.cs


示例5: CreateDocumentDatabase

		private DocumentDatabase CreateDocumentDatabase()
		{
			var configuration = new RavenConfiguration();
			configuration.DataDirectory = Path.Combine(NewDataPath(), "System");
			configuration.RunInMemory = configuration.DefaultStorageTypeName == InMemoryRavenConfiguration.VoronTypeName;
			return new DocumentDatabase(configuration);
		}
开发者ID:cocytus,项目名称:ravendb,代码行数:7,代码来源:DynamicQueryMapping.cs


示例6: ConfigureServer

		protected override void ConfigureServer(RavenConfiguration ravenConfiguration)
		{
			ravenConfiguration.AnonymousUserAccessMode = AnonymousUserAccessMode.None;
			ravenConfiguration.AuthenticationMode = "OAuth";
			ravenConfiguration.OAuthTokenCertificate = CertGenerator.GenerateNewCertificate("RavenDB.Test");
			ravenConfiguration.Catalog.Catalogs.Add(new TypeCatalog(typeof(FakeAuthenticateClient)));
		}
开发者ID:alwin,项目名称:ravendb,代码行数:7,代码来源:GrantAccessTokenClientCredentialsFlow.cs


示例7: Init

        public static void Init()
        {
            if (database != null)
                return;

            lock (locker)
            {
                if (database != null)
                    return;

                try
                {
                    var ravenConfiguration = new RavenConfiguration();
                    if (RoleEnvironment.IsAvailable)
                    {
                        ravenConfiguration.RunInMemory = true;
                        // Mount Cloud drive and set it as Data Directory
                        //var currentConfiguredRavenDataDir = ConfigurationManager.AppSettings["Raven/DataDir"] ?? string.Empty;
                        //string azureDrive = @"D:\"; // Environment.GetEnvironmentVariable(RavenDriveConfiguration.AzureDriveEnvironmentVariableName, EnvironmentVariableTarget.Machine);
                        //if (string.IsNullOrWhiteSpace(azureDrive))
                        //{
                        //    throw new ArgumentException("RavenDb drive environment variable is not yet set by worker role. Please, retry in a couple of seconds");
                        //}

                        //string azurePath = Path.Combine(azureDrive,
                        //    currentConfiguredRavenDataDir.StartsWith(@"~\")
                        //        ? currentConfiguredRavenDataDir.Substring(2)
                        //        : "Data");
                        //ravenConfiguration.DataDirectory = azurePath;

                        // Read port number specified for this Raven instance and set it in configuration
                        var endpoint = RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["Raven"];
                        ravenConfiguration.Port = endpoint.IPEndpoint.Port;

                        // When mounting drives in emulator only Munin storage is supported, since drive is not actually present and low level access to it failes (Esent mode)
                    }
                    HttpEndpointRegistration.RegisterHttpEndpointTarget();
                    database = new DocumentDatabase(ravenConfiguration);
                    database.SpinBackgroundWorkers();
                    server = new HttpServer(ravenConfiguration, database);
                    server.Init();
                }
                catch
                {
                    if (database != null)
                    {
                        database.Dispose();
                        database = null;
                    }
                    if (server != null)
                    {
                        server.Dispose();
                        server = null;
                    }
                    throw;
                }

                HostingEnvironment.RegisterObject(new ReleaseRavenDBWhenAppDomainIsTornDown());
            }
        }
开发者ID:thatpaulschofield,项目名称:LifeMap,代码行数:60,代码来源:ForwardToRavenRespondersFactory.cs


示例8: OnStart

        public override bool OnStart()
        {
            // Set the maximum number of concurrent connections
            ServicePointManager.DefaultConnectionLimit = 12;

            // For information on handling configuration changes
            // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.

            var drive = MountCloudDrive();

            var config = new RavenConfiguration
                             {
                                 DataDirectory = drive,
                                 AnonymousUserAccessMode = AnonymousUserAccessMode.All,
                                 HttpCompression = true,
                                 DefaultStorageTypeName = "munin",
                                 Port = MyInstanceEndpoint.IPEndpoint.Port,
                                 PluginsDirectory = "plugins"
                             };

            StartRaven(config);
            SetupReplication();

            RoleEnvironment.Changed += RoleEnvironmentChanged;
            RoleEnvironment.StatusCheck += RoleEnvironmentStatusCheck;

            return base.OnStart();
        }
开发者ID:skovborg,项目名称:AzureRavenDB,代码行数:28,代码来源:WorkerRole.cs


示例9: EmbeddableDocumentStore

 public EmbeddableDocumentStore()
 {
     Conventions = new DocumentConvention();
     Listeners = new DocumentSessionListeners();
     Configuration = new RavenConfiguration();
     EnlistInDistributedTransactions = true;
 }
开发者ID:bbqchickenrobot,项目名称:ravendb,代码行数:7,代码来源:EmbeddableDocumentStore.cs


示例10: CreateRavenDbServer

        protected RavenDbServer CreateRavenDbServer(int port,
                                                    string dataDirectory = null,
                                                    bool runInMemory = true,
                                                    string requestedStorage = null,
                                                    bool enableAuthentication = false,
                                                    string fileSystemName = null,
                                                    Action<RavenConfiguration> customConfig = null)
        {
            NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(port);
            var storageType = GetDefaultStorageType(requestedStorage);
            var directory = dataDirectory ?? NewDataPath(fileSystemName + "_" + port);

            var ravenConfiguration = new RavenConfiguration()
            {
				Port = port,
				DataDirectory = directory,
				RunInMemory = storageType.Equals("esent", StringComparison.OrdinalIgnoreCase) == false && runInMemory,
#if DEBUG
				RunInUnreliableYetFastModeThatIsNotSuitableForProduction = runInMemory,
#endif
				DefaultStorageTypeName = storageType,
				AnonymousUserAccessMode = enableAuthentication ? AnonymousUserAccessMode.None : AnonymousUserAccessMode.Admin,                
			};

	        ravenConfiguration.Encryption.UseFips = SettingsHelper.UseFipsEncryptionAlgorithms;
            ravenConfiguration.FileSystem.MaximumSynchronizationInterval = this.SynchronizationInterval;
	        ravenConfiguration.FileSystem.DataDirectory = Path.Combine(directory, "FileSystem");
	        ravenConfiguration.FileSystem.DefaultStorageTypeName = storageType;

            if (customConfig != null)
            {
                customConfig(ravenConfiguration);
            }

            if (enableAuthentication)
            {
                Authentication.EnableOnce();
            }

            var ravenDbServer = new RavenDbServer(ravenConfiguration)
            {
	            UseEmbeddedHttpServer = true
            };
	        ravenDbServer.Initialize();

            servers.Add(ravenDbServer);

            if (enableAuthentication)
            {
                EnableAuthentication(ravenDbServer.SystemDatabase);
            }

            ConfigureServer(ravenDbServer, fileSystemName);

            return ravenDbServer;
        }
开发者ID:mdavis,项目名称:ravendb,代码行数:56,代码来源:RavenFsTestBase.cs


示例11: HttpServer

        public HttpServer(RavenConfiguration configuration, DocumentDatabase database)
        {
            defaultDatabase = database;
            defaultConfiguration = configuration;

            configuration.Container.SatisfyImportsOnce(this);

            foreach (var requestResponder in RequestResponders)
            {
                requestResponder.Initialize(() => currentDatabase.Value, () => currentConfiguration.Value);
            }
        }
开发者ID:Rationalle,项目名称:ravendb,代码行数:12,代码来源:HttpServer.cs


示例12: HttpServer

        public HttpServer(RavenConfiguration configuration, DocumentDatabase database)
        {
            Configuration = configuration;

            configuration.Container.SatisfyImportsOnce(this);

            foreach (var requestResponder in RequestResponders)
            {
                requestResponder.Database = database;
                requestResponder.Settings = configuration;
            }
        }
开发者ID:kenegozi,项目名称:ravendb,代码行数:12,代码来源:HttpServer.cs


示例13: TransactionalStorage

		public TransactionalStorage(RavenConfiguration configuration, Action onCommit)
		{
			database = configuration.DataDirectory;
			this.configuration = configuration;
			this.onCommit = onCommit;
			path = database;
			if (Path.IsPathRooted(database) == false)
				path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, database);
			database = Path.Combine(path, "Data");

			LimitSystemCache();

			Api.JetCreateInstance(out instance, database + Guid.NewGuid());
		}
开发者ID:nathanpalmer,项目名称:ravendb,代码行数:14,代码来源:TransactionalStorage.cs


示例14: Init

		public static void Init()
		{
			if (database != null)
				return;
			lock (locker)
			{
				if (database != null)
					return;

				var ravenConfiguration = new RavenConfiguration();
				HttpServer.RegisterHttpEndpointTarget();
				database = new DocumentDatabase(ravenConfiguration);
				database.SpinBackgroundWorkers();
				server = new HttpServer(ravenConfiguration, database);
			}
		}
开发者ID:maurodx,项目名称:ravendb,代码行数:16,代码来源:ForwardToRavenRespondersFactory.cs


示例15: CreateRavenDbServer

        protected RavenDbServer CreateRavenDbServer(int port,
                                                    string dataDirectory = null,
                                                    bool runInMemory = true,
                                                    string requestedStorage = null,
                                                    bool enableAuthentication = false,
                                                    string fileSystemName = null)
        {
            var storageType = GetDefaultStorageType(requestedStorage);
            var directory = dataDirectory ?? NewDataPath(fileSystemName + "_" + port);

            var ravenConfiguration = new RavenConfiguration()
            {
				Port = port,
				DataDirectory = directory,
				FileSystemDataDirectory = Path.Combine(directory, "FileSystem"),
				RunInMemory = storageType.Equals("esent", StringComparison.OrdinalIgnoreCase) == false && runInMemory,
#if DEBUG
				RunInUnreliableYetFastModeThatIsNotSuitableForProduction = runInMemory,
#endif
				DefaultStorageTypeName = storageType,
				AnonymousUserAccessMode = enableAuthentication ? AnonymousUserAccessMode.None : AnonymousUserAccessMode.Admin,
			};

            if (enableAuthentication)
            {
                Authentication.EnableOnce();
            }

            var ravenDbServer = new RavenDbServer(ravenConfiguration)
            {
	            UseEmbeddedHttpServer = true
            };
	        ravenDbServer.Initialize();

            servers.Add(ravenDbServer);

            if (enableAuthentication)
            {
                EnableAuthentication(ravenDbServer.SystemDatabase);
            }

            ConfigureServer(ravenDbServer, fileSystemName);

            return ravenDbServer;
        }
开发者ID:paulcbetts,项目名称:ravendb,代码行数:45,代码来源:RavenFsTestBase.cs


示例16: RavenDbServer

		public RavenDbServer(RavenConfiguration settings)
		{
			database = new DocumentDatabase(settings);

			try
			{
				database.SpinBackgroundWorkers();
				server = new HttpServer(settings, database);
				server.StartListening();
			}
			catch (Exception)
			{
				database.Dispose();
				database = null;
				
				throw;
			}
		}
开发者ID:neiz,项目名称:ravendb,代码行数:18,代码来源:RavenDbServer.cs


示例17: IndexStorage

		public IndexStorage(IndexDefinitionStorage indexDefinitionStorage, RavenConfiguration configuration)
		{
		    this.configuration = configuration;
		    path = Path.Combine(configuration.DataDirectory, "Indexes");
		    if (Directory.Exists(path) == false)
		        Directory.CreateDirectory(path);

		    foreach (var indexDirectory in indexDefinitionStorage.IndexNames)
		    {
		        log.DebugFormat("Loading saved index {0}", indexDirectory);

		        var indexDefinition = indexDefinitionStorage.GetIndexDefinition(indexDirectory);
		        if (indexDefinition == null)
		            continue;
		        indexes.TryAdd(indexDirectory,
		                       CreateIndexImplementation(indexDirectory, indexDefinition,
		                                                 OpenOrCreateLuceneDirectory(indexDirectory)));
		    }
		}
开发者ID:Inferis,项目名称:ravendb,代码行数:19,代码来源:IndexStorage.cs


示例18: Init

        public static void Init()
        {
            if (database != null)
                return;

            lock (locker)
            {
                if (database != null)
                    return;

                log.Info("Setting up RavenDB Http Integration to the ASP.Net Pipeline");
                try
                {
                    var ravenConfiguration = new RavenConfiguration();
                    HttpEndpointRegistration.RegisterHttpEndpointTarget();
                    database = new DocumentDatabase(ravenConfiguration);
                    database.SpinBackgroundWorkers();
                    server = new HttpServer(ravenConfiguration, database);
                    server.Init();
                }
                catch
                {
                    if (database != null)
                    {
                        database.Dispose();
                        database = null;
                    }
                    if (server != null)
                    {
                        server.Dispose();
                        server = null;
                    }
                    throw;
                }

                shutdownDetector = new ShutdownDetector(log);
                shutdownDetector.Initialize();

                shutdownDetector.Token.Register(OnShutdown);
            }
        }
开发者ID:925coder,项目名称:ravendb,代码行数:41,代码来源:ForwardToRavenRespondersFactory.cs


示例19: Init

		public static void Init()
		{
			if (database != null)
				return;

			lock (locker)
			{
				if (database != null)
					return;

				log.Info("Setting up RavenDB Http Integration to the ASP.Net Pipeline");
				try
				{
					var ravenConfiguration = new RavenConfiguration();
					HttpEndpointRegistration.RegisterHttpEndpointTarget();
					database = new DocumentDatabase(ravenConfiguration);
					database.SpinBackgroundWorkers();
					server = new HttpServer(ravenConfiguration, database);
					server.Init();
				}
				catch
				{
					if (database != null)
					{
						database.Dispose();
						database = null;
					}
					if (server != null)
					{
						server.Dispose();
						server = null;
					}
					throw;
				}

				HostingEnvironment.RegisterObject(new ReleaseRavenDBWhenAppDomainIsTornDown());
			}
		}
开发者ID:neiz,项目名称:ravendb,代码行数:38,代码来源:ForwardToRavenRespondersFactory.cs


示例20: GetNewServer

        protected RavenDbServer GetNewServer(int port = 8079,
            string dataDirectory = null,
            bool runInMemory = true,
            string requestedStorage = null,
            bool enableAuthentication = false,
            string activeBundles = null,
            Action<RavenDBOptions> configureServer = null,
            Action<InMemoryRavenConfiguration> configureConfig = null,
            [CallerMemberName] string databaseName = null)
        {
            databaseName = NormalizeDatabaseName(databaseName != Constants.SystemDatabase ? databaseName : null);

            checkPorts = true;
            if (dataDirectory != null)
                pathsToDelete.Add(dataDirectory);

            var storageType = GetDefaultStorageType(requestedStorage);
            var directory = dataDirectory ?? NewDataPath(databaseName == Constants.SystemDatabase ? null : databaseName);
            var ravenConfiguration = new RavenConfiguration();

            ConfigurationHelper.ApplySettingsToConfiguration(ravenConfiguration);

            ravenConfiguration.Port = port;
            ravenConfiguration.DataDirectory = Path.Combine(directory, "System");
            ravenConfiguration.RunInMemory = runInMemory;
#if DEBUG
            ravenConfiguration.RunInUnreliableYetFastModeThatIsNotSuitableForProduction = runInMemory;
#endif
            ravenConfiguration.DefaultStorageTypeName = storageType;
            ravenConfiguration.AnonymousUserAccessMode = enableAuthentication ? AnonymousUserAccessMode.None : AnonymousUserAccessMode.Admin;

            ravenConfiguration.FileSystem.DataDirectory = Path.Combine(directory, "FileSystem");
            ravenConfiguration.Encryption.UseFips = ConfigurationHelper.UseFipsEncryptionAlgorithms;

            ravenConfiguration.Settings["Raven/StorageTypeName"] = ravenConfiguration.DefaultStorageTypeName;

            if (activeBundles != null)
            {
                ravenConfiguration.Settings["Raven/ActiveBundles"] = activeBundles;
            }

            if (configureConfig != null)
                configureConfig(ravenConfiguration);
            ModifyConfiguration(ravenConfiguration);

            ravenConfiguration.PostInit();

            NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(ravenConfiguration.Port);
            var ravenDbServer = new RavenDbServer(ravenConfiguration)
            {
                UseEmbeddedHttpServer = true,
            };
            ravenDbServer.Initialize(configureServer);
            servers.Add(ravenDbServer);

            try
            {
                using (var documentStore = new DocumentStore
                {
                    Url = "http://localhost:" + port,
                    Conventions =
                    {
                        FailoverBehavior = FailoverBehavior.FailImmediately
                    },
                    DefaultDatabase = databaseName
                }.Initialize())
                {
                    CreateDefaultIndexes(documentStore);
                }
            }
            catch
            {
                ravenDbServer.Dispose();
                throw;
            }

            if (enableAuthentication)
            {
                EnableAuthentication(ravenDbServer.SystemDatabase);
                ModifyConfiguration(ravenConfiguration);
                ravenConfiguration.PostInit();
            }

            return ravenDbServer;
        }
开发者ID:hero106wen,项目名称:ravendb,代码行数:85,代码来源:RavenTestBase.cs



注:本文中的RavenConfiguration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# RavenConnectionStringOptions类代码示例发布时间:2022-05-24
下一篇:
C# Rational类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap