当前位置: 首页>>代码示例>>C#>>正文


C# RavenConfiguration类代码示例

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


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


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