Exemplo n.º 1
0
        public EmbeddedConfigurator Assemblies(params Assembly[] assemblies)
        {
            Requires.NotNull(assemblies, nameof(assemblies));

            if (assemblies.Length == 0)
            {
                throw new ArgumentException("Assemblies length should be greater than 0", nameof(assemblies));
            }

            foreach (var assembly in assemblies)
            {
                if (this.assemblies.Contains(assembly))
                {
                    throw new ArgumentException($"Assembly {assembly.FullName} has been already registered");
                }

                this.assemblies.Add(assembly);
            }

            foreach (var type in assemblies.SelectMany(x => x.ActorTypes()))
            {
                var mapping = ActorInterfaceMapping.Of(type);
                if (!interfaces.Add(mapping))
                {
                    throw new ArgumentException($"Actor type '{mapping.Name}' has been already registered");
                }
            }

            client.Register(assemblies, interfaces);
            cluster.Assemblies(assemblies);

            return(this);
        }
Exemplo n.º 2
0
 public EmbeddedConfigurator Register(params Assembly[] assemblies)
 {
     client.Register(assemblies);
     cluster.Register(assemblies);
     return(this);
 }
Exemplo n.º 3
0
 public EmbeddedConfigurator Register <T>(string name, IDictionary <string, string> properties = null) where T : IStreamProviderImpl
 {
     cluster.Register <T>(name, properties);
     client.Register <T>(name, properties);
     return(this);
 }