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());
 }
Beispiel #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>()));
        }
Beispiel #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());
        }
Beispiel #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());
        }
        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>()));
        }
Beispiel #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());
        }
Beispiel #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));
 }
 public RavenPersistenceWireup(Wireup inner, Func <IDocumentStore> getStore)
     : this(inner)
 {
     getStoreAction = getStore;
 }
Beispiel #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));
 }
Beispiel #16
0
 protected Wireup(Wireup inner)
 {
     this.inner = inner;
 }
		public static Wireup LogToConsoleWindow(this Wireup wireup)
		{
			return wireup.LogTo(type => new ConsoleWindowLogger(type));
		}
		public static Wireup LogTo(this Wireup wireup, Func<Type, ILog> logger)
		{
			LogFactory.BuildLogger = logger;
			return wireup;
		}
		public static Wireup LogToOutputWindow(this Wireup wireup)
		{
			return wireup.LogTo(type => new OutputWindowLogger(type));
		}
 public RavenPersistenceWireup(Wireup inner)
     : this(inner, string.Empty)
 {
 }
Beispiel #21
0
 public PersistenceWireup(Wireup inner)
     : base(inner)
 {
 }
 public PersistenceWireup(Wireup inner)
     : base(inner)
 {
     this.Container.Register(TransactionScopeOption.Suppress);
 }
 public static SynchronousDispatchSchedulerWireup UsingSynchronousDispatchScheduler(this Wireup wireup)
 {
     return(wireup.UsingSynchronousDispatchScheduler(null));
 }
Beispiel #24
0
 public static AsynchronousDispatcherWireup UsingAsynchronousDispatcher(this Wireup wireup)
 {
     return(wireup.UsingAsynchronousDispatcher(null));
 }
Beispiel #25
0
 public static AsynchronousDispatcherWireup UsingAsynchronousDispatcher(this Wireup wireup, IPublishMessages publisher)
 {
     return(new AsynchronousDispatcherWireup(wireup, publisher));
 }
 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);
 }
Beispiel #28
0
        public static PersistenceWireup UsingInMemoryPersistence(this Wireup wireup)
        {
            wireup.With <IPersistStreams>(new InMemoryPersistenceEngine());

            return(new PersistenceWireup(wireup));
        }