Example #1
0
        /// <summary>
        ///     Remove the <see cref="IGridionServer" /> server from the list of registered instances.
        /// </summary>
        /// <param name="server">
        ///     The server to stop.
        /// </param>
        private static void UnRegister(IGridionServer server)
        {
            Should.NotBeNull(server, nameof(server));

            lock (LockObject)
            {
                TcpListeners.Remove(server.Id);
            }
        }
Example #2
0
                ///// <summary>
                /////     The collection of initiated lists on the node.
                ///// </summary>
                // private readonly ConcurrentDictionary<string, object> listMap = new ConcurrentDictionary<string, object>();

                ///// <summary>
                /////     The collection of initiated queue on the node.
                ///// </summary>
                // private readonly ConcurrentDictionary<string, object> queueMap = new ConcurrentDictionary<string, object>();

                ///// <summary>
                /////     The collection of initiated sets on the node.
                ///// </summary>
                // private readonly ConcurrentDictionary<string, object> setMap = new ConcurrentDictionary<string, object>();

                /// <summary>
                ///     Initializes a new instance of the <see cref="Node" /> class.
                /// </summary>
                /// <param name="configuration">The server configuration.</param>
                /// <param name="curator">The cluster curator.</param>
                /// <param name="logger">The logger.</param>
                /// <exception cref="Exceptions.GridionException">
                ///     When there are presented some issues with server initialization then a <see cref="Exceptions.GridionException" />
                ///     is thrown.
                /// </exception>
                internal Node(ServerConfiguration configuration, IClusterCurator curator, ILogger logger)
                {
                    Should.NotBeNull(configuration, nameof(configuration));
                    Should.NotBeNull(curator, nameof(curator));
                    Should.NotBeNull(logger, nameof(logger));

                    this.gridionServer       = GridionServerFactory.RegisterNewServer(configuration);
                    this.inMessengerService  = new MemoryMessengerService();
                    this.outMessengerService = new MemoryMessengerService();
                    this.curator             = curator;
                    this.logger = logger;
                    this.id     = Guid.NewGuid();
                }
Example #3
0
        ///// <summary>
        /////     The collection of initiated lists on the node.
        ///// </summary>
        // private readonly ConcurrentDictionary<string, object> listMap = new ConcurrentDictionary<string, object>();

        ///// <summary>
        /////     The collection of initiated queue on the node.
        ///// </summary>
        // private readonly ConcurrentDictionary<string, object> queueMap = new ConcurrentDictionary<string, object>();

        ///// <summary>
        /////     The collection of initiated sets on the node.
        ///// </summary>
        // private readonly ConcurrentDictionary<string, object> setMap = new ConcurrentDictionary<string, object>();

        /// <summary>
        ///     Initializes a new instance of the <see cref="Node" /> class.
        /// </summary>
        /// <param name="configuration">The server configuration.</param>
        /// <param name="curator">The cluster curator.</param>
        /// <param name="logger">The logger.</param>
        /// <exception cref="GridionException">
        ///     When there are presented some issues with server initialization then a <see cref="GridionException" /> is thrown.
        /// </exception>
        public Node(
            GridionServerConfiguration configuration,
            IClusterCurator curator,
            ILogger logger)
        {
            Should.NotBeNull(configuration, nameof(configuration));
            Should.NotBeNull(curator, nameof(curator));
            Should.NotBeNull(logger, nameof(logger));

            this.gridionServer       = GridionServerFactory.RegisterNewServer(configuration);
            this.inMessengerService  = new MemoryMessengerService(curator);
            this.outMessengerService = new MemoryMessengerService(curator);
            this.logger = logger;
        }