/// <summary>
 /// Create a new instance of the context that attaches to the specified directory location
 /// </summary>
 /// <param name="connectionString">The Brightstar service connection string</param>
 /// <remarks>The data context is thread-safe but doesn't support concurrent access to the same base location by multiple
 /// instances. You should ensure in your code that only one EmbeddedDataObjectContext instance is connected to any given base location
 /// at a given time.</remarks>
 public EmbeddedDataObjectContext(ConnectionString connectionString)
 {
     if (connectionString == null) throw new ArgumentNullException("connectionString");
     if (connectionString.Type != ConnectionType.Embedded) throw new ArgumentException("Invalid connection type", "connectionString");
     _serverCore = ServerCoreManager.GetServerCore(connectionString.StoresDirectory);
     _optimisticLockingEnabled = connectionString.OptimisticLocking;
 }
 internal EmbeddedDataObjectStore(ServerCore serverCore, string storeName, Dictionary<string, string> namespaceMappings, bool optimisticLockingEnabled)
     : base(namespaceMappings)
 {
     _serverCore = serverCore;
     _storeName = storeName;
     _optimisticLockingEnabled = optimisticLockingEnabled;
     ResetTransactionData();
 }
Esempio n. 3
0
 /// <summary>
 /// Create a new node core
 /// </summary>
 /// <param name="baseLocation"> </param>
 public NodeCore(string baseLocation)
 {
     _serverCore = ServerCoreManager.GetServerCore(baseLocation);
     _serverCore.JobCompleted += OnJobCompleted;
     _nodeComms = new NodeComms(this);
     _nodeComms.SlaveAdded += OnSlaveAdded;
     _storeInfo = new Dictionary<string, StoreTransactionInfo>();
 }
 internal EmbeddedDataObjectStore(ServerCore serverCore, string storeName, Dictionary<string, string> namespaceMappings, bool optimisticLockingEnabled,
     string updateGraphUri, IEnumerable<string> datasetGraphUris, string versionGraphUri)
     : base(namespaceMappings, updateGraphUri, datasetGraphUris, versionGraphUri)
 {
     _serverCore = serverCore;
     _storeName = storeName;
     _optimisticLockingEnabled = optimisticLockingEnabled;
     ResetTransactionData();
 }
        /// <summary>
        /// Create a new instance of the context that attaches to the specified directory location
        /// </summary>
        /// <param name="connectionString">The Brightstar service connection string</param>
        /// <param name="clientConfiguration">Additional client configuration options</param>
        /// <remarks>The data context is thread-safe but doesn't support concurrent access to the same base location by multiple
        /// instances. You should ensure in your code that only one EmbeddedDataObjectContext instance is connected to any given base location
        /// at a given time.</remarks>
        public EmbeddedDataObjectContext(ConnectionString connectionString, ClientConfiguration clientConfiguration = null)
        {
            if (connectionString == null) throw new ArgumentNullException("connectionString");
            if (connectionString.Type != ConnectionType.Embedded) throw new ArgumentException("Invalid connection type", "connectionString");

            if (clientConfiguration == null) clientConfiguration = ClientConfiguration.Default;
            _serverCore = ServerCoreManager.GetServerCore(
                connectionString.StoresDirectory,
                clientConfiguration == null ? null : clientConfiguration.PreloadConfiguration);
            _optimisticLockingEnabled = connectionString.OptimisticLocking;
        }
Esempio n. 6
0
 public static ServerCore GetServerCore(string baseLocation)
 {
     lock (UpdateLock)
     {
         if (!ServerCores.ContainsKey(baseLocation))
         {
             var serverCore = new ServerCore(baseLocation, QueryCache, PersistenceType);
             ServerCores.Add(baseLocation, serverCore);
         }
         return ServerCores[baseLocation];
     }
 }
 public static ServerCore GetServerCore(string baseLocation, PageCachePreloadConfiguration preloadConfiguration)
 {
     lock (UpdateLock)
     {
         if (!ServerCores.ContainsKey(baseLocation))
         {
             var serverCore = new ServerCore(baseLocation, QueryCache, PersistenceType);
             if (preloadConfiguration != null)
             {
                 serverCore.Warmup(preloadConfiguration);
             }
             ServerCores.Add(baseLocation, serverCore);
         }
         return(ServerCores[baseLocation]);
     }
 }
Esempio n. 8
0
 public static ServerCore GetServerCore(string baseLocation, PageCachePreloadConfiguration preloadConfiguration)
 {
     lock (UpdateLock)
     {
         if (!ServerCores.ContainsKey(baseLocation))
         {
             var serverCore = new ServerCore(baseLocation, QueryCache, PersistenceType);
             if (preloadConfiguration != null)
             {
                 serverCore.Warmup(preloadConfiguration);
             }
             ServerCores.Add(baseLocation, serverCore);
         }
         return ServerCores[baseLocation];
     }
 }
 public static ServerCore GetServerCore(string baseLocation, EmbeddedServiceConfiguration serviceConfiguration)
 {
     lock (UpdateLock)
     {
         if (!ServerCores.ContainsKey(baseLocation))
         {
             var serverCore = new ServerCore(baseLocation, QueryCache, PersistenceType, serviceConfiguration.EnableTransactionLoggingOnNewStores);
             if (serviceConfiguration != null && serviceConfiguration.PreloadConfiguration != null)
             {
                 serverCore.Warmup(serviceConfiguration.PreloadConfiguration);
             }
             ServerCores.Add(baseLocation, serverCore);
         }
         return(ServerCores[baseLocation]);
     }
 }
Esempio n. 10
0
 public static ServerCore GetServerCore(string baseLocation, EmbeddedServiceConfiguration serviceConfiguration)
 {
     lock (UpdateLock)
     {
         if (!ServerCores.ContainsKey(baseLocation))
         {
             var serverCore = new ServerCore(baseLocation, QueryCache, PersistenceType, serviceConfiguration.EnableTransactionLoggingOnNewStores);
             if (serviceConfiguration != null && serviceConfiguration.PreloadConfiguration != null)
             {
                 serverCore.Warmup(serviceConfiguration.PreloadConfiguration);
             }
             ServerCores.Add(baseLocation, serverCore);
         }
         return ServerCores[baseLocation];
     }
 }
 /// <summary>
 /// Create a new instance of the service that attaches to the specified directory location
 /// </summary>
 /// <param name="baseLocation">The full path to the location of the directory that contains one or more Brightstar stores</param>
 /// <param name="serviceConfigurationOptions">OPTIONAL: Additional configuration options that apply only when creating an embedded service instance.</param>
 /// <remarks>The embedded server is thread-safe but doesn't support concurrent access to the same base location by multiple
 /// instances. You should ensure in your code that only one EmbeddedBrightstarService instance is connected to any given base location
 /// at a given time.</remarks>
 public EmbeddedBrightstarService(string baseLocation, EmbeddedServiceConfiguration serviceConfigurationOptions)
 {
     _serverCore = ServerCoreManager.GetServerCore(
         baseLocation,
         serviceConfigurationOptions ?? Configuration.EmbeddedServiceConfiguration);
 }
 /// <summary>
 /// Create a new instance of the service that attaches to the specified directory location
 /// </summary>
 /// <param name="baseLocation">The full path to the location of the directory that contains one or more Brightstar stores</param>
 /// <remarks>The embedded server is thread-safe but doesn't support concurrent access to the same base location by multiple
 /// instances. You should ensure in your code that only one EmbeddedBrightstarService instance is connected to any given base location
 /// at a given time.</remarks>
 public EmbeddedBrightstarService(string baseLocation)
 {
     _serverCore = ServerCoreManager.GetServerCore(baseLocation);
 }
 /// <summary>
 /// Create a new instance of the service that attaches to the specified directory location
 /// </summary>
 /// <param name="baseLocation">The full path to the location of the directory that contains one or more Brightstar stores</param>
 /// <param name="clientConfiguration">An optional configuration for the client.</param>
 /// <remarks>The embedded server is thread-safe but doesn't support concurrent access to the same base location by multiple
 /// instances. You should ensure in your code that only one EmbeddedBrightstarService instance is connected to any given base location
 /// at a given time.</remarks>
 public EmbeddedBrightstarService(string baseLocation, ClientConfiguration clientConfiguration = null)
 {
     _serverCore = ServerCoreManager.GetServerCore(
         baseLocation, 
         clientConfiguration == null ? null : clientConfiguration.PreloadConfiguration);
 }