protected void DoPolledEvent(IQEventManager eventManager, IQHsm hsm, IQEvent ev, PollContext pollContext)
 {
     if (OnPolledEvent (eventManager, hsm, ev, pollContext))
     {
         RaisePolledEvent (eventManager, PolledEvent, hsm, ev, pollContext);
     }
 }
 public DispatchExceptionFailureEventArgs(Exception ex, IQHsm hsm, System.Reflection.MethodInfo stateMethod, IQEvent ev)
 {
     _Exception = ex;
     _Hsm = hsm;
     _StateMethod = stateMethod;
     _OriginalEvent = ev;
 }
 public HsmEventHolder(QEventManagerBase eventManager, IQHsm hsm, IQEvent ev)
 {
     _EventManager = eventManager;
     _Hsm = hsm;
     _Event = ev;
     _Principal = System.Threading.Thread.CurrentPrincipal;
 }
 protected void DoUnhandledTransition(IQHsm hsm, MethodInfo stateMethod, IQEvent qEvent)
 {
     if (OnUnhandledTransition (hsm, stateMethod, qEvent))
     {
         RaiseUnhandledTransition (UnhandledTransition, hsm, stateMethod, qEvent);
     }
 }
 protected void RaiseEventManagerDispatchException(EventManagerDispatchExceptionHandler handler, IQEventManager eventManager, Exception ex, IQHsm hsm, IQEvent ev)
 {
     if (handler != null)
     {
         handler (eventManager, ex, hsm, ev);
     }
 }
 protected void DoEventManagerDispatchException(IQEventManager eventManager, Exception ex, IQHsm hsm, IQEvent ev)
 {
     if (OnEventManagerDispatchException (eventManager, ex, hsm, ev))
     {
         RaiseEventManagerDispatchException (EMDispatchException, eventManager, ex, hsm, ev);
     }
 }
 protected virtual void DoDispatchException(IQHsm hsm, Exception ex, MethodInfo stateMethod, IQEvent ev)
 {
     if (OnDispatchException (hsm, ex, stateMethod, ev))
     {
         RaiseDispatchException (DispatchException, hsm, ex, stateMethod, ev);
     }
 }
 public void AsyncDispatchFront(IQHsm hsm, IQEvent ev)
 {
     lock (_QLock)
     {
     #warning Using a stack will alway push the most recent event to the front - thus reversing instead of maintaining "insert" order
         HsmEventHolder holder = new HsmEventHolder (this, hsm, ev);
         _FrontStack.Push (holder);
     }
     _WaitHandle.Set ();
 }
 protected virtual void InternalDispatch(IQHsm hsm, IQEvent ev)
 {
     bool ok = hsm.DispatchWithExceptionTrap (ev, false);
     if (ok)
     {
         ev.Commit ();
     } else
     {
         ev.Abort ();
     }
 }
 public void SetTimeOut(string name, TimeSpan duration, IQHsm hsm, IQEvent ev, TimeOutType timeOutType)
 {
     _Timer.SetTimeOut (name, duration, hsm, ev, timeOutType);
 }
예제 #11
0
파일: QHsm.cs 프로젝트: klhurley/qf4net
 protected virtual bool OnUnhandledTransition(IQHsm hsm, QState state, IQEvent qEvent)
 {
     return(true);
 }
예제 #12
0
 private void _Hsm_DispatchException(Exception ex, IQHsm hsm, System.Reflection.MethodInfo stateMethod, IQEvent ev)
 {
     Logger.Error(ex, "DispatchException: {0} {1} {2}", hsm, stateMethod.Name, ev);
 }
예제 #13
0
 public void SetTimeOut(string name, DateTime at, IQHsm hsm, IQEvent ev, TimeOutType timeOutType)
 {
     _Timer.SetTimeOut(name, at, hsm, ev, timeOutType);
 }
 protected void RaiseEventManagerDispatchException(EventManagerDispatchExceptionHandler handler, IQEventManager eventManager, Exception ex, IQHsm hsm, IQEvent ev)
 {
     if (handler != null)
     {
         handler(eventManager, ex, hsm, ev);
     }
 }
 private void events_UnhandledTransition(IQHsm hsm, MethodInfo stateMethod, IQEvent ev)
 {
     DoUnhandledTransition (hsm, stateMethod, ev);
 }
 private void hsm_UnhandledTransition(IQHsm hsm, System.Reflection.MethodInfo stateMethod, IQEvent ev)
 {
     DoUnhandledTransition (hsm, stateMethod, ev);
 }
 private void hsm_DispatchException(Exception ex, IQHsm hsm, System.Reflection.MethodInfo stateMethod, IQEvent ev)
 {
     DoDispatchException(hsm, ex, stateMethod, ev);
 }
 protected void RaiseUnhandledTransition(DispatchUnhandledTransitionHandler handler, IQHsm hsm, MethodInfo stateMethod, IQEvent qEvent)
 {
     if (handler != null)
     {
         handler (hsm, stateMethod, qEvent);
     }
 }
        private void _Hsm_DispatchException(Exception ex, IQHsm hsm, System.Reflection.MethodInfo stateMethod, IQEvent ev)
        {
            ILQHsm qhsm = (ILQHsm)hsm;

            Logger.Error(ex, "DispatchException: [{0} - {1}] {2} {3}", qhsm.Id, hsm, stateMethod.Name, ev);
        }
 private void _Timer_TimeOut(IQTimer timer, IQHsm hsm, IQEvent ev)
 {
     AsyncDispatchFront (hsm, ev);
 }
 private void _EventManager_EMDispatchException(IQEventManager eventManager, Exception ex, IQHsm hsm, IQEvent ev)
 {
     DoEventManagerDispatchException(eventManager, ex, hsm, ev);
 }
 private void events_DispatchException(Exception ex, IQHsm hsm, MethodInfo stateMethod, IQEvent ev)
 {
     DoDispatchException (hsm, ex, stateMethod, ev);
 }
 protected virtual bool OnDispatchException(IQHsm hsm, Exception ex, MethodInfo stateMethod, IQEvent ev)
 {
     return true;
 }
 protected virtual bool OnUnhandledTransition(IQHsm hsm, MethodInfo stateMethod, IQEvent qEvent)
 {
     return true;
 }
 protected void RaisePolledEvent(IQEventManager eventManager, PolledEventHandler handler, IQHsm hsm, IQEvent ev, PollContext pollContext)
 {
     if (handler != null)
     {
         handler(eventManager, hsm, ev, pollContext);
     }
 }
 protected void RaiseDispatchException(DispatchExceptionHandler handler, IQHsm hsm, Exception ex, MethodInfo stateMethod, IQEvent ev)
 {
     if (handler != null)
     {
         handler (ex, hsm, stateMethod, ev);
     }
 }
예제 #27
0
 protected override bool OnEventManagerDispatchException(IQEventManager eventManager, Exception ex, IQHsm hsm, IQEvent ev)
 {
     /* -- we're not ready for this type of thing yet. EventManagerDispatchException is an exception experienced by the eventManager
      * -- while trying to dispatch an event to an hsm.
      *
      *          DispatchExceptionFailureEventArgs args = new DispatchExceptionFailureEventArgs (eventManager, ex, hsm, ev);
      *          AsyncDispatchFront (hsm, new QEvent ("Failure", args));
      *
      */
     return(base.OnEventManagerDispatchException(eventManager, ex, hsm, ev));
 }
예제 #28
0
 protected virtual TimeOutCmd CreateTimeOut(string name, DateTime at, IQHsm hsm, IQEvent ev, TimeOutType timeOutType)
 {
     return(new TimeOutCmd(this, name, at, hsm, ev, timeOutType));
 }
예제 #29
0
 protected virtual TimeOutCmd CreateTimeOut(string name, TimeSpan duration, IQHsm hsm, IQEvent ev, TimeOutType timeOutType)
 {
     if (_TimingScale != 1)
     {
         duration = new TimeSpan (duration.Ticks * _TimingScale);
     }
     return new TimeOutCmd (this, name, duration, hsm, ev, timeOutType);
 }
예제 #30
0
 public void SetTimeOut(string name, TimeSpan duration, IQHsm hsm, IQEvent ev)
 {
     SetTimeOut(name, duration, hsm, ev, TimeOutType.Single);
 }
예제 #31
0
파일: QHsm.cs 프로젝트: klhurley/qf4net
 /// <summary>
 /// Internal DispatchException handler. Return false to prevent the exception
 /// from being passed out as a DispatchException event.
 /// </summary>
 protected virtual bool OnDispatchException(IQHsm hsm, Exception ex, QState state, IQEvent ev)
 {
     return(true);
 }
예제 #32
0
        public void SetTimeOut(string name, TimeSpan duration, IQHsm hsm, IQEvent ev, TimeOutType timeOutType)
        {
            TimeOutCmd timeOut = CreateTimeOut(name, duration, hsm, ev, timeOutType);

            SetTimeOut(timeOut);
        }
예제 #33
0
파일: QHsm.cs 프로젝트: klhurley/qf4net
 protected void RaiseUnhandledTransition(DispatchUnhandledTransitionHandler handler, IQHsm hsm, QState state, IQEvent qEvent)
 {
     if (handler != null)
     {
         handler(hsm, state, qEvent);
     }
 }
예제 #34
0
 public void SetTimeOut(string name, DateTime at, IQHsm hsm, IQEvent ev)
 {
     SetTimeOut(name, at, hsm, ev, TimeOutType.Single);
 }
 public void SetTimeOut(string name, DateTime at, IQHsm hsm, IQEvent ev, TimeOutType timeOutType)
 {
     _Timer.SetTimeOut (name, at, hsm, ev, timeOutType);
 }
예제 #36
0
        public void SetTimeOut(string name, DateTime at, IQHsm hsm, IQEvent ev, TimeOutType timeOutType)
        {
            TimeOutCmd timeOut = CreateTimeOut(name, at, hsm, ev, timeOutType);

            SetTimeOut(timeOut);
        }
        protected override bool OnEventManagerDispatchException(IQEventManager eventManager, Exception ex, IQHsm hsm, IQEvent ev)
        {
            /* -- we're not ready for this type of thing yet. EventManagerDispatchException is an exception experienced by the eventManager
             * -- while trying to dispatch an event to an hsm.

            DispatchExceptionFailureEventArgs args = new DispatchExceptionFailureEventArgs (eventManager, ex, hsm, ev);
            AsyncDispatchFront (hsm, new QEvent ("Failure", args));

            */
            return base.OnEventManagerDispatchException (eventManager, ex, hsm, ev);
        }
예제 #38
0
 protected virtual bool OnTimeOut(IQHsm hsm, IQEvent ev)
 {
     return(true);
 }
 public void AsyncDispatch(IQHsm hsm, IQEvent ev)
 {
     HsmEventHolder holder = new HsmEventHolder (this, hsm, ev);
     AsyncDispatch (holder);
 }
예제 #40
0
 public TimeOutCmd(QSystemTimer qTimer, string name, TimeSpan duration, IQHsm hsm, IQEvent ev, TimeOutType timeOutType)
 {
     Init(qTimer, name, duration, hsm, ev, timeOutType);
 }
 public void Dispatch(IQHsm hsm, IQEvent ev)
 {
     AsyncDispatch (hsm, ev);
     Poll ();
 }
예제 #42
0
 private void hsm_UnhandledTransition(IQHsm hsm, QState state, IQEvent ev)
 {
     DoUnhandledTransition(hsm, state, ev);
 }
 protected virtual bool OnEventManagerDispatchException(IQEventManager eventManager, Exception ex, IQHsm hsm, IQEvent ev)
 {
     return true;
 }
예제 #44
0
 private void hsm_DispatchException(Exception ex, IQHsm hsm, QState state, IQEvent ev)
 {
     DoDispatchException(hsm, ex, state, ev);
 }
 private void _EventManager_PolledEvent(IQEventManager eventManager, IQHsm hsm, IQEvent ev, PollContext pollContext)
 {
     DoPolledEvent(eventManager, hsm, ev, pollContext);
 }
 protected void RaisePolledEvent(IQEventManager eventManager, PolledEventHandler handler, IQHsm hsm, IQEvent ev, PollContext pollContext)
 {
     if (handler != null)
     {
         handler (eventManager, hsm, ev, pollContext);
     }
 }
 protected virtual bool OnPolledEvent(IQEventManager eventManager, IQHsm hsm, IQEvent ev, PollContext pollContext)
 {
     return(true);
 }
 private void _EventManager_EMDispatchException(IQEventManager eventManager, Exception ex, IQHsm hsm, IQEvent ev)
 {
     DoEventManagerDispatchException (eventManager, ex, hsm, ev);
 }
 protected virtual bool OnEventManagerDispatchException(IQEventManager eventManager, Exception ex, IQHsm hsm, IQEvent ev)
 {
     return(true);
 }
 private void _EventManager_PolledEvent(IQEventManager eventManager, IQHsm hsm, IQEvent ev, PollContext pollContext)
 {
     DoPolledEvent (eventManager, hsm, ev, pollContext);
 }
 protected void DoEventManagerDispatchException(IQEventManager eventManager, Exception ex, IQHsm hsm, IQEvent ev)
 {
     if (OnEventManagerDispatchException(eventManager, ex, hsm, ev))
     {
         RaiseEventManagerDispatchException(EMDispatchException, eventManager, ex, hsm, ev);
     }
 }
예제 #52
0
 private void _Timer_TimeOut(IQTimer timer, IQHsm hsm, IQEvent ev)
 {
     AsyncDispatchFront(hsm, ev);
 }
예제 #53
0
 public void SetTimeOut(string name, TimeSpan duration, IQHsm hsm, IQEvent ev, TimeOutType timeOutType)
 {
     _Timer.SetTimeOut(name, duration, hsm, ev, timeOutType);
 }
예제 #54
0
        private void _Hsm_UnhandledTransition(IQHsm hsm, System.Reflection.MethodInfo stateMethod, IQEvent ev)
        {
            ILQHsm qhsm = (ILQHsm)hsm;

            Logger.Info("UnhandledTransition: [{0} - {1}] {2} {3}", qhsm.Id, hsm, stateMethod.Name, ev);
        }
예제 #55
0
 public void Dispatch(IQHsm hsm, IQEvent ev)
 {
     AsyncDispatch(hsm, ev);
     Poll();
 }
예제 #56
0
 internal void DoTimeOut(IQHsm hsm, IQEvent ev)
 {
     if (OnTimeOut (hsm, ev))
     {
         if (TimeOut != null)
         {
             TimeOut (this, hsm, ev);
         }
     }
 }
예제 #57
0
        public void AsyncDispatch(IQHsm hsm, IQEvent ev)
        {
            HsmEventHolder holder = new HsmEventHolder(this, hsm, ev);

            AsyncDispatch(holder);
        }
 protected virtual bool OnPolledEvent(IQEventManager eventManager, IQHsm hsm, IQEvent ev, PollContext pollContext)
 {
     return true;
 }
예제 #59
0
 private void _EventManager_EMDispatchException(IQEventManager eventManager, Exception ex, IQHsm hsm, IQEvent ev)
 {
     Logger.Error(ex, hsm.ToString() + " " + ev.ToString());
 }
예제 #60
0
 private void _Hsm_UnhandledTransition(IQHsm hsm, System.Reflection.MethodInfo stateMethod, IQEvent ev)
 {
     Logger.Info("UnhandledTransition: {0} {1} {2}", hsm, stateMethod.Name, ev);
 }