private void handleObject(Object input) { try { if (input instanceof Map) { Map map = (Map) input; String type = (String) map.get("stream"); if (type == null) { log.warn("Expected value for event type not found in map event provided to adapter"); return; } runtime.getEventService().sendEventMap(map, type); } else { runtime.getEventService().sendEventBean(input, input.getClass().getSimpleName()); } } catch (Throwable t) { log.error("Unexpected exception encountered sending event " + input + " service '" + serviceName + "' :" + t.getMessage(), t); } }
eventRenderer, epRuntime.getEventServiceSPI(), (EPEventServiceSPI) epRuntime.getEventService(), eventBeanService, eventBeanTypedEventFactory,
if (theEvent instanceof Node) { Node node = (Node) theEvent; runtime.getEventService().sendEventXMLDOM(node, node.getNodeName()); } else if (theEvent instanceof EventBean) { runtime.getEventServiceSPI().processWrappedEvent((EventBean) theEvent);
public void start() throws EPException { if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled())) { log.debug(".start"); } if (runtime.getEventService() == null) { throw new EPException( "Attempting to start an Adapter that hasn't had the runtime provided"); } startTime = System.currentTimeMillis(); if (log.isDebugEnabled()) { log.debug(".start startTime==" + startTime); } stateManager.start(); }
public void setRuntime(EPRuntime runtime) { if (runtime == null) { throw new NullPointerException("runtime cannot be null"); } if (!(runtime instanceof EPRuntimeSPI)) { throw new IllegalArgumentException("Invalid type of runtime"); } EPRuntimeSPI spi = (EPRuntimeSPI) runtime; processEvent = spi.getEventService(); schedulingService = spi.getServicesContext().getSchedulingService(); sender.setRuntime(processEvent); }
public void setRuntime(EPRuntime runtime) { if (runtime == null) { throw new NullPointerException("runtime cannot be null"); } if (!(runtime instanceof EPRuntimeSPI)) { throw new IllegalArgumentException("Invalid type of runtime"); } EPRuntimeSPI spi = (EPRuntimeSPI) runtime; processEvent = spi.getEventService(); schedulingService = spi.getServicesContext().getSchedulingService(); sender.setRuntime(processEvent); }
public void start() throws EPException { if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled())) { log.debug(".start"); } if (spi.getEventService() == null) { throw new EPException("Attempting to start an Adapter that hasn't had the runtime provided"); } startTime = System.currentTimeMillis(); if ((ExecutionPathDebugLog.isDebugEnabled) && (log.isDebugEnabled())) { log.debug(".start startTime==" + startTime); } stateManager.start(); Iterator<Map.Entry<String, JMSSubscription>> it = subscriptionMap.entrySet().iterator(); while (it.hasNext()) { Map.Entry<String, JMSSubscription> sub = it.next(); JMSSubscription destination = sub.getValue(); destination.setJMSOutputAdapter(this); EPDeployment deployment = compileDeploySubscription(spi, sub.getValue().getEventTypeName(), this.getClass().getSimpleName() + "-" + sub.getKey()); deployment.getStatements()[0].addListener(new UpdateListener() { public void update(EventBean[] newEvents, EventBean[] oldEvents, EPStatement statement, EPRuntime runtime) { if (newEvents == null) { return; } for (EventBean event : newEvents) { destination.process(event); } } }); } }
((EPEventServiceSPI) runtime.getEventService()).clearCaches(); } finally { options.getUndeploymentLockStrategy().release(services.getEventProcessingRWLock());