public RavenPersistenceWireup(
     Wireup inner,
     string connectionName,
     IDocumentSerializer serializer,
     bool consistentQueries)
     : base(inner)
 {
     this.Container.Register(c => new RavenPersistenceFactory(
                                 connectionName,
                                 serializer,
                                 this.Container.Resolve <TransactionScopeOption>(),
                                 consistentQueries).Build());
 }
예제 #2
0
        public AsynchronousDispatchSchedulerWireup(Wireup wireup, IDispatchCommits dispatcher)
            : base(wireup)
        {
            var option = this.Container.Resolve <TransactionScopeOption>();

            if (option != TransactionScopeOption.Suppress)
            {
                Logger.Warn(Messages.SynchronousDispatcherTwoPhaseCommits);
            }

            Logger.Debug(Messages.AsyncDispatchSchedulerRegistered);
            this.DispatchTo(dispatcher ?? new NullDispatcher());
            this.Container.Register <IScheduleDispatches>(c => new AsynchronousDispatchScheduler(
                                                              c.Resolve <IDispatchCommits>(), c.Resolve <IPersistStreams>()));
        }
예제 #3
0
        public SqlPersistenceWireup(Wireup wireup, IConnectionFactory connectionFactory)
            : base(wireup)
        {
            Logger.Debug(Messages.ConnectionFactorySpecified, connectionFactory);

            Logger.Verbose(Messages.AutoDetectDialect);
            this.Container.Register <ISqlDialect>(c => null);            // auto-detect

            this.Container.Register(c => new SqlPersistenceFactory(
                                        connectionFactory,
                                        c.Resolve <ISerialize>(),
                                        c.Resolve <ISqlDialect>(),
                                        c.Resolve <TransactionScopeOption>(),
                                        this.pageSize).Build());
        }
예제 #4
0
        public MongoPersistenceWireup(Wireup inner, string connectionName, IDocumentSerializer serializer)
            : base(inner)
        {
            Logger.Debug("Configuring Mongo persistence engine.");

            var options = this.Container.Resolve <TransactionScopeOption>();

            if (options != TransactionScopeOption.Suppress)
            {
                Logger.Warn("MongoDB does not participate in transactions using TransactionScope.");
            }

            this.Container.Register(c => new MongoPersistenceFactory(
                                        connectionName,
                                        serializer).Build());
        }
예제 #5
0
        public RavenPersistenceWireup(Wireup inner)
            : base(inner)
        {
            Logger.Debug("Configuring Raven persistence engine.");

            this.Container.Register(c => new RavenConfiguration
            {
                Serializer        = this.ResolveSerializer(c),
                ScopeOption       = c.Resolve <TransactionScopeOption>(),
                ConsistentQueries = this.consistentQueries,
                MaxServerPageSize = this.maxServerPageSize,
                RequestedPageSize = this.pageSize,
                Partition         = this.partition,
            });

            this.Container.Register <IPersistStreams>(c => new RavenPersistenceEngine(getStoreAction(), c.Resolve <RavenConfiguration>()));
        }
예제 #6
0
        public RavenPersistenceWireup(Wireup inner, string connectionName)
            : base(inner)
        {
            Logger.Debug("Configuring Raven persistence engine.");

            this.Container.Register(c => new RavenConfiguration
            {
                Serializer        = this.ResolveSerializer(c),
                ScopeOption       = c.Resolve <TransactionScopeOption>(),
                ConsistentQueries = this.consistentQueries,
                MaxServerPageSize = this.maxServerPageSize,
                RequestedPageSize = this.pageSize,
                ConnectionName    = connectionName,
                DefaultDatabase   = this.defaultDatabase,
                Url = this.url
            });

            this.Container.Register(c => new RavenPersistenceFactory(c.Resolve <RavenConfiguration>()).Build());
        }
예제 #7
0
        public EventUpconverterWireup(Wireup wireup) : base(wireup)
        {
            Logger.Debug(Messages.EventUpconverterRegistered);

            this.Container.Register(c =>
            {
                if (this.registered.Count > 0)
                {
                    return(new EventUpconverterPipelineHook(this.registered));
                }

                if (!this.assembliesToScan.Any())
                {
                    this.assembliesToScan.AddRange(GetAllAssemblies());
                }

                var converters = GetConverters(this.assembliesToScan);
                return(new EventUpconverterPipelineHook(converters));
            });
        }
 public static PersistenceWireup UsingMongoPersistence(
     this Wireup wireup, string connectionName, IDocumentSerializer serializer)
 {
     return(new MongoPersistenceWireup(wireup, connectionName, serializer));
 }
        public static SqlPersistenceWireup UsingSqlPersistence(this Wireup wireup, string connectionName)
        {
            var factory = new ConfigurationConnectionFactory(connectionName);

            return(wireup.UsingSqlPersistence(factory));
        }
 public static SqlPersistenceWireup UsingSqlPersistence(this Wireup wireup, IConnectionFactory factory)
 {
     return(new SqlPersistenceWireup(wireup, factory));
 }
예제 #11
0
 public RavenPersistenceWireup(Wireup inner, Func <IDocumentStore> getStore)
     : this(inner)
 {
     getStoreAction = getStore;
 }
예제 #12
0
 public SerializationWireup(Wireup inner, ISerialize serializer)
     : base(inner)
 {
     this.Container.Register(serializer);
 }
 public static SynchronousDispatchSchedulerWireup UsingSynchronousDispatchScheduler(
     this Wireup wireup, IDispatchCommits dispatcher)
 {
     return(new SynchronousDispatchSchedulerWireup(wireup, dispatcher));
 }
 public static PersistenceWireup UsingRavenPersistence(
     this Wireup wireup, string connectionName, IDocumentSerializer serializer)
 {
     return(wireup.UsingRavenPersistence(connectionName, serializer, false));
 }
 public static PersistenceWireup UsingRavenPersistence(
     this Wireup wireup, string connectionName, IDocumentSerializer serializer, bool consistentQueries)
 {
     return(new RavenPersistenceWireup(wireup, connectionName, serializer, consistentQueries));
 }
예제 #16
0
 protected Wireup(Wireup inner)
 {
     this.inner = inner;
 }
예제 #17
0
		public static Wireup LogToConsoleWindow(this Wireup wireup)
		{
			return wireup.LogTo(type => new ConsoleWindowLogger(type));
		}
예제 #18
0
		public static Wireup LogTo(this Wireup wireup, Func<Type, ILog> logger)
		{
			LogFactory.BuildLogger = logger;
			return wireup;
		}
예제 #19
0
		public static Wireup LogToOutputWindow(this Wireup wireup)
		{
			return wireup.LogTo(type => new OutputWindowLogger(type));
		}
예제 #20
0
 public RavenPersistenceWireup(Wireup inner)
     : this(inner, string.Empty)
 {
 }
예제 #21
0
 public PersistenceWireup(Wireup inner)
     : base(inner)
 {
 }
예제 #22
0
 public PersistenceWireup(Wireup inner)
     : base(inner)
 {
     this.Container.Register(TransactionScopeOption.Suppress);
 }
 public static SynchronousDispatchSchedulerWireup UsingSynchronousDispatchScheduler(this Wireup wireup)
 {
     return(wireup.UsingSynchronousDispatchScheduler(null));
 }
예제 #24
0
 public static AsynchronousDispatcherWireup UsingAsynchronousDispatcher(this Wireup wireup)
 {
     return(wireup.UsingAsynchronousDispatcher(null));
 }
예제 #25
0
 public static AsynchronousDispatcherWireup UsingAsynchronousDispatcher(this Wireup wireup, IPublishMessages publisher)
 {
     return(new AsynchronousDispatcherWireup(wireup, publisher));
 }
예제 #26
0
 public RavenPersistenceWireup(Wireup inner, string connectionName)
     : this(inner)
 {
     getStoreAction = CreateStore;
     CreateWithConnectionStringName(connectionName);
 }
 public static Wireup UsingMongoPersistence(
     this Wireup wireup, string connectionName, IDocumentSerializer serializer)
 {
     wireup.With(new MongoPersistenceFactory(connectionName, serializer).Build());
     return(wireup);
 }
예제 #28
0
        public static PersistenceWireup UsingInMemoryPersistence(this Wireup wireup)
        {
            wireup.With <IPersistStreams>(new InMemoryPersistenceEngine());

            return(new PersistenceWireup(wireup));
        }