示例#1
0
 public void HandleException(
     Exception ex,
     EPStatementAgentInstanceHandle handle,
     ExceptionHandlerExceptionType type)
 {
     HandleException(ex, handle.StatementHandle.StatementName, handle.StatementHandle.EPL, type);
 }
示例#2
0
 /// <summary>Ctor. </summary>
 /// <param name="engineURI">engine URI</param>
 /// <param name="exception">exception</param>
 /// <param name="statementName">statement name</param>
 /// <param name="epl">statement EPL expression text</param>
 public ExceptionHandlerContext(String engineURI, Exception exception, String statementName, String epl, ExceptionHandlerExceptionType exceptionType)
 {
     EngineURI     = engineURI;
     Exception     = exception;
     StatementName = statementName;
     Epl           = epl;
     ExceptionType = exceptionType;
 }
示例#3
0
 public void HandleException(
     Exception ex,
     EPStatementAgentInstanceHandle handle,
     ExceptionHandlerExceptionType type,
     EventBean optionalCurrentEvent)
 {
     HandleException(ex, handle.StatementHandle.StatementName, handle.StatementHandle.EPL, type, optionalCurrentEvent);
 }
示例#4
0
 /// <summary>Ctor. </summary>
 /// <param name="engineURI">engine URI</param>
 /// <param name="exception">exception</param>
 /// <param name="statementName">statement name</param>
 /// <param name="epl">statement EPL expression text</param>
 /// <param name="exceptionType"></param>
 /// <param name="currentEvent"></param>
 public ExceptionHandlerContext(
     string engineURI,
     Exception exception,
     string statementName,
     string epl,
     ExceptionHandlerExceptionType exceptionType,
     EventBean currentEvent)
 {
     EngineURI     = engineURI;
     Exception     = exception;
     StatementName = statementName;
     Epl           = epl;
     ExceptionType = exceptionType;
     CurrentEvent  = currentEvent;
 }
示例#5
0
        public void HandleException(
            Exception ex,
            string statementName,
            string epl,
            ExceptionHandlerExceptionType type,
            EventBean optionalCurrentEvent)
        {
            if (UnhandledException == null)
            {
                var writer = new StringWriter();
                if (type == ExceptionHandlerExceptionType.PROCESS)
                {
                    writer.Write("Exception encountered processing ");
                }
                else
                {
                    writer.Write("Exception encountered performing instance stop for ");
                }

                writer.Write("statement '");
                writer.Write(statementName);
                writer.Write("' expression '");
                writer.Write(epl);
                writer.Write("' : ");
                writer.Write(ex.Message);

                var message = writer.ToString();

                if (type == ExceptionHandlerExceptionType.PROCESS)
                {
                    Log.Error(message, ex);
                }
                else
                {
                    Log.Warn(message, ex);
                }

                return;
            }

            if (UnhandledException != null)
            {
                UnhandledException(
                    this, new ExceptionHandlerEventArgs {
                    Context = new ExceptionHandlerContext(EngineURI, ex, statementName, epl, type, optionalCurrentEvent)
                });
            }
        }
示例#6
0
 /// <summary>Ctor. </summary>
 /// <param name="runtimeUri">engine URI</param>
 /// <param name="exception">exception</param>
 /// <param name="deploymentId">the deployment id</param>
 /// <param name="statementName">statement name</param>
 /// <param name="epl">statement EPL expression text</param>
 /// <param name="exceptionType"></param>
 /// <param name="currentEvent"></param>
 public ExceptionHandlerContext(
     string runtimeUri,
     Exception exception,
     string deploymentId,
     string statementName,
     string epl,
     ExceptionHandlerExceptionType exceptionType,
     EventBean currentEvent)
 {
     RuntimeURI    = runtimeUri;
     Exception     = exception;
     StatementName = statementName;
     Epl           = epl;
     ExceptionType = exceptionType;
     CurrentEvent  = currentEvent;
     DeploymentId  = deploymentId;
 }
示例#7
0
        public void HandleException(Exception ex, String statementName, String epl, ExceptionHandlerExceptionType type)
        {
            if (UnhandledException == null)
            {
                var writer = new StringWriter();
                if (type == ExceptionHandlerExceptionType.PROCESS)
                {
                    writer.Write("Exception encountered processing ");
                }
                else
                {
                    writer.Write("Exception encountered performing instance stop for ");
                }
                writer.Write("statement '");
                writer.Write(statementName);
                writer.Write("' expression '");
                writer.Write(epl);
                writer.Write("' : ");
                writer.Write(ex.Message);

                var message = writer.ToString();

                if (type == ExceptionHandlerExceptionType.PROCESS)
                {
                    Log.Error(message, ex);
                }
                else
                {
                    Log.Warn(message, ex);
                }

                return;
            }

            UnhandledException(
                new ExceptionHandlerContext(_engineURI, ex, statementName, epl, type));
        }
示例#8
0
        public void HandleException(
            Exception ex,
            string deploymentId,
            string statementName,
            string optionalEPL,
            ExceptionHandlerExceptionType type,
            EventBean optionalCurrentEvent)
        {
            if (UnhandledException == null)
            {
                var writer = new StringWriter();
                if (type == ExceptionHandlerExceptionType.PROCESS)
                {
                    writer.Write("Exception encountered processing ");
                }
                else
                {
                    writer.Write("Exception encountered performing instance stop for ");
                }

                writer.Write("deployment-id '");
                writer.Write(deploymentId);
                writer.Write("' ");
                writer.Write("statement '");
                writer.Write(statementName);
                writer.Write("'");
                if (optionalEPL != null)
                {
                    writer.Write(" expression '");
                    writer.Write(optionalEPL);
                    writer.Write("'");
                }

                writer.Write(" : ");
                writer.Write(ex.Message);

                var message = writer.ToString();

                if (type == ExceptionHandlerExceptionType.PROCESS)
                {
                    Log.Error(message, ex);
                }
                else
                {
                    Log.Warn(message, ex);
                }

                return;
            }

            UnhandledException?.Invoke(
                this,
                new ExceptionHandlerEventArgs {
                Context = new ExceptionHandlerContext(
                    RuntimeURI,
                    ex,
                    deploymentId,
                    statementName,
                    optionalEPL,
                    type,
                    optionalCurrentEvent)
            });
        }