예제 #1
0
 internal PersistentCommandDispatcher(TreeQueue queue, TreeQueueThreadPool threadPool, ICommandDistributor distributor, ICommandPublishingStore store, ISerializer formatter, ISchedulingProvider schedulingProvider, ILogFactory logFactory)
 {
     this.queue              = queue;
     this.threadPool         = threadPool;
     this.distributor        = distributor;
     this.store              = store;
     this.formatter          = formatter;
     this.schedulingProvider = schedulingProvider;
     this.log = logFactory.Scope("PersistentCommandDispatcher");
     Initialize();
 }
 /// <summary>
 /// Creates new instance with <see cref="DateTime.Now"/> as current date time provider.
 /// </summary>
 /// <param name="distributor">The command-to-the-queue distributor.</param>
 /// <param name="store">The publishing store for command persistent delivery.</param>
 /// <param name="formatter">The formatter for serializing commands.</param>
 public PersistentCommandDispatcher(ICommandDistributor distributor, ICommandPublishingStore store, ISerializer formatter)
     : this(distributor, store, formatter, new TimerSchedulingProvider(new TimerSchedulingProvider.DateTimeNowProvider()))
 {
 }
 /// <summary>
 /// Sets <paramref name="store"/> to be used for persisting commands on all newly created dispatchers.
 /// </summary>
 /// <param name="store">The publishing store for command persistent delivery (can be <c>null</c> for reseting to default).</param>
 /// <returns>Self (for fluency).</returns>
 public PersistentCommandDispatcherBuilder UseStore(ICommandPublishingStore store)
 {
     this.store = store;
     return(this);
 }
 /// <summary>
 /// Creates new instance with enumeration of supported methods in <paramref name="supportedMethod"/>. Other methods are empty.
 /// If one of stores required by <paramref name="supportedMethod"/> is <c>null</c>, this method is automatically not supported.
 /// </summary>
 /// <param name="supportedMethod">The enumeration of supported methods.</param>
 /// <param name="store">The store for loading and saving commands.</param>
 /// <param name="publishingStore">The store for saving delivery information.</param>
 public EmptyCommandStore(Method supportedMethod, ICommandStore store, ICommandPublishingStore publishingStore)
 {
     this.supportedMethod = supportedMethod;
     this.store           = store;
     this.publishingStore = publishingStore;
 }