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

            return(new PersistenceWireup(wireup));
        }