コード例 #1
0
        public FileProcessor(FileProcessorEndpoint endpoint, IFileHandler handler, IFilePostProcessor postProcessor)
        {
            if (endpoint == null)
            {
                throw new ArgumentException("endpoint");
            }

            if (handler == null)
            {
                throw new ArgumentException("handler");
            }

            if (postProcessor == null)
            {
                throw new ArgumentNullException("postProcessor");
            }

            this.instanceId    = Guid.Empty;
            this.Endpoint      = endpoint;
            this.Handler       = handler;
            this.PostProcessor = postProcessor;

            this.timer = new Timer(this.Endpoint.ScavengeInterval.TotalMilliseconds)
            {
                AutoReset = true
            };
            this.timer.Elapsed += this.TimerElapsed;

            this.pendingFiles = new ConcurrentQueue <string>();
            this.eventHandle  = new AutoResetEvent(false);
            this.quitHandle   = new ManualResetEvent(false);
            this.quitting     = false;

            Logger.DebugFormat("Scavenger interval set at {0:0.0} seconds", endpoint.ScavengeInterval.TotalSeconds);
        }
コード例 #2
0
        public FileProcessor(FileProcessorEndpoint endpoint, IFileHandler handler, IFilePostProcessor postProcessor)
        {
            if (endpoint == null)
            {
                throw new ArgumentException("endpoint");
            }

            if (handler == null)
            {
                throw new ArgumentException("handler");
            }

            if (postProcessor == null)
            {
                throw new ArgumentNullException("postProcessor");
            }

            this.instanceId = Guid.Empty;
            this.Endpoint = endpoint;
            this.Handler = handler;
            this.PostProcessor = postProcessor;

            this.timer = new Timer(this.Endpoint.ScavengeInterval.TotalMilliseconds) { AutoReset = true };
            this.timer.Elapsed += this.TimerElapsed;

            this.pendingFiles = new ConcurrentQueue<string>();
            this.eventHandle = new AutoResetEvent(false);
            this.quitHandle = new ManualResetEvent(false);
            this.quitting = false;

            Logger.DebugFormat("Scavenger interval set at {0:0.0} seconds", endpoint.ScavengeInterval.TotalSeconds);
        }
コード例 #3
0
        protected FileProcessorBase(FileProcessorEndpoint endpoint, IFileHandler handler, IFilePostProcessor postProcessor, IFileFilter additionalFilter)
        {
            if (endpoint == null)
            {
                throw new ArgumentException("endpoint");
            }

            if (handler == null)
            {
                throw new ArgumentException("handler");
            }

            if (postProcessor == null)
            {
                throw new ArgumentNullException("postProcessor");
            }

            if (additionalFilter == null)
            {
                throw new ArgumentNullException("additionalFilter");
            }

            this.instanceId = Guid.Empty;
            this.Endpoint = endpoint;
            this.Handler = handler;
            this.PostProcessor = postProcessor;
            this.AdditionalFilter = additionalFilter;
            this.scavenger = new FileScavenger(endpoint, additionalFilter, this.InstanceId);
            this.scavenger.RestartFileChecking += (o, e) => this.RestartNewFileChecking();


            this.pendingFiles = new ConcurrentQueue<string>();
            this.eventHandle = new AutoResetEvent(false);
            this.quitHandle = new ManualResetEvent(false);
            this.quitting = false;

            Logger.DebugFormat("Scavenger interval set at {0:0.0} seconds", endpoint.ScavengeInterval.TotalSeconds);
        }
 public CustomFileProcessor(FileProcessorEndpoint endpoint, IFileHandler handler, IFilePostProcessor postProcessor)
     : base(endpoint, handler, postProcessor)
 {
 }
コード例 #5
0
 public FileProcessorHelper(FileProcessorEndpoint endpoint, IFileHandler handler, IFilePostProcessor postProcessor)
     : base(endpoint, handler, postProcessor)
 {
 }
コード例 #6
0
 public PollingBasedv2FileProcessor(FileProcessorEndpoint endpoint, IFileHandler handler, IFilePostProcessor postProcessor, IFileFilter additionalFilter)
     : base(endpoint, handler, postProcessor, additionalFilter)
 {
     this.pollingTimer = new Timer(Endpoint.PollingInterval) { AutoReset = true };
     this.pollingTimer.Elapsed += this.TimerElapsed;
 }
コード例 #7
0
 public FileProcessorHelper(FileProcessorEndpoint endpoint, IFileHandler handler, IFilePostProcessor postProcessor)
     : base(endpoint, handler, postProcessor)
 {
 }
 public CustomFileProcessor(FileProcessorEndpoint endpoint, IFileHandler handler, IFilePostProcessor postProcessor)
     : base(endpoint, handler, postProcessor)
 {
 }
コード例 #9
0
        protected FileProcessorBase(FileProcessorEndpoint endpoint, IFileHandler handler, IFilePostProcessor postProcessor, IFileFilter additionalFilter)
        {
            if (endpoint == null)
            {
                throw new ArgumentException("endpoint");
            }

            if (handler == null)
            {
                throw new ArgumentException("handler");
            }

            if (postProcessor == null)
            {
                throw new ArgumentNullException("postProcessor");
            }

            if (additionalFilter == null)
            {
                throw new ArgumentNullException("additionalFilter");
            }

            this.instanceId       = Guid.Empty;
            this.Endpoint         = endpoint;
            this.Handler          = handler;
            this.PostProcessor    = postProcessor;
            this.AdditionalFilter = additionalFilter;
            this.scavenger        = new FileScavenger(endpoint, additionalFilter, this.InstanceId);
            this.scavenger.RestartFileChecking += (o, e) => this.RestartNewFileChecking();


            this.pendingFiles = new ConcurrentQueue <string>();
            this.eventHandle  = new AutoResetEvent(false);
            this.quitHandle   = new ManualResetEvent(false);
            this.quitting     = false;

            Logger.DebugFormat("Scavenger interval set at {0:0.0} seconds", endpoint.ScavengeInterval.TotalSeconds);
        }
コード例 #10
0
 public PollingBasedv2FileProcessor(FileProcessorEndpoint endpoint, IFileHandler handler, IFilePostProcessor postProcessor, IFileFilter additionalFilter)
     : base(endpoint, handler, postProcessor, additionalFilter)
 {
     this.pollingTimer = new Timer(Endpoint.PollingInterval)
     {
         AutoReset = true
     };
     this.pollingTimer.Elapsed += this.TimerElapsed;
 }
コード例 #11
0
 public EventBasedFileProcessor(FileProcessorEndpoint endpoint, IFileHandler handler, IFilePostProcessor postProcessor, IFileFilter additionalFilter)
     : base(endpoint, handler, postProcessor, additionalFilter)
 {
 }
コード例 #12
0
 public EventBasedFileProcessor(FileProcessorEndpoint endpoint, IFileHandler handler, IFilePostProcessor postProcessor, IFileFilter additionalFilter)
     : base(endpoint, handler, postProcessor, additionalFilter)
 {
 }