Ejemplo n.º 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();
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 3
0
 private void InitializeMembers()
 {
     this.syncRoot       = new object();
     this.stopRequested  = false;
     this.workflows      = new Dictionary <Guid, WorkflowDetails>();
     this.graywulfLogger = null;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 6
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;
 }
Ejemplo n.º 7
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;
        }
Ejemplo n.º 8
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);
        }