Exemplo n.º 1
0
        /// <summary>
        /// This method should be called when using an embedded Brightstar clients when a program is about to terminate. This ensures
        /// all job threads are properly terminated and the application can exit.
        /// </summary>
        /// <param name="allowJobsToConclude">If true all stores will complete any registered jobs. If false, only the current
        /// running job is allowed to conclude and all other queued jobs are lost.</param>
        public static void Shutdown(bool allowJobsToConclude = true)
        {
            ServerCoreManager.Shutdown(allowJobsToConclude);
#if PORTABLE
            // Ensure the background log file writer is shutdown cleanly
            Logging.Shutdown();
#endif
        }
Exemplo n.º 2
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>();
 }
 /// <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;
 }
        /// <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;
        }
Exemplo n.º 5
0
 /// <summary>
 /// This method should be called when using an embedded Brightstar clients when a program is about to terminate. This ensures
 /// all job threads are properly terminated and the application can exit.
 /// </summary>
 /// <param name="allowJobsToConclude">If true all stores will complete any registered jobs. If false, only the current
 /// running job is allowed to conclude and all other queued jobs are lost.</param>
 public static void Shutdown(bool allowJobsToConclude = true)
 {
     ServerCoreManager.Shutdown(allowJobsToConclude);
 }
 /// <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);
 }
Exemplo n.º 7
0
        /// <summary>
        /// This method should be called when using an embedded Brightstar clients when a program is about to terminate. This ensures
        /// all job threads are properly terminated and the application can exit.
        /// </summary>
        /// <param name="allowJobsToConclude">If true all stores will complete any registered jobs. If false, only the current
        /// running job is allowed to conclude and all other queued jobs are lost.</param>
        public static void Shutdown(bool allowJobsToConclude = true)
        {
#if !REST_CLIENT
            ServerCoreManager.Shutdown(allowJobsToConclude);
#endif
        }