コード例 #1
0
ファイル: Remoting.cs プロジェクト: rodrigovidal/akka.net
 public Remoting(ExtendedActorSystem system, RemoteActorRefProvider provider)
     : base(system, provider)
 {
     log = Logging.GetLogger(system, "remoting");
     _eventPublisher = new EventPublisher(system, log, Logging.LogLevelFor(provider.RemoteSettings.RemoteLifecycleEventsLogLevel));
     _transportSupervisor = system.SystemActorOf(Props.Create<TransportSupervisor>(), "transports");
 }
コード例 #2
0
        public MemoryEventAdaptersSpec()
        {
            var config = ConfigurationFactory.ParseString(@"
akka.persistence.journal {
  plugin = ""akka.persistence.journal.inmem""


  # adapters defined for all plugins
  common-event-adapter-bindings {
  }

  inmem {
    # showcases re-using and concating configuration of adapters

    event-adapters {
      example  = """ + typeof (ExampleEventAdapter).FullName + @", Akka.Persistence.Tests""
      marker   = """ + typeof (MarkerInterfaceAdapter).FullName + @", Akka.Persistence.Tests""
      precise  = """ + typeof (PreciseAdapter).FullName + @", Akka.Persistence.Tests""
      reader  = """ + typeof (ReaderAdapter).FullName + @", Akka.Persistence.Tests""
      writer  = """ + typeof (WriterAdapter).FullName + @", Akka.Persistence.Tests""
    }
    event-adapter-bindings = {
      """ + typeof (IEventMarkerInterface).FullName + @", Akka.Persistence.Tests"" = marker
      ""System.String"" = example
      """ + typeof (PreciseAdapterEvent).FullName + @", Akka.Persistence.Tests"" = precise
      """ + typeof (ReadMeEvent).FullName + @", Akka.Persistence.Tests"" = reader
      """ + typeof (WriteMeEvent).FullName + @", Akka.Persistence.Tests"" = writer
    }
  }
}").WithFallback(ConfigurationFactory.Load());

            _extendedActorySystem = (ExtendedActorSystem) Sys;
            _memoryConfig = config.GetConfig("akka.persistence.journal.inmem");
        }
コード例 #3
0
        public DefaultSessionManager(ExtendedActorSystem system)
        {
            if (system == null) throw new ArgumentNullException("system");

            // Read configuration sections
            _sessionConfigs = system.Settings.Config.GetConfig("cassandra-sessions");

            _sessionCache = new ConcurrentDictionary<string, Lazy<ISession>>();
        }
コード例 #4
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="NewtonSoftJsonSerializer" /> class.
 /// </summary>
 /// <param name="system">The system.</param>
 public NewtonSoftJsonSerializer(ExtendedActorSystem system)
     : base(system)
 {
     //TODO: we should use an instanced serializer to be threadsafe for other ActorSystems
     JsonConvert.DefaultSettings = () => new JsonSerializerSettings
     {
         Converters = new List<JsonConverter> { new ActorRefConverter() }
     };
 }
コード例 #5
0
 public ClusterSingletonMessageSerializer(ExtendedActorSystem system) : base(system)
 {
     _identifier = SerializerIdentifierHelper.GetSerializerIdentifierFromConfig(this.GetType(), system);
     _fromBinaryMap = new Dictionary<string, Func<byte[], IClusterSingletonMessage>>
     {
         {HandOverToMeManifest, _ => HandOverToMe.Instance},
         {HandOverInProgressManifest, _ => HandOverInProgress.Instance},
         {HandOverDoneManifest, _ => HandOverDone.Instance},
         {TakeOverFromMeManifest, _ => TakeOverFromMe.Instance}
     };
 }
コード例 #6
0
 public ClusterClientMessageSerializer(ExtendedActorSystem system) : base(system)
 {
     Identifier = SerializerIdentifierHelper.GetSerializerIdentifierFromConfig(GetType(), system);
     _fromBinaryMap = new Dictionary<string, Func<byte[], IClusterClientMessage>>
     {
         {ContactsManifest, ContactsFromBinary},
         {GetContactsManifest, _ => ClusterReceptionist.GetContacts.Instance},
         {HeartbeatManifest, _ => ClusterReceptionist.Heartbeat.Instance},
         {HeartbeatRspManifest, _ => ClusterReceptionist.HeartbeatRsp.Instance}
     };
 }
コード例 #7
0
 public DistributedPubSubMessageSerializer(ExtendedActorSystem system) : base(system)
 {
     _identifier = SerializerIdentifierHelper.GetSerializerIdentifierFromConfig(this.GetType(), system);
     _fromBinaryMap = new Dictionary<string, Func<byte[], object>>
     {
         {StatusManifest, StatusFromBinary},
         {DeltaManifest, DeltaFromBinary},
         {SendManifest, SendFromBinary},
         {SendToAllManifest, SendToAllFromBinary},
         {PublishManifest, PublishFromBinary}
     };
 }
コード例 #8
0
        public Serialization(ExtendedActorSystem system)
        {
            System = system;

            _nullSerializer = new NullSerializer(system);
            _serializers.Add(_nullSerializer.Identifier,_nullSerializer);

            var serializersConfig = system.Settings.Config.GetConfig("akka.actor.serializers").AsEnumerable().ToList();
            var serializerBindingConfig = system.Settings.Config.GetConfig("akka.actor.serialization-bindings").AsEnumerable().ToList();
            var namedSerializers = new Dictionary<string, Serializer>();
            foreach (var kvp in serializersConfig)
            {
                var serializerTypeName = kvp.Value.GetString();
                var serializerType = Type.GetType(serializerTypeName);
                if (serializerType == null)
                {
                    system.Log.Warn(string.Format("The type name for serializer '{0}' did not resolve to an actual Type: '{1}'",
                            kvp.Key, serializerTypeName));
                    continue;
                }

                var serializer = (Serializer)Activator.CreateInstance(serializerType,system);
                _serializers.Add(serializer.Identifier, serializer);
                namedSerializers.Add(kvp.Key,serializer);
            }

            foreach (var kvp in serializerBindingConfig)
            {
                var typename = kvp.Key;
                var serializerName = kvp.Value.GetString();
                var messageType = Type.GetType(typename);

                if (messageType == null)
                {

                    system.Log.Warn(string.Format(
                            "The type name for message/serializer binding '{0}' did not resolve to an actual Type: '{1}'",
                            serializerName, typename));
                    continue;
                }

                var serializer = namedSerializers[serializerName];
                if (serializer == null)
                {
                    system.Log.Warn(string.Format(
                            "Serialization binding to non existing serializer: '{0}'", serializerName));
                    continue;
                }
                _serializerMap.Add(messageType,serializer);
            }
        }
コード例 #9
0
        public MongoDbPersistence(ExtendedActorSystem system)
        {
            if (system == null)
                throw new ArgumentNullException(nameof(system));

            // Initialize fallback configuration defaults
            system.Settings.InjectTopLevelFallback(DefaultConfiguration());

            // Read config
            var journalConfig = system.Settings.Config.GetConfig("akka.persistence.journal.mongodb");
            JournalSettings = new MongoDbJournalSettings(journalConfig);

            var snapshotConfig = system.Settings.Config.GetConfig("akka.persistence.snapshot-store.mongodb");
            SnapshotStoreSettings = new MongoDbSnapshotSettings(snapshotConfig);
        }
コード例 #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NewtonSoftJsonSerializer" /> class.
 /// </summary>
 /// <param name="system">The actor system to associate with this serializer. </param>
 public NewtonSoftJsonSerializer(ExtendedActorSystem system)
     : base(system)
 {
     _settings = new JsonSerializerSettings
     {
         PreserveReferencesHandling = PreserveReferencesHandling.Objects,
         Converters = new List<JsonConverter> {new SurrogateConverter(system)},
         NullValueHandling = NullValueHandling.Ignore,
         DefaultValueHandling = DefaultValueHandling.Ignore,
         MissingMemberHandling = MissingMemberHandling.Ignore,
         ObjectCreationHandling = ObjectCreationHandling.Replace, //important: if reuse, the serializer will overwrite properties in default references, e.g. Props.DefaultDeploy or Props.noArgs
         ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
         TypeNameHandling = TypeNameHandling.All,
         ContractResolver = new AkkaContractResolver(),
     };
 }
コード例 #11
0
        public CassandraExtension(ExtendedActorSystem system)
        {
            if (system == null) throw new ArgumentNullException("system");
            
            // Initialize fallback configuration defaults
            system.Settings.InjectTopLevelFallback(CassandraPersistence.DefaultConfig());

            // Get or add the session manager
            SessionManager = CassandraSession.Instance.Apply(system);
            
            // Read config
            var journalConfig = system.Settings.Config.GetConfig("cassandra-journal");
            JournalSettings = new CassandraJournalSettings(journalConfig);

            var snapshotConfig = system.Settings.Config.GetConfig("cassandra-snapshot-store");
            SnapshotStoreSettings = new CassandraSnapshotStoreSettings(snapshotConfig);
        }
コード例 #12
0
        public WireSerializer(ExtendedActorSystem system) : base(system)
        {
            var akkaSurrogate = 
                Surrogate
                .Create<ISurrogated, ISurrogate>(
                from => from.ToSurrogate(system),
                to => to.FromSurrogate(system));

            _seralizer =
                new Wire.Serializer(new SerializerOptions(
                    preserveObjectReferences: true, 
                    versionTolerance: true,
                    surrogates: new[]
                    {
                        akkaSurrogate
                    }));
        }
コード例 #13
0
        public MongoDbExtension(ExtendedActorSystem system)
        {
            if (system == null)
                throw new ArgumentNullException("system");

            // Initialize fallback configuration defaults
            system.Settings.InjectTopLevelFallback(MongoDbPersistence.DefaultConfig());

            // Read config
            var journalConfig = system.Settings.Config.GetConfig("akka.persistence.journal.mongodb");
            JournalSettings = new MongoDbJournalSettings(journalConfig);

            var snapshotConfig = system.Settings.Config.GetConfig("akka.persistence.snapshot-store.mongodb");
            SnapshotStoreSettings = new MongoDbSnapshotSettings(snapshotConfig);

            // Create collections
            var connectionString = new MongoUrl(JournalSettings.ConnectionString);
            var client = new MongoClient(connectionString);
            var journalDatabase = client.GetDatabase(connectionString.DatabaseName);

            JournalCollection = journalDatabase.GetCollection<JournalEntry>(JournalSettings.Collection);
            JournalCollection.Indexes.CreateOneAsync(
                Builders<JournalEntry>.IndexKeys.Ascending(entry => entry.PersistenceId)
                    .Descending(entry => entry.SequenceNr)).Wait();

            var snapshotDatabase = journalDatabase;
            // We only need another client if the connection strings aren't equal, 
            // because the MongoClient uses the same connection pool for all instances which have the same connection string
            if (!JournalSettings.ConnectionString.Equals(SnapshotStoreSettings.ConnectionString))
            {
                connectionString = new MongoUrl(SnapshotStoreSettings.ConnectionString);
                client = new MongoClient(connectionString);
                snapshotDatabase = client.GetDatabase(connectionString.DatabaseName);
            }

            SnapshotCollection = snapshotDatabase.GetCollection<SnapshotEntry>(SnapshotStoreSettings.Collection);
            SnapshotCollection.Indexes.CreateOneAsync(
                Builders<SnapshotEntry>.IndexKeys.Ascending(entry => entry.PersistenceId)
                    .Descending(entry => entry.SequenceNr)).Wait();
        }
コード例 #14
0
        public ClusterShardingMessageSerializer(ExtendedActorSystem system) : base(system)
        {
            _system = system;
            _identifier = SerializerIdentifierHelper.GetSerializerIdentifierFromConfig(this.GetType(), system);

            _fromBinaryMap = new Dictionary<string, Func<byte[], object>>
            {
                {EntityStateManifest, EntityStateFromBinary},
                {EntityStartedManifest, EntityStartedFromBinary},
                {EntityStoppedManifest, EntityStoppedFromBinary},

                {CoordinatorStateManifest, CoordinatorStateFromBinary},
                {ShardRegionRegisteredManifest, bytes => new PersistentShardCoordinator.ShardRegionRegistered(ActorRefMessageFromBinary(bytes)) },
                {ShardRegionProxyRegisteredManifest, bytes => new PersistentShardCoordinator.ShardRegionProxyRegistered(ActorRefMessageFromBinary(bytes)) },
                {ShardRegionTerminatedManifest, bytes => new PersistentShardCoordinator.ShardRegionTerminated(ActorRefMessageFromBinary(bytes)) },
                {ShardRegionProxyTerminatedManifest, bytes => new PersistentShardCoordinator.ShardRegionProxyTerminated(ActorRefMessageFromBinary(bytes)) },
                {ShardHomeAllocatedManifest, ShardHomeAllocatedFromBinary},
                {ShardHomeDeallocatedManifest, bytes => new PersistentShardCoordinator.ShardHomeDeallocated(ShardIdMessageFromBinary(bytes)) },

                {RegisterManifest, bytes => new PersistentShardCoordinator.Register(ActorRefMessageFromBinary(bytes)) },
                {RegisterProxyManifest, bytes => new PersistentShardCoordinator.RegisterProxy(ActorRefMessageFromBinary(bytes)) },
                {RegisterAckManifest, bytes => new PersistentShardCoordinator.RegisterAck(ActorRefMessageFromBinary(bytes)) },
                {GetShardHomeManifest, bytes => new PersistentShardCoordinator.GetShardHome(ShardIdMessageFromBinary(bytes)) },
                {ShardHomeManifest, ShardHomeFromBinary},
                {HostShardManifest, bytes => new PersistentShardCoordinator.HostShard(ShardIdMessageFromBinary(bytes)) },
                {ShardStartedManifest, bytes => new PersistentShardCoordinator.ShardStarted(ShardIdMessageFromBinary(bytes)) },
                {BeginHandOffManifest, bytes => new PersistentShardCoordinator.BeginHandOff(ShardIdMessageFromBinary(bytes)) },
                {BeginHandOffAckManifest, bytes => new PersistentShardCoordinator.BeginHandOffAck(ShardIdMessageFromBinary(bytes)) },
                {HandOffManifest, bytes => new PersistentShardCoordinator.HandOff(ShardIdMessageFromBinary(bytes)) },
                {ShardStoppedManifest, bytes => new PersistentShardCoordinator.ShardStopped(ShardIdMessageFromBinary(bytes)) },
                {GracefulShutdownReqManifest, bytes => new PersistentShardCoordinator.GracefulShutdownRequest(ActorRefMessageFromBinary(bytes)) },

                {GetShardStatsManifest, bytes => Shard.GetShardStats.Instance },
                {ShardStatsManifest, bytes => ShardStatsFromBinary(bytes)}
            };
        }
コード例 #15
0
 /// <summary>
 /// Creates an actor system extension for akka persistence Azure Storage support.
 /// </summary>
 /// <param name="system"></param>
 /// <returns></returns>
 public override EventStorePersistenceExtension CreateExtension(ExtendedActorSystem system)
 {
     return(new EventStorePersistenceExtension(system));
 }
コード例 #16
0
 public FailureInjectorTransportAdapter(Transport wrappedTransport, ExtendedActorSystem extendedActorSystem) : base(wrappedTransport)
 {
     ExtendedActorSystem = extendedActorSystem;
     _log = Logging.GetLogger(ExtendedActorSystem, this);
     _shouldDebugLog = ExtendedActorSystem.Settings.Config.GetBoolean("akka.remote.gremlin.debug");
 }
コード例 #17
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="system">TBD</param>
 /// <returns>TBD</returns>
 public override DistributedPubSub CreateExtension(ExtendedActorSystem system)
 {
     return(new DistributedPubSub(system));
 }
コード例 #18
0
ファイル: Serializer.cs プロジェクト: supadmins/akka.net
 /// <summary>
 ///     Initializes a new instance of the <see cref="Serializer" /> class.
 /// </summary>
 /// <param name="system">The actor system to associate with this serializer. </param>
 public Serializer(ExtendedActorSystem system)
 {
     this.system = system;
 }
コード例 #19
0
ファイル: NullSerializer.cs プロジェクト: Micha-kun/akka.net
 /// <summary>
 /// Initializes a new instance of the <see cref="NullSerializer" /> class.
 /// </summary>
 /// <param name="system">The actor system to associate with this serializer. </param>
 public NullSerializer(ExtendedActorSystem system)
     : base(system)
 {
 }
コード例 #20
0
 public DaemonMsgCreateSerializer(ExtendedActorSystem system) : base(system)
 {
 }
コード例 #21
0
ファイル: TestSerializers.cs プロジェクト: Micha-kun/akka.net
 public MySnapshotSerializer(ExtendedActorSystem system) : base(system)
 {
 }
コード例 #22
0
 public DebugHyperionSerializer(ExtendedActorSystem system) : base(system)
 {
 }
コード例 #23
0
 public override ServiceProviderExtension CreateExtension(ExtendedActorSystem system) =>
 new ServiceProviderExtension();
コード例 #24
0
        //TODO:
        //override def lookup = TestConductor

        public override TestConductor CreateExtension(ExtendedActorSystem system)
        {
            return(new TestConductor(system));
        }
コード例 #25
0
 public override SqlServerPersistence CreateExtension(ExtendedActorSystem system)
 {
     return(new SqlServerPersistence(system));
 }
コード例 #26
0
 public override ActorPathThreadLocalCache CreateExtension(ExtendedActorSystem system)
 {
     return(new ActorPathThreadLocalCache());
 }
コード例 #27
0
 public WrappedPayloadSupport(ExtendedActorSystem system)
 {
     _system = system;
 }
コード例 #28
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProtobufSerializer"/> class.
 /// </summary>
 /// <param name="system">The actor system to associate with this serializer. </param>
 public ProtobufSerializer(ExtendedActorSystem system) : base(system)
 {
 }
コード例 #29
0
ファイル: TestSerializers.cs プロジェクト: Micha-kun/akka.net
 public OldPayloadSerializer(ExtendedActorSystem system) : base(system)
 {
 }
コード例 #30
0
ファイル: AddressCache.cs プロジェクト: jarlrasm/akka.net
 public override AddressThreadLocalCache CreateExtension(ExtendedActorSystem system)
 {
     return new AddressThreadLocalCache();
 }
コード例 #31
0
 public NewtonSoftJsonSerializer(ExtendedActorSystem system, Config config)
     : this(system, NewtonSoftJsonSerializerSettings.Create(config))
 {
 }
コード例 #32
0
 /// <summary>
 /// Creates the <see cref="AddressTerminatedTopic"/> extension using a given actor system.
 /// </summary>
 /// <param name="system">The actor system to use when creating the extension.</param>
 /// <returns>The extension created using the given actor system.</returns>
 public override AddressTerminatedTopic CreateExtension(ExtendedActorSystem system)
 {
     return(new AddressTerminatedTopic());
 }
コード例 #33
0
ファイル: Serializer.cs プロジェクト: rogeralsing/akka.net
        public static int GetSerializerIdentifierFromConfig(Type type, ExtendedActorSystem system)
        {
            var config = system.Settings.Config.GetConfig(SerializationIdentifiers);
            var identifiers = config.AsEnumerable()
                .ToDictionary(pair => Type.GetType(pair.Key, true), pair => pair.Value.GetInt());

            int value;
            if (identifiers.TryGetValue(type, out value))
            {
                return value;
            }
            else
            {
                throw new ArgumentException(string.Format("Couldn't find serializer id for [{0}] under [{1}] HOCON path", type, SerializationIdentifiers));
            }
        }
コード例 #34
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SerializerWithStringManifest"/> class.
 /// </summary>
 /// <param name="system">The actor system to associate with this serializer.</param>
 protected SerializerWithStringManifest(ExtendedActorSystem system) : base(system)
 {
 }
コード例 #35
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MessageContainerSerializer"/> class.
 /// </summary>
 /// <param name="system">The actor system to associate with this serializer. </param>
 public MessageContainerSerializer(ExtendedActorSystem system) : base(system)
 {
 }
コード例 #36
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Serializer" /> class.
 /// </summary>
 /// <param name="system">The actor system to associate with this serializer. </param>
 protected Serializer(ExtendedActorSystem system)
 {
     this.system = system;
     _value      = new FastLazy <int>(() => SerializerIdentifierHelper.GetSerializerIdentifierFromConfig(GetType(), system));
 }
コード例 #37
0
 public ShardedDaemonProcess(ExtendedActorSystem system) => _system = system;
コード例 #38
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="system">TBD</param>
 /// <returns>TBD</returns>
 public override TestKitAssertionsProvider CreateExtension(ExtendedActorSystem system)
 {
     return(new TestKitAssertionsProvider(_assertions));
 }
コード例 #39
0
 /// <summary>
 /// Creates an actor system extension for akka persistence MySql support.
 /// </summary>
 /// <param name="system"></param>
 /// <returns></returns>
 public override MySqlPersistence CreateExtension(ExtendedActorSystem system)
 {
     return(new MySqlPersistence(system));
 }
コード例 #40
0
ファイル: Cluster.cs プロジェクト: yildizoglu/akka.net
 /// <summary>
 /// Creates the cluster extension using a given actor system.
 /// </summary>
 /// <param name="system">The actor system to use when creating the extension.</param>
 /// <returns>The extension created using the given actor system.</returns>
 public override Cluster CreateExtension(ExtendedActorSystem system)
 {
     return(new Cluster((ActorSystemImpl)system));
 }
コード例 #41
0
 public Transport Create(Transport wrappedTransport, ExtendedActorSystem system)
 {
     return new FailureInjectorTransportAdapter(wrappedTransport, system);
 }
コード例 #42
0
 public override ClusterDiscovery CreateExtension(ExtendedActorSystem system)
 {
     return(new ClusterDiscovery(system));
 }
コード例 #43
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ByteArraySerializer" /> class.
 /// </summary>
 /// <param name="system"> The system. </param>
 public ByteArraySerializer(ExtendedActorSystem system)
     : base(system)
 {
 }
コード例 #44
0
 public DummyConfigurableSerializer(ExtendedActorSystem system)
     : base(system)
 {
 }
コード例 #45
0
 public ClusterClientMessageSerializer(ExtendedActorSystem system) : base(system)
 {
     _identifier = SerializerIdentifierHelper.GetSerializerIdentifierFromConfig(this.GetType(), system);
 }
コード例 #46
0
 public DummyConfigurableSerializer(ExtendedActorSystem system, Config config)
     : base(system)
 {
     Config = config;
 }
コード例 #47
0
ファイル: TestSerializers.cs プロジェクト: Micha-kun/akka.net
 public MyPayload2Serializer(ExtendedActorSystem system) : base(system)
 {
 }
コード例 #48
0
ファイル: DistributedData.cs プロジェクト: jarlrasm/akka.net
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="system">TBD</param>
 /// <returns>TBD</returns>
 public override DistributedData CreateExtension(ExtendedActorSystem system) => new DistributedData(system);
コード例 #49
0
 protected RemoteTransport(ExtendedActorSystem system, RemoteActorRefProvider provider)
 {
     System = system;
     Provider = provider;
 }
コード例 #50
0
 public DummySerializer(ExtendedActorSystem system)
     : base(system)
 {
 }
コード例 #51
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NewtonSoftJsonSerializer" /> class.
 /// </summary>
 /// <param name="system">The actor system to associate with this serializer. </param>
 public NewtonSoftJsonSerializer(ExtendedActorSystem system)
     : this(system, NewtonSoftJsonSerializerSettings.Default)
 {
 }
コード例 #52
0
 public override FailingTestExtensionImpl CreateExtension(ExtendedActorSystem system)
 {
     return(new FailingTestExtensionImpl(system));
 }
コード例 #53
0
ファイル: Serializer.cs プロジェクト: rogeralsing/akka.net
 protected SerializerWithStringManifest(ExtendedActorSystem system) : base(system)
 {
 }
コード例 #54
0
 public override OtherTestExtensionImpl CreateExtension(ExtendedActorSystem system)
 {
     return(new OtherTestExtensionImpl(system));
 }
コード例 #55
0
ファイル: Serializer.cs プロジェクト: rogeralsing/akka.net
 /// <summary>
 ///     Initializes a new instance of the <see cref="Serializer" /> class.
 /// </summary>
 /// <param name="system">The actor system to associate with this serializer. </param>
 public Serializer(ExtendedActorSystem system)
 {
     this.system = system;
 }
コード例 #56
0
ファイル: Remoting.cs プロジェクト: yunfan501/sonardotnet714
 public override RARP CreateExtension(ExtendedActorSystem system)
 {
     return(new RARP(system.Provider.AsInstanceOf <RemoteActorRefProvider>()));
 }
コード例 #57
0
        public static IMetricsCollector Get(ExtendedActorSystem system, ClusterSettings settings)
        {
            var fqcn = settings.MetricsCollectorClass;
            if (fqcn == typeof (PerformanceCounterMetricsCollector).AssemblyQualifiedName) return new PerformanceCounterMetricsCollector(system);
            
            var metricsCollectorClass = Type.GetType(fqcn);
            if (metricsCollectorClass == null)
            {
                throw new ConfigurationException(string.Format("Could not create custom metrics collector {0}", fqcn));
            }

            try
            {
                var metricsCollector = (IMetricsCollector) Activator.CreateInstance(metricsCollectorClass, system);
                return metricsCollector;
            }
            catch (Exception ex)
            {
                throw new ConfigurationException(string.Format("Could not create custom metrics collector {0} because: {1}", fqcn, ex.Message));
            }
        }
コード例 #58
0
 public override ShardedDaemonProcess CreateExtension(ExtendedActorSystem system) => new ShardedDaemonProcess(system);
コード例 #59
0
ファイル: SqlReadJournal.cs プロジェクト: wj60387/akka.net
 public SqlReadJournal(ExtendedActorSystem system, Config config)
 {
     _refreshInterval      = config.GetTimeSpan("refresh-interval");
     _writeJournalPluginId = config.GetString("write-plugin");
     _maxBufferSize        = config.GetInt("max-buffer-size");
 }
コード例 #60
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NullSerializer" /> class.
 /// </summary>
 /// <param name="system">The actor system to associate with this serializer. </param>
 public NullSerializer(ExtendedActorSystem system)
     : base(system)
 {
 }