public class EPRuntimeImpl extends Object implements EPRuntimeSPI, EPRuntimeEventSender, TimerCallback, InternalEventRouteDest
Modifier and Type | Field and Description |
---|---|
protected ExprEvaluatorContext |
engineFilterAndDispatchTimeContext |
protected EventRenderer |
eventRenderer |
protected InternalEventRouter |
internalEventRouter |
protected boolean |
isLatchStatementInsertStream |
protected boolean |
isPrioritized |
protected boolean |
isUsingExternalClocking |
protected static org.slf4j.Logger |
log |
protected ThreadLocal<ArrayBackedCollection<FilterHandle>> |
matchesArrayThreadLocal |
protected ThreadLocal<Map<EPStatementAgentInstanceHandle,Object>> |
matchesPerStmtThreadLocal |
protected AtomicLong |
routedExternal |
protected AtomicLong |
routedInternal |
protected ThreadLocal<ArrayBackedCollection<ScheduleHandle>> |
scheduleArrayThreadLocal |
protected ThreadLocal<Map<EPStatementAgentInstanceHandle,Object>> |
schedulePerStmtThreadLocal |
protected EPServicesContext |
services |
protected ThreadWorkQueue |
threadWorkQueue |
protected UnmatchedListener |
unmatchedListener |
Constructor and Description |
---|
EPRuntimeImpl(EPServicesContext services)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCaches()
Clear short-lived memory that may temporarily retain references to stopped or destroyed statements.
|
void |
destroy()
Destroy for destroying an engine instance: sets references to null and clears thread-locals
|
void |
dispatch()
Dispatch events.
|
EPOnDemandQueryResult |
executeQuery(EPOnDemandPreparedQueryParameterized parameterizedQuery)
Execute an on-demand parameterized query.
|
EPOnDemandQueryResult |
executeQuery(EPOnDemandPreparedQueryParameterized parameterizedQuery,
ContextPartitionSelector[] contextPartitionSelectors)
Execute an on-demand parameterized query.
|
EPOnDemandQueryResult |
executeQuery(EPStatementObjectModel model)
Execute an on-demand query.
|
EPOnDemandQueryResult |
executeQuery(EPStatementObjectModel model,
ContextPartitionSelector[] contextPartitionSelectors)
For use with named windows that have a context declared and that may therefore have multiple context partitions,
allows to target context partitions for query execution selectively.
|
EPOnDemandQueryResult |
executeQuery(String epl)
Execute an on-demand query.
|
EPOnDemandQueryResult |
executeQuery(String epl,
ContextPartitionSelector[] contextPartitionSelectors)
For use with named windows that have a context declared and that may therefore have multiple context partitions,
allows to target context partitions for query execution selectively.
|
long |
getCurrentTime()
Returns current engine time.
|
EPDataFlowRuntime |
getDataFlowRuntime()
Returns the data flow runtime.
|
String |
getEngineURI() |
EventRenderer |
getEventRenderer()
Returns the event renderer for events generated by this runtime.
|
EventSender |
getEventSender(String eventTypeName)
Returns a facility to process event objects that are of a known type.
|
EventSender |
getEventSender(URI[] uri)
For use with plug-in event representations, returns a facility to process event objects that are of one of a number of types
that one or more of the registered plug-in event representation extensions can reflect upon and provide an
event for.
|
ExceptionHandlingService |
getExceptionHandlingService() |
Long |
getNextScheduledTime()
Returns the time at which the next schedule execution is expected, returns null if no schedule execution is
outstanding.
|
long |
getNumEventsEvaluated()
Number of events evaluated over the lifetime of the event stream processing runtime,
or since the last resetStats() call.
|
long |
getRoutedExternal()
Number of events routed externally.
|
long |
getRoutedInternal()
Number of events routed internally.
|
Map<String,Long> |
getStatementNearestSchedules() |
protected static Map<String,Long> |
getStatementNearestSchedulesInternal(SchedulingServiceSPI schedulingService,
StatementLifecycleSvc statementLifecycleSvc) |
Class |
getVariableType(String variableName)
Returns a variable's type.
|
Map<String,Class> |
getVariableTypeAll()
Returns all declared variable names and their types.
|
Map<String,Object> |
getVariableValue(Set<String> variableNames)
Returns current variable values for each of the global variable names passed in,
guaranteeing consistency in the face of concurrent updates to the variables.
|
Map<String,List<ContextPartitionVariableState>> |
getVariableValue(Set<String> variableNames,
ContextPartitionSelector contextPartitionSelector)
Returns the current variable values for a context-partitioned variable, per context partition.
|
Object |
getVariableValue(String variableName)
Returns the current variable value for a global variable.
|
Map<String,Object> |
getVariableValueAll()
Returns current variable values for all global variables,
guaranteeing consistency in the face of concurrent updates to the variables.
|
protected void |
handleFilterFault(EPStatementAgentInstanceHandle faultingHandle,
EventBean theEvent) |
void |
initialize() |
boolean |
isExternalClockingEnabled()
Returns true for external clocking, false for internal clocking.
|
EPOnDemandPreparedQuery |
prepareQuery(EPStatementObjectModel model)
Prepare an unparameterized on-demand query before execution and for repeated execution.
|
EPOnDemandPreparedQuery |
prepareQuery(String epl)
Prepare an unparameterized on-demand query before execution and for repeated execution.
|
EPOnDemandPreparedQueryParameterized |
prepareQueryWithParameters(String epl)
Prepare a parameterized on-demand query for repeated parameter setting and execution.
|
void |
processEvent(Object theEvent)
Process an unwrapped event.
|
protected void |
processMatches(EventBean theEvent) |
void |
processScheduleHandles(ArrayBackedCollection<ScheduleHandle> handles) |
void |
processStatementFilterMultiple(EPStatementAgentInstanceHandle handle,
Object callbackList,
EventBean theEvent,
long version)
Processing multiple filter matches for a statement.
|
void |
processStatementFilterSingle(EPStatementAgentInstanceHandle handle,
EPStatementHandleCallback handleCallback,
EventBean theEvent,
long version)
Process a single match.
|
static void |
processStatementScheduleMultiple(EPStatementAgentInstanceHandle handle,
Object callbackObject,
EPServicesContext services)
Processing multiple schedule matches for a statement.
|
static void |
processStatementScheduleSingle(EPStatementHandleCallback handle,
EPServicesContext services)
Processing single schedule matche for a statement.
|
void |
processThreadWorkQueue()
Works off the thread's work queue.
|
void |
processWrappedEvent(EventBean eventBean)
Equivalent to the sendEvent method of EPRuntime, for use to process an known event.
|
void |
resetStats()
Reset number of events received and emitted
|
void |
route(EventBean theEvent,
EPStatementHandle epStatementHandle,
boolean addToFront)
Route the event such that the event is processed as required.
|
void |
route(Map map,
String eventTypeName)
Route the event object back to the event stream processing runtime for internal dispatching,
to avoid the possibility of a stack overflow due to nested calls to sendEvent.
|
void |
route(Node document)
Route the event object back to the event stream processing runtime for internal dispatching,
to avoid the possibility of a stack overflow due to nested calls to sendEvent.
|
void |
route(Object theEvent)
Route the event object back to the event stream processing runtime for internal dispatching,
to avoid the possibility of a stack overflow due to nested calls to sendEvent.
|
void |
route(Object[] objectArray,
String eventTypeName)
Route the event object back to the event stream processing runtime for internal dispatching,
to avoid the possibility of a stack overflow due to nested calls to sendEvent.
|
void |
routeAvro(Object avroGenericDataDotRecord,
String avroEventTypeName)
Route the event object back to the event stream processing runtime for internal dispatching,
to avoid the possibility of a stack overflow due to nested calls to sendEvent.
|
void |
routeEventBean(EventBean theEvent)
For processing a routed event.
|
void |
sendEvent(Map map,
String mapEventTypeName)
Send a map containing event property values to the event stream processing runtime.
|
void |
sendEvent(Node document)
Send an event represented by a DOM node to the event stream processing runtime.
|
void |
sendEvent(Object theEvent)
Send an event represented by a plain Java object to the event stream processing runtime.
|
void |
sendEvent(Object[] propertyValues,
String objectArrayEventTypeName)
Send an object array containing event property values to the event stream processing runtime.
|
void |
sendEventAvro(Object avroGenericDataDotRecord,
String avroEventTypeName)
Send an event represented by a Avro GenericData.Record to the event stream processing runtime.
|
void |
setInternalEventRouter(InternalEventRouter internalEventRouter)
Sets the route for events to use
|
void |
setUnmatchedListener(UnmatchedListener listener)
Sets a listener to receive events that are unmatched by any statement.
|
void |
setVariableValue(Map<String,Object> variableValues)
Sets the value of multiple global variables in one update, applying all or none of the changes
to variable values in one atomic transaction.
|
void |
setVariableValue(Map<String,Object> variableValues,
int agentInstanceId)
Sets the value of multiple context-partitioned variables in one update, applying all or none of the changes
to variable values in one atomic transaction.
|
void |
setVariableValue(String variableName,
Object variableValue)
Sets the value of a single global variable.
|
void |
timerCallback()
Invoked by the internal clocking service at regular intervals.
|
EventBean |
wrapEvent(Map map,
String eventTypeName)
Send a map containing event property values to the event stream processing runtime.
|
EventBean |
wrapEvent(Node node)
Send an event represented by a DOM node to the event stream processing runtime.
|
EventBean |
wrapEvent(Object theEvent)
Send an event represented by a plain Java object to the event stream processing runtime.
|
EventBean |
wrapEvent(Object[] objectArray,
String eventTypeName) |
EventBean |
wrapEventAvro(Object avroGenericDataDotRecord,
String eventTypeName) |
protected static final org.slf4j.Logger log
protected EPServicesContext services
protected boolean isLatchStatementInsertStream
protected boolean isUsingExternalClocking
protected boolean isPrioritized
protected volatile UnmatchedListener unmatchedListener
protected AtomicLong routedInternal
protected AtomicLong routedExternal
protected EventRenderer eventRenderer
protected InternalEventRouter internalEventRouter
protected ExprEvaluatorContext engineFilterAndDispatchTimeContext
protected ThreadWorkQueue threadWorkQueue
protected ThreadLocal<ArrayBackedCollection<FilterHandle>> matchesArrayThreadLocal
protected ThreadLocal<ArrayBackedCollection<ScheduleHandle>> scheduleArrayThreadLocal
protected ThreadLocal<Map<EPStatementAgentInstanceHandle,Object>> matchesPerStmtThreadLocal
protected ThreadLocal<Map<EPStatementAgentInstanceHandle,Object>> schedulePerStmtThreadLocal
public EPRuntimeImpl(EPServicesContext services)
services
- - references to servicespublic void setInternalEventRouter(InternalEventRouter internalEventRouter)
setInternalEventRouter
in interface InternalEventRouteDest
internalEventRouter
- routerpublic long getRoutedInternal()
EPRuntimeSPI
getRoutedInternal
in interface EPRuntimeSPI
public long getRoutedExternal()
EPRuntimeSPI
getRoutedExternal
in interface EPRuntimeSPI
public void timerCallback()
TimerCallback
timerCallback
in interface TimerCallback
public void sendEventAvro(Object avroGenericDataDotRecord, String avroEventTypeName)
EPRuntime
Use the route method for sending events into the runtime from within UpdateListener code,
to avoid the possibility of a stack overflow due to nested calls to sendEvent
(except with the outbound-threading configuration), see EPRuntime.routeAvro(Object, String)
}).
sendEventAvro
in interface EPRuntime
avroGenericDataDotRecord
- is the event to sent to the runtimeavroEventTypeName
- event type namepublic void sendEvent(Object theEvent) throws EPException
EPRuntime
Use the route method for sending events into the runtime from within UpdateListener code,
to avoid the possibility of a stack overflow due to nested calls to sendEvent
(except with the outbound-threading configuration), see EPRuntime.route(Object)
).
sendEvent
in interface EPRuntime
theEvent
- is the event to sent to the runtimeEPException
- is thrown when the processing of the event lead to an errorpublic void sendEvent(Node document) throws EPException
EPRuntime
Use the route method for sending events into the runtime from within UpdateListener code.
to avoid the possibility of a stack overflow due to nested calls to sendEvent
(except with the outbound-threading configuration), see EPRuntime.route(org.w3c.dom.Node)
).
sendEvent
in interface EPRuntime
document
- is the DOM node as an eventEPException
- is thrown when the processing of the event lead to an errorpublic EventBean wrapEvent(Node node)
EPRuntimeSPI
Use the route method for sending events into the runtime from within UpdateListener code. to avoid the possibility of a stack overflow due to nested calls to sendEvent.
wrapEvent
in interface EPRuntimeSPI
node
- is the DOM node as an eventpublic void route(Node document) throws EPException
EPRuntime
Note: when outbound-threading is enabled, the thread delivering to listeners is not the thread processing the original event. Therefore with outbound-threading enabled the sendEvent method should be used by listeners instead.
route
in interface EPRuntime
document
- is the DOM node as an eventEPException
- is thrown when the processing of the event lead to an errorpublic void routeAvro(Object avroGenericDataDotRecord, String avroEventTypeName) throws EPException
EPRuntime
Note: when outbound-threading is enabled, the thread delivering to listeners is not the thread processing the original event. Therefore with outbound-threading enabled the sendEvent method should be used by listeners instead.
routeAvro
in interface EPRuntime
avroGenericDataDotRecord
- is the event to sent to the runtimeavroEventTypeName
- event type nameEPException
- is thrown when the processing of the event lead to an errorpublic void sendEvent(Map map, String mapEventTypeName) throws EPException
EPRuntime
Use the route method for sending events into the runtime from within UpdateListener code.
to avoid the possibility of a stack overflow due to nested calls to sendEvent
(except with the outbound-threading configuration), see EPRuntime.route(java.util.Map, String)
).
sendEvent
in interface EPRuntime
map
- - map that contains event property values. Keys are expected to be of type String while values
can be of any type. Keys and values should match those declared via Configuration for the given eventTypeName.mapEventTypeName
- - the name for the Map event type that was previously configuredEPException
- - when the processing of the event leads to an errorpublic void sendEvent(Object[] propertyValues, String objectArrayEventTypeName) throws EPException
EPRuntime
Use the route method for sending events into the runtime from within UpdateListener code.
to avoid the possibility of a stack overflow due to nested calls to sendEvent
(except with the outbound-threading configuration), see EPRuntime.route(Object[], String)
).
sendEvent
in interface EPRuntime
propertyValues
- - array that contains event property values. Your application must ensure that property values
match the exact same order that the property names and types have been declared, and that the array length matches the number of properties declared.objectArrayEventTypeName
- - the name for the Object-array event type that was previously configuredEPException
- - when the processing of the event leads to an errorpublic EventBean wrapEvent(Map map, String eventTypeName)
EPRuntimeSPI
Use the route method for sending events into the runtime from within UpdateListener code. to avoid the possibility of a stack overflow due to nested calls to sendEvent.
wrapEvent
in interface EPRuntimeSPI
map
- - map that contains event property values. Keys are expected to be of type String while values
can be of any type. Keys and values should match those declared via Configuration for the given eventTypeName.eventTypeName
- - the name for the Map event type that was previously configuredpublic void route(Map map, String eventTypeName) throws EPException
EPRuntime
Note: when outbound-threading is enabled, the thread delivering to listeners is not the thread processing the original event. Therefore with outbound-threading enabled the sendEvent method should be used by listeners instead.
route
in interface EPRuntime
map
- - map that contains event property values. Keys are expected to be of type String while values
can be of any type. Keys and values should match those declared via Configuration for the given eventTypeName.eventTypeName
- - the name for Map event type that was previously configuredEPException
- - when the processing of the event leads to an errorpublic void route(Object[] objectArray, String eventTypeName) throws EPException
EPRuntime
Note: when outbound-threading is enabled, the thread delivering to listeners is not the thread processing the original event. Therefore with outbound-threading enabled the sendEvent method should be used by listeners instead.
route
in interface EPRuntime
objectArray
- - object array that contains event property values. Your application must ensure that property values
match the exact same order that the property names and types have been declared, and that the array length matches the number of properties declared.eventTypeName
- - the name for Object-array event type that was previously configuredEPException
- - when the processing of the event leads to an errorpublic long getNumEventsEvaluated()
EPRuntime
getNumEventsEvaluated
in interface EPRuntime
public void resetStats()
EPRuntime
resetStats
in interface EPRuntime
public void routeEventBean(EventBean theEvent)
EPRuntimeEventSender
routeEventBean
in interface EPRuntimeEventSender
theEvent
- routed eventpublic void route(Object theEvent)
EPRuntime
Note: when outbound-threading is enabled, the thread delivering to listeners is not the thread processing the original event. Therefore with outbound-threading enabled the sendEvent method should be used by listeners instead.
public void route(EventBean theEvent, EPStatementHandle epStatementHandle, boolean addToFront)
InternalEventRouteDest
route
in interface InternalEventRouteDest
theEvent
- to routeepStatementHandle
- provides statement resourcesaddToFront
- whether to add to the front of the work queuepublic void processEvent(Object theEvent)
theEvent
- to process.public EventBean wrapEvent(Object theEvent)
EPRuntimeSPI
Use the route method for sending events into the runtime from within UpdateListener code, to avoid the possibility of a stack overflow due to nested calls to sendEvent.
wrapEvent
in interface EPRuntimeSPI
theEvent
- is the event to sent to the runtimepublic void processWrappedEvent(EventBean eventBean)
EPRuntimeEventSender
processWrappedEvent
in interface EPRuntimeEventSender
processWrappedEvent
in interface EPRuntimeSPI
eventBean
- is the event object wrapped by an event bean providing the event metadatapublic void processScheduleHandles(ArrayBackedCollection<ScheduleHandle> handles)
public void processThreadWorkQueue()
processThreadWorkQueue
in interface EPRuntimeSPI
processThreadWorkQueue
in interface InternalEventRouteDest
protected void processMatches(EventBean theEvent)
public static void processStatementScheduleMultiple(EPStatementAgentInstanceHandle handle, Object callbackObject, EPServicesContext services)
handle
- statement handlecallbackObject
- object containing matchesservices
- engine servicespublic static void processStatementScheduleSingle(EPStatementHandleCallback handle, EPServicesContext services)
handle
- statement handleservices
- engine servicespublic void processStatementFilterMultiple(EPStatementAgentInstanceHandle handle, Object callbackList, EventBean theEvent, long version)
handle
- statement handlecallbackList
- object containing callbackstheEvent
- to processversion
- filter versionpublic void processStatementFilterSingle(EPStatementAgentInstanceHandle handle, EPStatementHandleCallback handleCallback, EventBean theEvent, long version)
handle
- statementhandleCallback
- callbacktheEvent
- event to indicateversion
- filter versionprotected void handleFilterFault(EPStatementAgentInstanceHandle faultingHandle, EventBean theEvent)
public void dispatch()
dispatch
in interface EPRuntimeSPI
dispatch
in interface InternalEventRouteDest
public boolean isExternalClockingEnabled()
EPRuntime
isExternalClockingEnabled
in interface EPRuntime
public void destroy()
destroy
in interface EPRuntimeSPI
public void initialize()
initialize
in interface EPRuntimeSPI
public void clearCaches()
EPRuntimeSPI
Use this method after stopping and destroying statements for the purpose of clearing thread-local or other short lived storage to statement handles of deleted statements.
NOT safe to use without first acquiring the engine lock.
clearCaches
in interface EPRuntimeSPI
public void setUnmatchedListener(UnmatchedListener listener)
EPRuntime
Events that can be unmatched are all events that are send into a runtime via one of the sendEvent methods, or that have been generated via insert-into clause.
For an event to be unmatched by any statement, the event must not match any statement's event stream filter criteria (a where-clause is NOT a filter criteria for a stream, as below).
Note: In the following statement a MyEvent event does always match this statement's event stream filter criteria, regardless of the value of the 'quantity' property.
select * from MyEvent where quantity > 5
select * from MyEvent(quantity > 5)For patterns, if no pattern sub-expression is active for such event, the event is also unmatched.
setUnmatchedListener
in interface EPRuntime
listener
- is the listener to receive notification of unmatched events, or null to unregister a
previously registered listenerpublic void setVariableValue(String variableName, Object variableValue) throws EPException
EPRuntime
Note that the thread setting the variable value queues the changes, i.e. it does not itself re-evaluate such new variable value for any given statement. The timer thread performs this work.
Not for use with context-partitioned variables.setVariableValue
in interface EPRuntime
variableName
- is the name of the variable to change the value ofvariableValue
- is the new value of the variable, with null an allowed valueVariableValueException
- if the value does not match variable type or cannot be safely coerced
to the variable typeVariableNotFoundException
- if the variable name has not been declaredEPException
public void setVariableValue(Map<String,Object> variableValues) throws EPException
EPRuntime
Note that the thread setting the variable value queues the changes, i.e. it does not itself re-evaluate such new variable value for any given statement. The timer thread performs this work.
Not for use with context-partitioned variables.setVariableValue
in interface EPRuntime
variableValues
- is the map of variable name and variable value, with null an allowed valueVariableValueException
- if any value does not match variable type or cannot be safely coerced
to the variable typeVariableNotFoundException
- if any of the variable names has not been declaredEPException
public void setVariableValue(Map<String,Object> variableValues, int agentInstanceId) throws VariableValueException, VariableNotFoundException
EPRuntime
Note that the thread setting the variable value queues the changes, i.e. it does not itself re-evaluate such new variable value for any given statement. The timer thread performs this work.
Only for use with context-partitioned variables.setVariableValue
in interface EPRuntime
variableValues
- is the map of variable name and variable value, with null an allowed valueagentInstanceId
- the id of the context partitionVariableValueException
- if any value does not match variable type or cannot be safely coerced
to the variable typeVariableNotFoundException
- if any of the variable names has not been declaredpublic Object getVariableValue(String variableName) throws EPException
EPRuntime
getVariableValue
in interface EPRuntime
variableName
- is the name of the variable to return the value forVariableNotFoundException
- if a variable by that name has not been declaredEPException
public Map<String,List<ContextPartitionVariableState>> getVariableValue(Set<String> variableNames, ContextPartitionSelector contextPartitionSelector) throws VariableNotFoundException
EPRuntime
getVariableValue
in interface EPRuntime
variableNames
- are the names of the variables to return the value forcontextPartitionSelector
- selector for the context partition to return the value forVariableNotFoundException
- if a variable by that name has not been declaredpublic Map<String,Object> getVariableValue(Set<String> variableNames) throws EPException
EPRuntime
getVariableValue
in interface EPRuntime
variableNames
- is a set of variable names for which to return valuesVariableNotFoundException
- if any of the variable names has not been declaredEPException
public Map<String,Object> getVariableValueAll() throws EPException
EPRuntime
getVariableValueAll
in interface EPRuntime
EPException
public Map<String,Class> getVariableTypeAll()
EPRuntimeSPI
getVariableTypeAll
in interface EPRuntimeSPI
public Class getVariableType(String variableName)
EPRuntimeSPI
getVariableType
in interface EPRuntimeSPI
variableName
- type or null if the variable is not declaredpublic EPOnDemandQueryResult executeQuery(String epl, ContextPartitionSelector[] contextPartitionSelectors)
EPRuntime
executeQuery
in interface EPRuntime
epl
- is the EPL query to executecontextPartitionSelectors
- selects context partitions to considerpublic EPOnDemandQueryResult executeQuery(String epl)
EPRuntime
On-demand queries are EPL queries that execute non-continuous fire-and-forget queries against named windows.
executeQuery
in interface EPRuntime
epl
- is the EPL query to executepublic EPOnDemandQueryResult executeQuery(EPStatementObjectModel model)
EPRuntime
On-demand queries are EPL queries that execute non-continuous fire-and-forget queries against named windows.
executeQuery
in interface EPRuntime
model
- is the EPL query to execute, obtain a model object using EPAdministrator.compileEPL(String)
or via the APIpublic EPOnDemandQueryResult executeQuery(EPStatementObjectModel model, ContextPartitionSelector[] contextPartitionSelectors)
EPRuntime
executeQuery
in interface EPRuntime
model
- is the EPL query to execute, obtain a model object using EPAdministrator.compileEPL(String)
or via the APIcontextPartitionSelectors
- selects context partitions to considerpublic EPOnDemandQueryResult executeQuery(EPOnDemandPreparedQueryParameterized parameterizedQuery)
EPRuntime
On-demand queries are EPL queries that execute non-continuous fire-and-forget queries against named windows.
executeQuery
in interface EPRuntime
parameterizedQuery
- contains the query and parameter valuespublic EPOnDemandQueryResult executeQuery(EPOnDemandPreparedQueryParameterized parameterizedQuery, ContextPartitionSelector[] contextPartitionSelectors)
EPRuntime
On-demand queries are EPL queries that execute non-continuous fire-and-forget queries against named windows.
executeQuery
in interface EPRuntime
parameterizedQuery
- contains the query and parameter valuescontextPartitionSelectors
- selects context partitions to considerpublic EPOnDemandPreparedQuery prepareQuery(String epl)
EPRuntime
prepareQuery
in interface EPRuntime
epl
- to preparepublic EPOnDemandPreparedQuery prepareQuery(EPStatementObjectModel model)
EPRuntime
prepareQuery
in interface EPRuntime
model
- is the EPL query to prepare, obtain a model object using EPAdministrator.compileEPL(String)
or via the APIpublic EPOnDemandPreparedQueryParameterized prepareQueryWithParameters(String epl)
EPRuntime
EPRuntime.executeQuery(EPOnDemandPreparedQueryParameterized)
.prepareQueryWithParameters
in interface EPRuntime
epl
- to preparepublic EventSender getEventSender(String eventTypeName)
EPRuntime
Given an event type name this method returns a sender that allows to send in event objects of that type. The event objects send in via the event sender are expected to match the event type, thus the event sender does not inspect the event object other then perform basic checking.
For events backed by a Java class (JavaBean events), the sender ensures that the object send in matches in class, or implements or extends the class underlying the event type for the given event type name. Note that event type identity for Java class events is the Java class. When assigning two different event type names to the same Java class the names are an alias for the same event type i.e. there is always a single event type to represent a given Java class.
For events backed by a Object[] (Object-array events), the sender does not perform any checking other then checking that the event object indeed is an array of object.
For events backed by a java.util.Map (Map events), the sender does not perform any checking other then checking that the event object indeed implements Map.
For events backed by a org.w3c.Node (XML DOM events), the sender checks that the root element name indeed does match the root element name for the event type name.
getEventSender
in interface EPRuntime
eventTypeName
- is the name of the event typepublic EventSender getEventSender(URI[] uri) throws EventTypeException
EPRuntime
getEventSender
in interface EPRuntime
uri
- is the URIs that specify which plug-in event representations may process an event object.
URIs do not need to match event representation URIs exactly, a child (hierarchical) match is enough for an event representation to participate.
The order of URIs is relevant as each event representation's factory is asked in turn to process the event, until the first factory processes the event.
EventTypeException
- thrown to indicate that the URI list was invalidpublic EventRenderer getEventRenderer()
EPRuntime
getEventRenderer
in interface EPRuntime
public long getCurrentTime()
EPRuntime
If time is provided externally via timer events, the function returns current time as externally provided.
getCurrentTime
in interface EPRuntime
public Long getNextScheduledTime()
EPRuntime
getNextScheduledTime
in interface EPRuntime
public Map<String,Long> getStatementNearestSchedules()
getStatementNearestSchedules
in interface EPRuntimeSPI
protected static Map<String,Long> getStatementNearestSchedulesInternal(SchedulingServiceSPI schedulingService, StatementLifecycleSvc statementLifecycleSvc)
public ExceptionHandlingService getExceptionHandlingService()
public String getEngineURI()
getEngineURI
in interface EPRuntimeSPI
getEngineURI
in interface InternalEventRouteDest
public EPDataFlowRuntime getDataFlowRuntime()
EPRuntime
getDataFlowRuntime
in interface EPRuntime