/// <summary> /// Initializes a new instance of the <see cref="GridionInternal" /> class. /// </summary> /// <param name="nodeConfiguration"> /// The configuration of <see cref="IGridion" /> instance. /// </param> /// <param name="curator"> /// The cluster curator. /// </param> internal GridionInternal(NodeConfiguration nodeConfiguration, IClusterCurator curator) { Should.NotBeNull(nodeConfiguration, nameof(nodeConfiguration)); nodeConfiguration.Validate(); this.nodeConfiguration = nodeConfiguration; this.node = new Node(nodeConfiguration.ServerConfiguration, curator, new ConsoleLogger()); }
/// <summary> /// Initializes a new instance of the <see cref="GridionInternal" /> class. /// </summary> /// <param name="configuration"> /// The configuration of <see cref="IGridion" /> instance. /// </param> /// <param name="curator"> /// The cluster curator. /// </param> internal GridionInternal(GridionConfiguration configuration, IClusterCurator curator) { GridionConfigurationValidator.Validate(configuration); this.configuration = configuration; this.node = new Node( configuration.ServerConfiguration, curator, new ConsoleLogger()); }
///// <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(); }
///// <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; }
/// <inheritdoc cref="GridionService" /> public MemoryMessengerService(IClusterCurator curator) : base("MemoryMessengerService") { this.curator = curator; }
/// <summary>Creates a new <see cref="IGridionInternal" /> instance.</summary> /// <param name="nodeConfiguration">The configuration of the instance.</param> /// <param name="curator">The cluster curator.</param> /// <returns>an initialized instance.</returns> private static IGridionInternal CreateNew(NodeConfiguration nodeConfiguration, IClusterCurator curator) { return(new GridionInternal(nodeConfiguration, curator)); }