Exemplo n.º 1
0
        public void Close()
        {
            if (sessionElapsedTimer == null) return;

            UnRegister();
            sessionElapsedTimer.Close();
            sessionElapsedTimer = null;

            sessionStateEngine.Close();
            sessionStateEngine = null;
        }
Exemplo n.º 2
0
 public SessionContext(string sessionId, IRequestHandler requestHandler, IRegistrator<string, ISessionContext> publisherRegistrator)
 {
     this.publisherRegistrator = publisherRegistrator;
     SessionId = sessionId;
     RequestHandler = requestHandler;
     sessionStateEngine = SessionStateEngineFactory.Create(this);
     SessionTimeoutContext = new ElapsedTimerContext(SessionTimerConstants.SESSION_TIME_OUT);
     ResponseTimeoutContext = new ElapsedTimerContext(SessionTimerConstants.RESPONSE_TIME_OUT);
     sessionElapsedTimer = new SessionElaspedTimer(sessionStateEngine, this);
     UnRegister();
 }
Exemplo n.º 3
0
 public void Process(Event eventObj, StateEngine engineObj)
 {
     IStateRule ruleObj;
     if (!stateRules.TryGetValue(eventObj.Name, out ruleObj)) throw new UnKnownStateEventException();
     engineObj.SetState(ruleObj.Action(eventObj.Message, name));
 }
 public SessionElaspedTimer(StateEngine agentStateEngine, SessionContext sessionContext)
 {
     this.agentStateEngine = agentStateEngine;
     this.sessionContext = sessionContext;
     elaspedTimer = new ElaspedTimer(SessionTimerConstants.TIMER_ELASPED_TIME, OnTimeElaspedHandler);
 }