Beispiel #1
0
        /// <summary>
        /// Returns an instance of a text file writer output adapter.
        /// </summary>
        /// <param name="configInfo">Configuration passed from the query binding.</param>
        /// <param name="eventShape">Event shape requested from the query binding.</param>
        /// <param name="cepEventType">Event type produced by the bound query template.</param>
        /// <returns>An instance of a text file writer output adapter.</returns>
        public OutputAdapterBase Create(TextFileWriterConfig configInfo, EventShape eventShape, CepEventType cepEventType)
        {
            OutputAdapterBase adapter = default(OutputAdapterBase);

            switch (eventShape)
            {
            case EventShape.Point:
                adapter = new TextFilePointOutput(configInfo, cepEventType);
                break;

            case EventShape.Interval:
                adapter = new TextFileIntervalOutput(configInfo, cepEventType);
                break;

            case EventShape.Edge:
                adapter = new TextFileEdgeOutput(configInfo, cepEventType);
                break;

            default:
                throw new ArgumentException(string.Format(
                                                CultureInfo.InvariantCulture,
                                                "TextFileWriterFactory cannot instantiate adapter with event shape {0}",
                                                eventShape.ToString()));
            }

            return(adapter);
        }
        public OutputAdapterBase Create(TracerConfig configInfo, EventShape eventShape, CepEventType cepEventType)
        {
            OutputAdapterBase adapter = default(OutputAdapterBase);

            switch (eventShape)
            {
            case EventShape.Point:
                adapter = new TracerPointOutputAdapter(configInfo, cepEventType);
                break;
            }

            return(adapter);
        }
Beispiel #3
0
        public OutputAdapterBase Create(SqlOutputConfig configInfo, EventShape eventShape, CepEventType cepEventType)
        {
            OutputAdapterBase adapter = default(OutputAdapterBase);

            switch (eventShape)
            {
            case EventShape.Point:
                adapter = new SqlOutputPoint(configInfo, cepEventType);
                break;

            case EventShape.Interval:
                adapter = new SqlOutputInterval(configInfo, cepEventType);
                break;

            default:
                throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Unknown event shape {0}", eventShape.ToString()));
            }

            return(adapter);
        }
        /// <summary>
        /// Create an instance of a console output adapter that dumps received
        /// events to the .NET Debug or Console window.
        /// </summary>
        public OutputAdapterBase Create(ConsoleAdapterConfig configInfo,
                                        EventShape eventShape, CepEventType cepEventType)
        {
            OutputAdapterBase ret = default(OutputAdapterBase);

            switch (eventShape)
            {
            case EventShape.Point:
                ret = new ConsolePointOutputAdapter(configInfo, cepEventType);
                break;

            case EventShape.Interval:
                ret = new ConsoleIntervalOutputAdapter(configInfo, cepEventType);
                break;

            case EventShape.Edge:
                ret = new ConsoleEdgeOutputAdapter(configInfo, cepEventType);
                break;
            }
            return(ret);
        }