public RFServiceEnvironment(string environment, RFEngineDefinition config, string dbConnection)
        {
            _context = new RFComponentContext
            {
                CancellationTokenSource = new CancellationTokenSource(),
                Catalog      = null,
                UserConfig   = new RFCachedUserConfig(dbConnection, environment),
                SystemConfig = new RFSystemConfig
                {
                    Environment    = environment,
                    IntervalLength = config.IntervalSeconds * 1000,
                    ProcessingMode = RFProcessingMode.RFContinuous,
                    DocumentStoreConnectionString = dbConnection,
                    Downtime = RFSettings.GetDowntime()
                }
            };

            RFStatic.Log = new RFLog4NetLog(dbConnection);

            var engine = new RFSimpleEngine(config, _context);

            _context.Engine        = engine;
            _context.Catalog       = new RFSQLCatalog(_context);
            _context.UserLog       = new RFSQLUserLog(_context);
            _context.UserRole      = new RFSQLUserRole(dbConnection);
            _context.DispatchStore = new RFDispatchStoreSQL(_context);

            _workQueue = new RFGraphDispatchQueue(engine.GetWeights(), engine.GetDependencies(), engine.GetExclusiveProcesses(), _context);
            RFEnvironments.LogLicenseInfo(config);
        }
        public RFConsoleEnvironment(string environment, RFEngineDefinition config, string dbConnection)
        {
            _context = new RFComponentContext
            {
                CancellationTokenSource = new CancellationTokenSource(),
                Catalog      = null,
                UserConfig   = new RFCachedUserConfig(dbConnection, environment),
                UserRole     = new RFSQLUserRole(dbConnection),
                SystemConfig = new RFSystemConfig
                {
                    Environment    = environment,
                    ProcessingMode = RFProcessingMode.RFSinglePass,
                    IntervalLength = config.IntervalSeconds,
                    DocumentStoreConnectionString = dbConnection
                }
            };

            if (RFStatic.Log == null)
            {
                RFStatic.Log = new RFLog4NetLog(dbConnection);
            }

            // reuse parent context for database-access, but create a new engine and work queue (for tracking)
            var engine = new RFSimpleEngine(config, _context);

            _context.Catalog          = new RFSQLCatalog(_context);
            _context.ActiveComponents = new List <RFActiveComponent>();
            _context.Engine           = engine;
            _context.UserLog          = new RFSQLUserLog(_context);
            _context.DispatchStore    = new RFDispatchStoreSQL(_context);
            _workQueue = new RFGraphDispatchQueue(engine.GetWeights(), engine.GetDependencies(), engine.GetExclusiveProcesses(), _context);

            RFEnvironments.LogLicenseInfo(config);
        }
Exemplo n.º 3
0
 protected RFDispatchQueueMonitorBase(RFComponentContext context, IRFInstructionSink instructionSink, IRFEventSink eventSink, IRFDispatchQueue dispatchQueue)
     : base(context)
 {
     _requestTracker  = new RFRequestTracker();
     _instructionSink = instructionSink;
     _eventSink       = eventSink;
     _dispatchQueue   = dispatchQueue;
 }
Exemplo n.º 4
0
        public RFDispatchQueueMonitorMSMQ(RFComponentContext context, IRFInstructionSink instructionSink, IRFEventSink eventSink, IRFDispatchQueue dispatchQueue)
            : base(context, instructionSink, eventSink, dispatchQueue)
        {
            var localSuffix = RIFF.Core.RFCore.sShortVersion;

            _workerThreadsCount = RFSettings.GetAppSetting("MSMQWorkerThreads", 4);
            _workerQueue        = GetOrCreateQueue("WorkerQueue_" + localSuffix, _context.SystemConfig.Environment);
            _eventQueue         = GetOrCreateQueue("EventQueue_" + localSuffix, _context.SystemConfig.Environment);
            _workerQueue.DefaultPropertiesToSend.ResponseQueue = _eventQueue;
            Log.Debug(this, "Using MSMQ Queues");
        }
Exemplo n.º 5
0
 public RFDispatchQueueMonitorInProc(RFComponentContext context, IRFInstructionSink instructionManager, IRFEventSink eventManager, IRFDispatchQueue workQueue)
     : base(context, instructionManager, eventManager, workQueue)
 {
     Log.Debug(this, "Using InProc Queue");
 }
Exemplo n.º 6
0
 public RFDispatchQueueSink(RFComponentContext context, IRFDispatchQueue destinationQueue)
     : base(context)
 {
     _destinationQueue = destinationQueue;
 }