Exemple #1
0
        public void Start()
        {
            EnsureNotStopping();

            Jhu.Graywulf.Logging.Logger.Instance.Writers.Add(new Jhu.Graywulf.Logging.StreamLogWriter(Console.Out));
            graywulfLogger = new Jhu.Graywulf.Activities.GraywulfTrackingParticipant();
        }
Exemple #2
0
        /// <summary>
        /// Drain-stops the workflow host by waiting for the
        /// workflows complete
        /// </summary>
        public void Stop(TimeSpan timeout)
        {
            lock (syncRoot)
            {
                if (stopRequested)
                {
                    throw new InvalidOperationException();
                }

                stopRequested = true;
            }

            // Wait until all workflows complete

            while (true)
            {
                lock (syncRoot)
                {
                    if (workflows.Count == 0)
                    {
                        break;
                    }
                }

                Thread.Sleep(100);  // TODO: use constant
            }

            graywulfLogger        = null;
            workflowInstanceStore = null;
            stopRequested         = false;
        }
Exemple #3
0
 private void InitializeMembers()
 {
     this.syncRoot       = new object();
     this.stopRequested  = false;
     this.workflows      = new Dictionary <Guid, WorkflowDetails>();
     this.graywulfLogger = null;
 }
Exemple #4
0
 private void InitializeMembers()
 {
     this.syncRoot              = new object();
     this.stopRequested         = false;
     this.contextGuid           = Guid.Empty;
     this.workflows             = new Dictionary <Guid, WorkflowDetails>();
     this.graywulfLogger        = null;
     this.workflowInstanceStore = null;
 }
Exemple #5
0
        /// <summary>
        /// Starts a new Workflowhost
        /// </summary>
        public void Start(Scheduler scheduler, bool interactive)
        {
            EnsureNotStopping();

            // Store a reference to the proxy to the scheduler
            this.scheduler = scheduler;

            // Initialize logging participant
            // Have to add console logger because it's a new AppDomain
            if (interactive)
            {
                Jhu.Graywulf.Logging.Logger.Instance.Writers.Add(new Jhu.Graywulf.Logging.StreamLogWriter(Console.Out));
            }

            graywulfLogger = new Jhu.Graywulf.Activities.GraywulfTrackingParticipant();

            // Initialize persistence participant
            workflowInstanceStore = new SqlWorkflowInstanceStore(AppSettings.PersistenceConnectionString);
        }
 private void InitializeMembers()
 {
     this.syncRoot = new object();
     this.stopRequested = false;
     this.contextGuid = Guid.Empty;
     this.workflows = new Dictionary<Guid, WorkflowDetails>();
     this.graywulfLogger = null;
     this.workflowInstanceStore = null;
 }
        /// <summary>
        /// Drain-stops the workflow host by waiting for the
        /// workflows complete
        /// </summary>
        public void Stop(TimeSpan timeout)
        {
            lock (syncRoot)
            {
                if (stopRequested)
                {
                    throw new InvalidOperationException();
                }

                stopRequested = true;
            }

            // Wait until all workflows complete

            while (true)
            {
                lock (syncRoot)
                {
                    if (workflows.Count == 0)
                    {
                        break;
                    }
                }

                Thread.Sleep(100);  // TODO: use constant
            }

            graywulfLogger = null;
            workflowInstanceStore = null;
            stopRequested = false;
        }
        /// <summary>
        /// Starts a new Workflowhost
        /// </summary>
        public void Start(Scheduler scheduler, bool interactive)
        {
            EnsureNotStopping();

            // Store a reference to the proxy to the scheduler
            this.scheduler = scheduler;

            // Initialize logging participant
            // Have to add console logger because it's a new AppDomain
            if (interactive)
            {
                Jhu.Graywulf.Logging.Logger.Instance.Writers.Add(new Jhu.Graywulf.Logging.StreamLogWriter(Console.Out));
            }

            graywulfLogger = new Jhu.Graywulf.Activities.GraywulfTrackingParticipant();

            // Initialize persistence participant
            workflowInstanceStore = new SqlWorkflowInstanceStore(AppSettings.PersistenceConnectionString);
        }