Ejemplo n.º 1
0
        public ContextManager GetContextManager(String contextName)
        {
            ContextManagerEntry entry = _contexts.Get(contextName);

            if (entry == null)
            {
                return(null);
            }
            return(entry.ContextManager);
        }
Ejemplo n.º 2
0
        public void AddStatement(String contextName, ContextControllerStatementBase statement, bool isRecoveringResilient)
        {
            ContextManagerEntry entry = _contexts.Get(contextName);

            if (entry == null)
            {
                throw new ExprValidationException(GetNotDecaredText(contextName));
            }
            entry.AddStatement(statement.StatementContext.StatementId);
            entry.ContextManager.AddStatement(statement, isRecoveringResilient);
        }
Ejemplo n.º 3
0
        public void StoppedStatement(String contextName, String statementName, String statementId)
        {
            ContextManagerEntry entry = _contexts.Get(contextName);

            if (entry == null)
            {
                Log.Warn("Stop statement for statement '" + statementName + "' failed to locate corresponding context manager '" + contextName + "'");
                return;
            }
            try {
                entry.ContextManager.StopStatement(statementName, statementId);
            }
            catch (Exception ex) {
                Log.Warn("Failed to stop statement '" + statementName + "' as related to context '" + contextName + "': " + ex.Message, ex);
            }
        }
Ejemplo n.º 4
0
        public void DestroyedStatement(String contextName, String statementName, String statementId)
        {
            ContextManagerEntry entry = _contexts.Get(contextName);

            if (entry == null)
            {
                Log.Warn("Dispose statement for statement '" + statementName + "' failed to locate corresponding context manager '" + contextName + "'");
                return;
            }
            entry.RemoveStatement(statementId);
            entry.ContextManager.DestroyStatement(statementName, statementId);

            if (entry.StatementCount == 0 && _destroyedContexts.Contains(contextName))
            {
                DestroyContext(contextName, entry);
            }
        }
Ejemplo n.º 5
0
        public void StoppedStatement(String contextName, String statementName, int statementId, String epl, ExceptionHandlingService exceptionHandlingService)
        {
            ContextManagerEntry entry = _contexts.Get(contextName);

            if (entry == null)
            {
                Log.Warn("Stop statement for statement '" + statementName + "' failed to locate corresponding context manager '" + contextName + "'");
                return;
            }
            try {
                entry.ContextManager.StopStatement(statementName, statementId);
            }
            catch (Exception ex)
            {
                exceptionHandlingService.HandleException(ex, statementName, epl, ExceptionHandlerExceptionType.STOP);
            }
        }
Ejemplo n.º 6
0
        public void DestroyedContext(String contextName)
        {
            ContextManagerEntry entry = _contexts.Get(contextName);

            if (entry == null)
            {
                Log.Warn("Dispose for context '" + contextName + "' failed to locate corresponding context manager '" + contextName + "'");
                return;
            }
            if (entry.StatementCount == 0)
            {
                DestroyContext(contextName, entry);
            }
            else
            {
                // some remaining statements have references
                _destroyedContexts.Add(contextName);
            }
        }
Ejemplo n.º 7
0
 private void DestroyContext(String contextName, ContextManagerEntry entry)
 {
     entry.ContextManager.SafeDestroy();
     _contexts.Remove(contextName);
     _destroyedContexts.Remove(contextName);
 }
Ejemplo n.º 8
0
        public ContextManager GetContextManager(String contextName)
        {
            ContextManagerEntry entry = _contexts.Get(contextName);

            return(entry == null ? null : entry.ContextManager);
        }