public class EPRuntimeImpl extends Object implements EPRuntimeSPI
Constructor and Description |
---|
EPRuntimeImpl(com.espertech.esper.common.client.configuration.Configuration configuration,
String runtimeURI,
Map<String,EPRuntimeSPI> runtimes)
Constructor - initializes services.
|
Modifier and Type | Method and Description |
---|---|
void |
addRuntimeStateListener(EPRuntimeStateListener listener)
Add a listener to runtime state changes that receives a before-destroy event.
|
void |
destroy()
Destroys the runtime.
|
protected void |
doInitialize(Long startTime)
Performs the initialization.
|
com.espertech.esper.common.client.configuration.Configuration |
getConfigurationDeepCopy()
Returns a deep-copy of the configuration that is actively in use by the runtime.
|
Map<String,Object> |
getConfigurationTransient()
Returns the transient configuration, which are configuration values that are passed by reference (and not by value)
|
Context |
getContext()
Provides naming context for public named objects.
|
com.espertech.esper.common.client.context.EPContextPartitionService |
getContextPartitionService()
Returns the context partition service, for context partition information
|
com.espertech.esper.common.client.dataflow.core.EPDataFlowService |
getDataFlowService()
Returns the data flow service, for managing dataflows
|
EPDeploymentService |
getDeploymentService()
Returns the deployment service, for deploying and undeploying compiled modules
|
EPEventService |
getEventService()
Returns the event service, for sending events to the runtime and for controlling time
|
EPEventServiceSPI |
getEventServiceSPI() |
EPEventTypeService |
getEventTypeService()
Returns the event type service, for obtaining information on event types
|
EPFireAndForgetService |
getFireAndForgetService()
Returns the fire-and-forget service, for executing fire-and-forget queries
|
com.espertech.esper.common.client.metric.EPMetricsService |
getMetricsService()
Returns the metrics service, for managing runtime and statement metrics reporting
|
EPRuntimeCompileReflectiveSPI |
getReflectiveCompileSvc() |
com.espertech.esper.common.client.render.EPRenderEventService |
getRenderEventService()
Returns the event rendering service, for rendering events to JSON and XML
|
ReadWriteLock |
getRuntimeInstanceWideLock()
Returns the runtime-instance global read-write lock.
|
com.espertech.esper.common.client.EPCompilerPathable |
getRuntimePath()
Returns a path object for use by the compiler that represents a snapshot of the EPL objects deployed into the runtime
at the time of this call.
|
EPServicesContext |
getServicesContext() |
AtomicBoolean |
getServiceStatusProvider() |
EPRuntimeStatementSelectionSPI |
getStatementSelectionSvc() |
ThreadingService |
getThreadingService() |
String |
getURI()
Returns the runtime URI, or "default" if this is the default runtime.
|
com.espertech.esper.common.client.variable.EPVariableService |
getVariableService()
Returns the variable service, for reading and writing variables
|
void |
initialize()
Frees any resources associated with this runtime instance, and leaves the runtime instance
ready for further use.
|
void |
initialize(Long currentTime) |
boolean |
isDestroyed()
Returns true if the runtime is in destroyed state, or false if not.
|
com.espertech.esper.common.internal.event.bean.core.BeanEventType |
makeBeanAnonymousType(Class clazz) |
void |
postInitialize()
Invoked after an initialize operation.
|
void |
removeAllRuntimeStateListeners()
Remove all listeners to runtime state changes.
|
boolean |
removeRuntimeStateListener(EPRuntimeStateListener listener)
Removate a listener to runtime state changes.
|
void |
setConfiguration(com.espertech.esper.common.client.configuration.Configuration configuration)
Sets runtime configuration information for use in the next initialize.
|
void |
traverseStatements(BiConsumer<EPDeployment,EPStatement> consumer) |
public EPRuntimeImpl(com.espertech.esper.common.client.configuration.Configuration configuration, String runtimeURI, Map<String,EPRuntimeSPI> runtimes) throws com.espertech.esper.common.client.configuration.ConfigurationException
configuration
- is the runtimeconfigurationruntimeURI
- is the runtime URI or "default" (or null which it assumes as "default") if this is the default providerruntimes
- map of URI and runtimecom.espertech.esper.common.client.configuration.ConfigurationException
- is thrown to indicate a configuraton errorpublic void postInitialize()
postInitialize
in interface EPRuntimeSPI
public void setConfiguration(com.espertech.esper.common.client.configuration.Configuration configuration)
setConfiguration
in interface EPRuntimeSPI
configuration
- is the runtimeconfigspublic String getURI()
EPRuntime
public EPEventService getEventService()
EPRuntime
getEventService
in interface EPRuntime
public EPDeploymentService getDeploymentService()
EPRuntime
getDeploymentService
in interface EPRuntime
public EPServicesContext getServicesContext()
getServicesContext
in interface EPRuntimeSPI
public com.espertech.esper.common.client.configuration.Configuration getConfigurationDeepCopy()
EPRuntime
Note: This can be an expensive operation.
getConfigurationDeepCopy
in interface EPRuntime
public Map<String,Object> getConfigurationTransient()
EPRuntime
getConfigurationTransient
in interface EPRuntime
public void destroy()
EPRuntime
Releases any resources held by the runtime. The runtime enteres a state in which operations provided by the runtime are not guaranteed to operate properly.
Removes the runtime URI from the known URIs. Allows configuration to change for the instance.
When destroying a runtime your application must make sure that threads that are sending events into the runtime have completed their work. More generally, the runtime should not be currently in use during or after the destroy operation.
public boolean isDestroyed()
EPRuntime
isDestroyed
in interface EPRuntime
public void initialize()
EPRuntime
Do not use the EPDeploymentService
administrative and EPEventService
runtime instances obtained before the
initialize (including related services such as configuration, module management, etc.).
Your application must obtain new administrative and runtime instances.
Retains the existing configuration of the runtime instance but forgets any runtime configuration changes.
Stops and destroys any existing statement resources such as filters, patterns, expressions, views.
initialize
in interface EPRuntime
public void initialize(Long currentTime)
initialize
in interface EPRuntimeSPI
protected void doInitialize(Long startTime)
startTime
- optional start timepublic Context getContext()
EPRuntime
An extension point designed for use by input and output adapters as well as other extension services.
getContext
in interface EPRuntime
public ReadWriteLock getRuntimeInstanceWideLock()
EPRuntime
EPDeploymentService.deploy(EPCompiled)
and EPDeploymentService.undeploy(String)
methods take a write lock.getRuntimeInstanceWideLock
in interface EPRuntime
public AtomicBoolean getServiceStatusProvider()
getServiceStatusProvider
in interface EPRuntimeSPI
public void addRuntimeStateListener(EPRuntimeStateListener listener)
EPRuntime
addRuntimeStateListener
in interface EPRuntime
listener
- to addpublic boolean removeRuntimeStateListener(EPRuntimeStateListener listener)
EPRuntime
removeRuntimeStateListener
in interface EPRuntime
listener
- to removepublic EPEventServiceSPI getEventServiceSPI()
getEventServiceSPI
in interface EPRuntimeSPI
public void removeAllRuntimeStateListeners()
EPRuntime
removeAllRuntimeStateListeners
in interface EPRuntime
public com.espertech.esper.common.client.dataflow.core.EPDataFlowService getDataFlowService()
EPRuntime
getDataFlowService
in interface EPRuntime
public com.espertech.esper.common.client.context.EPContextPartitionService getContextPartitionService()
EPRuntime
getContextPartitionService
in interface EPRuntime
public com.espertech.esper.common.client.variable.EPVariableService getVariableService()
EPRuntime
getVariableService
in interface EPRuntime
public com.espertech.esper.common.client.metric.EPMetricsService getMetricsService()
EPRuntime
getMetricsService
in interface EPRuntime
public EPEventTypeService getEventTypeService()
EPRuntime
getEventTypeService
in interface EPRuntime
public com.espertech.esper.common.client.render.EPRenderEventService getRenderEventService()
EPRuntime
getRenderEventService
in interface EPRuntime
public EPFireAndForgetService getFireAndForgetService()
EPRuntime
getFireAndForgetService
in interface EPRuntime
public ThreadingService getThreadingService()
getThreadingService
in interface EPRuntimeSPI
public com.espertech.esper.common.client.EPCompilerPathable getRuntimePath()
EPRuntime
getRuntimePath
in interface EPRuntime
public void traverseStatements(BiConsumer<EPDeployment,EPStatement> consumer)
traverseStatements
in interface EPRuntimeSPI
public EPRuntimeStatementSelectionSPI getStatementSelectionSvc()
getStatementSelectionSvc
in interface EPRuntimeSPI
public EPRuntimeCompileReflectiveSPI getReflectiveCompileSvc()
getReflectiveCompileSvc
in interface EPRuntimeSPI
public com.espertech.esper.common.internal.event.bean.core.BeanEventType makeBeanAnonymousType(Class clazz)
Copyright © 2005–2019. All rights reserved.