public StatementResultServiceImpl(StatementInformationalsRuntime statementInformationals, EPServicesContext epServicesContext) { this.statementInformationals = statementInformationals; this.epServicesContext = epServicesContext; this.outboundThreading = epServicesContext.getThreadingService().isOutboundThreading(); isMakeSynthetic = statementInformationals.isAlwaysSynthesizeOutputEvents(); }
public ThreadingService getThreadingService() { if (runtimeEnvironment == null) { throw new EPRuntimeDestroyedException(runtimeURI); } return runtimeEnvironment.getServices().getThreadingService(); }
public void sendEventAvro(Object avroGenericDataDotRecord, String avroEventTypeName) { if (avroGenericDataDotRecord == null) { throw new IllegalArgumentException("Invalid null event object"); } if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled())) { log.debug(".sendMap Processing event " + avroGenericDataDotRecord.toString()); } if (inboundThreading) { services.getThreadingService().submitInbound(new InboundUnitSendAvro(avroGenericDataDotRecord, avroEventTypeName, this)); } else { EventBean eventBean = wrapEventAvro(avroGenericDataDotRecord, avroEventTypeName); processWrappedEvent(eventBean); } }
public void sendEventObjectArray(Object[] propertyValues, String eventTypeName) throws EPException { if (propertyValues == null) { throw new IllegalArgumentException("Invalid null event object"); } if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled())) { log.debug(".sendEventObjectArray Processing event " + Arrays.toString(propertyValues)); } if (inboundThreading) { services.getThreadingService().submitInbound(new InboundUnitSendObjectArray(propertyValues, eventTypeName, this)); } else { EventBean eventBean = wrapEventObjectArray(propertyValues, eventTypeName); processWrappedEvent(eventBean); } }
public void sendEventMap(Map<String, Object> map, String mapEventTypeName) throws EPException { if (map == null) { throw new IllegalArgumentException("Invalid null event object"); } if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled())) { log.debug(".sendMap Processing event " + map); } if (inboundThreading) { services.getThreadingService().submitInbound(new InboundUnitSendMap(map, mapEventTypeName, this)); } else { EventBean eventBean = wrapEventMap(map, mapEventTypeName); processWrappedEvent(eventBean); } }
public void sendEventBean(Object theEvent, String eventTypeName) { if (theEvent == null) { log.error(".sendEvent Null object supplied"); return; } if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled())) { log.debug(".sendEvent Processing event " + theEvent); } if (inboundThreading) { services.getThreadingService().submitInbound(new InboundUnitSendEvent(theEvent, eventTypeName, this)); } else { EventBean eventBean = services.getEventTypeResolvingBeanFactory().adapterForBean(theEvent, eventTypeName); processWrappedEvent(eventBean); } }
public void sendEventXMLDOM(org.w3c.dom.Node node, String eventTypeName) { if (node == null) { log.error(".sendEvent Null object supplied"); return; } // Process event if (inboundThreading) { services.getThreadingService().submitInbound(new InboundUnitSendDOM(node, eventTypeName, this)); } else { EventBean eventBean = wrapEventBeanXMLDOM(node, eventTypeName); processWrappedEvent(eventBean); } }
public void execute(StatementDispatchTLEntry dispatchTLEntry) { ArrayDeque<UniformPair<EventBean[]>> dispatches = dispatchTLEntry.getResults(); UniformPair<EventBean[]> events = EventBeanUtility.flattenList(dispatches); if (InstrumentationHelper.ENABLED) { InstrumentationHelper.get().qStatementResultExecute(events, epStatement.getDeploymentId(), epStatement.getStatementId(), epStatement.getName(), Thread.currentThread().getId()); InstrumentationHelper.get().aStatementResultExecute(); } if (outboundThreading) { epServicesContext.getThreadingService().submitOutbound(new OutboundUnitRunnable(events, this)); } else { processDispatch(events); } dispatches.clear(); }
this.inboundThreading = services.getThreadingService().isInboundThreading(); this.routeThreading = services.getThreadingService().isRouteThreading(); this.timerThreading = services.getThreadingService().isTimerThreading(); this.threadWorkQueue = new ThreadWorkQueue(); isLatchStatementInsertStream = this.services.getRuntimeSettingsService().getConfigurationRuntime().getThreading().isInsertIntoDispatchPreserveOrder(); services.getThreadingService().initThreading(services, this);
assertEquals(0, spi.getServicesContext().getThreadingService().getInboundQueue().size()); assertNotNull(spi.getServicesContext().getThreadingService().getInboundThreadPool());
} else { if (routeThreading) { services.getThreadingService().submitRoute(new RouteUnitSingle(this, handleCallback, theEvent, version)); } else { processStatementFilterSingle(handle, handleCallback, theEvent, version, 0); } else { if (routeThreading) { services.getThreadingService().submitRoute(new RouteUnitMultiple(this, callbackList, theEvent, handle, version)); } else { processStatementFilterMultiple(handle, callbackList, theEvent, version, 0);
runtimeToDestroy.getServices().getThreadingService().destroy();
} else { if (timerThreading) { services.getThreadingService().submitTimerWork(new TimerUnitSingle(services, this, handle)); } else { processStatementScheduleSingle(handle, services); } else { if (timerThreading) { services.getThreadingService().submitTimerWork(new TimerUnitMultiple(services, this, handle, callbackObject)); } else { processStatementScheduleMultiple(handle, callbackObject, services);
public EventSender getEventSender(String eventTypeName) throws EventTypeException { EventType eventType = services.getEventTypeRepositoryBus().getTypeByName(eventTypeName); if (eventType == null) { throw new EventTypeException("Event type named '" + eventTypeName + "' could not be found"); } // handle built-in types ThreadingService threadingService = services.getThreadingService(); if (eventType instanceof BeanEventType) { return new EventSenderBean(this, (BeanEventType) eventType, services.getEventBeanTypedEventFactory(), threadingService); } if (eventType instanceof MapEventType) { return new EventSenderMap(this, (MapEventType) eventType, services.getEventBeanTypedEventFactory(), threadingService); } if (eventType instanceof ObjectArrayEventType) { return new EventSenderObjectArray(this, (ObjectArrayEventType) eventType, services.getEventBeanTypedEventFactory(), threadingService); } if (eventType instanceof BaseXMLEventType) { return new EventSenderXMLDOM(this, (BaseXMLEventType) eventType, services.getEventBeanTypedEventFactory(), threadingService); } if (eventType instanceof AvroSchemaEventType) { return new EventSenderAvro(this, eventType, services.getEventBeanTypedEventFactory(), threadingService); } throw new EventTypeException("An event sender for event type named '" + eventTypeName + "' could not be created as the type is not known"); }