private Task <DynamoDBGrainStorage> InitDynamoDBGrainStorage(bool useJson = false)
        {
            var options = new DynamoDBStorageOptions
            {
                Service = AWSTestConstants.Service,
                UseJson = useJson
            };

            return(InitDynamoDBGrainStorage(options));
        }
        private async Task <DynamoDBGrainStorage> InitDynamoDBGrainStorage(DynamoDBStorageOptions options)
        {
            DynamoDBGrainStorage  store     = ActivatorUtilities.CreateInstance <DynamoDBGrainStorage>(this.providerRuntime.ServiceProvider, "StorageProviderTests", options);
            ISiloLifecycleSubject lifecycle = ActivatorUtilities.CreateInstance <SiloLifecycleSubject>(this.providerRuntime.ServiceProvider, NullLogger <SiloLifecycleSubject> .Instance);

            store.Participate(lifecycle);
            await lifecycle.OnStart();

            return(store);
        }
Esempio n. 3
0
        /// <summary>
        /// Default Constructor
        /// </summary>
        public DynamoDBGrainStorage(string name, DynamoDBStorageOptions options, SerializationManager serializationManager,
                                    IGrainFactory grainFactory, ITypeResolver typeResolver, ILoggerFactory loggerFactory)
        {
            this.name          = name;
            this.loggerFactory = loggerFactory;
            var loggerName = $"{typeof(DynamoDBGrainStorage).FullName}.{name}";

            this.logger  = loggerFactory.CreateLogger(loggerName);
            this.options = options;
            this.serializationManager = serializationManager;
            this.grainFactory         = grainFactory;
            this.typeResolver         = typeResolver;
        }
        private async Task <DynamoDBGrainStorage> InitDynamoDBTableStorageProvider(IProviderRuntime runtime, string storageName)
        {
            var options = new DynamoDBStorageOptions();

            options.Service = AWSTestConstants.Service;

            DynamoDBGrainStorage  store     = ActivatorUtilities.CreateInstance <DynamoDBGrainStorage>(runtime.ServiceProvider, options);
            ISiloLifecycleSubject lifecycle = ActivatorUtilities.CreateInstance <SiloLifecycleSubject>(runtime.ServiceProvider, new LifecycleSubject(null));

            store.Participate(lifecycle);
            await lifecycle.OnStart();

            return(store);
        }
 /// <summary>
 /// Default Constructor
 /// </summary>
 public DynamoDBGrainStorage(
     string name,
     DynamoDBStorageOptions options,
     SerializationManager serializationManager,
     IGrainFactory grainFactory,
     ITypeResolver typeResolver,
     ILogger <DynamoDBGrainStorage> logger)
 {
     this.name    = name;
     this.logger  = logger;
     this.options = options;
     this.serializationManager = serializationManager;
     this.grainFactory         = grainFactory;
     this.typeResolver         = typeResolver;
 }
Esempio n. 6
0
 /// <summary>
 /// Default Constructor
 /// </summary>
 public DynamoDBGrainStorage(
     string name,
     DynamoDBStorageOptions options,
     SerializationManager serializationManager,
     IServiceProvider serviceProvider,
     GrainReferenceKeyStringConverter grainReferenceConverter,
     ILogger <DynamoDBGrainStorage> logger)
 {
     this.name    = name;
     this.logger  = logger;
     this.options = options;
     this.serializationManager    = serializationManager;
     this.serviceProvider         = serviceProvider;
     this.grainReferenceConverter = grainReferenceConverter;
 }