public void Route(Object theEvent)
        {
            if (!(theEvent is Properties))
            {
                throw new EPException("Sender expects a properties event");
            }
            EventBean eventBean = new MyPlugInPropertiesEventBean(_type, (Properties)theEvent);

            _runtimeSender.RouteEventBean(eventBean);
        }
예제 #2
0
        public void Route(Object theEvent)
        {
            if (!(theEvent.GetType().IsArray))
            {
                throw new EPException("Unexpected event object of type " + theEvent.GetType().Name + ", expected Object[]");
            }
            var       arr = (Object[])theEvent;
            EventBean objectArrayEvent = _eventAdapterService.AdapterForTypedObjectArray(arr, _objectArrayEventType);

            _runtimeEventSender.RouteEventBean(objectArrayEvent);
        }
예제 #3
0
        public void Route(Object theEvent)
        {
            if (!(theEvent.GetType().IsArray))
            {
                throw new EPException(
                          "Unexpected event object of type " + theEvent.GetType().FullName + ", expected Object[]");
            }
            EventBean eventBean = _eventAdapterService.AdapterForTypedAvro(theEvent, _eventType);

            _runtimeEventSender.RouteEventBean(eventBean);
        }
예제 #4
0
        public void Route(Object theEvent)
        {
            if (!(theEvent is DataMap))
            {
                throw new EPException("Unexpected event object of type " + theEvent.GetType().FullName + ", expected " +
                                      typeof(DataMap).FullName);
            }
            var       map      = (DataMap)theEvent;
            EventBean mapEvent = _eventAdapterService.AdapterForTypedMap(map, _mapEventType);

            _runtimeEventSender.RouteEventBean(mapEvent);
        }
예제 #5
0
        private void SendEvent(Object node, bool isRoute)
        {
            XmlNode namedNode;

            if (node is XmlDocument)
            {
                namedNode = ((XmlDocument)node).DocumentElement;
            }
            else if (node is XmlElement)
            {
                namedNode = (XmlElement)node;
            }
            else
            {
                throw new EPException("Unexpected event object type '" + node.GetType().FullName + "' encountered, please supply a System.Xml.XmlDocument or Element node");
            }

            if (_validateRootElement)
            {
                var theNodeName = namedNode.LocalName;
                if (theNodeName == null)
                {
                    theNodeName = namedNode.Name;
                }

                if (!theNodeName.Equals(_baseXmlEventType.RootElementName))
                {
                    throw new EPException("Unexpected root element name '" + theNodeName + "' encountered, expected a root element name of '" + _baseXmlEventType.RootElementName + "'");
                }
            }

            EventBean theEvent = _eventAdapterService.AdapterForTypedDOM(namedNode, _baseXmlEventType);

            if (isRoute)
            {
                _runtimeEventSender.RouteEventBean(theEvent);
            }
            else
            {
                if ((ThreadingOption.IsThreadingEnabledValue) && (_threadingService.IsInboundThreading))
                {
                    _threadingService.SubmitInbound(new InboundUnitSendWrapped(theEvent, _runtimeEventSender).Run);
                }
                else
                {
                    _runtimeEventSender.ProcessWrappedEvent(theEvent);
                }
            }
        }
예제 #6
0
        private void SendIn(Object theEvent, bool isRoute)
        {
            // Ask each factory in turn to take care of it
            foreach (EventSenderURIDesc entry in _handlingFactories)
            {
                EventBean eventBean = null;

                try
                {
                    eventBean = entry.BeanFactory(theEvent, entry.ResolutionURI);
                }
                catch (Exception ex)
                {
                    Log.Warn("Unexpected exception thrown by plug-in event bean factory '" + entry.BeanFactory + "' processing event " + theEvent, ex);
                }

                if (eventBean != null)
                {
                    if (isRoute)
                    {
                        _epRuntime.RouteEventBean(eventBean);
                    }
                    else
                    {
                        if ((ThreadingOption.IsThreadingEnabledValue) && (_threadingService.IsInboundThreading))
                        {
                            _threadingService.SubmitInbound(() => _epRuntime.ProcessWrappedEvent(eventBean));
                        }
                        else
                        {
                            _epRuntime.ProcessWrappedEvent(eventBean);
                        }
                    }
                    return;
                }
            }
        }
예제 #7
0
        public void Route(Object theEvent)
        {
            EventBean eventBean = GetEventBean(theEvent);

            _runtime.RouteEventBean(eventBean);
        }