public class EPServiceProviderImpl extends Object implements EPServiceProviderSPI
DEFAULT_ENGINE_URI, DEFAULT_ENGINE_URI_QUALIFIER
Constructor and Description |
---|
EPServiceProviderImpl(Configuration configuration,
String engineURI,
Map<String,EPServiceProviderSPI> runtimes)
Constructor - initializes services.
|
Modifier and Type | Method and Description |
---|---|
void |
addServiceStateListener(EPServiceStateListener listener)
Add a listener to service provider state changes that receives a before-destroy event.
|
void |
addStatementStateListener(EPStatementStateListener listener)
Add a listener to statement state changes that receives statement-level events.
|
void |
destroy()
Destroys the service.
|
protected void |
doInitialize(Long startTime)
Performs the initialization.
|
ConfigurationInformation |
getConfigurationInformation()
Returns the current configuration.
|
Context |
getContext()
Returns the engine environment context for engine-external resources such as adapters.
|
ContextManagementService |
getContextManagementService() |
DeploymentStateService |
getDeploymentStateService() |
EngineEnvContext |
getEngineEnvContext()
Returns engine environment context such as plugin loader references.
|
EngineImportService |
getEngineImportService()
Returns engine imports.
|
ReadWriteLock |
getEngineInstanceWideLock()
Returns the engine-instance global read-write lock.
|
EPAdministrator |
getEPAdministrator()
Returns a class instance of EPAdministrator.
|
EPRuntime |
getEPRuntime()
Returns a class instance of EPRuntime.
|
EPServiceProviderIsolated |
getEPServiceIsolated(String name)
Returns the isolated service provider for that name,
creating an isolated service if the name is a new name, or
returning an existing isolated service for an existing name.
|
String[] |
getEPServiceIsolatedNames()
Returns the names of isolated service providers currently allocated.
|
EventAdapterService |
getEventAdapterService()
Get the EventAdapterService for this engine.
|
EngineLevelExtensionServicesContext |
getExtensionServicesContext()
Returns the extension services context.
|
FilterService |
getFilterService()
Returns the filter service.
|
MetricReportingService |
getMetricReportingService()
Returns metrics reporting.
|
NamedWindowMgmtService |
getNamedWindowMgmtService()
Returns the named window service.
|
SchedulingMgmtService |
getSchedulingMgmtService()
Get the SchedulingMgmtService for this engine.
|
SchedulingService |
getSchedulingService()
Get the SchedulingService for this engine.
|
EPServicesContext |
getServicesContext()
Returns services.
|
StatementContextFactory |
getStatementContextFactory()
Returns context factory.
|
StatementEventTypeRef |
getStatementEventTypeRef()
Returns statement event type reference service.
|
StatementIsolationService |
getStatementIsolationService() |
StatementLifecycleSvc |
getStatementLifecycleSvc()
Returns statement management service for the engine.
|
TableService |
getTableService()
Returns the table service.
|
ThreadingService |
getThreadingService()
Returns threading service for the engine.
|
TimeProvider |
getTimeProvider()
Returns time provider.
|
TimerService |
getTimerService()
Returns the timer service.
|
String |
getURI()
Returns the provider URI, or "default" if this is the default provider.
|
ValueAddEventService |
getValueAddEventService()
Returns value-added type service.
|
VariableService |
getVariableService()
Returns variable services.
|
void |
initialize()
Frees any resources associated with this engine instance, and leaves the engine instance
ready for further use.
|
void |
initialize(Long currentTime) |
boolean |
isDestroyed()
Returns true if the service is in destroyed state, or false if not.
|
void |
postInitialize()
Invoked after an initialize operation.
|
void |
removeAllServiceStateListeners()
Remove all listeners to service provider state changes.
|
void |
removeAllStatementStateListeners()
Remove all listeners to statement state changes.
|
boolean |
removeServiceStateListener(EPServiceStateListener listener)
Removate a listener to service provider state changes.
|
boolean |
removeStatementStateListener(EPStatementStateListener listener)
Removate a listener to statement state changes.
|
void |
setConfiguration(Configuration configuration)
Sets engine configuration information for use in the next initialize.
|
public EPServiceProviderImpl(Configuration configuration, String engineURI, Map<String,EPServiceProviderSPI> runtimes) throws ConfigurationException
configuration
- is the engine configurationengineURI
- is the engine URI or "default" (or null which it assumes as "default") if this is the default providerruntimes
- map of URI and runtimeConfigurationException
- is thrown to indicate a configuraton errorpublic EPServiceProviderIsolated getEPServiceIsolated(String name)
EPServiceProvider
Note: Requires configuration setting.
getEPServiceIsolated
in interface EPServiceProvider
name
- to return isolated service forpublic void postInitialize()
postInitialize
in interface EPServiceProviderSPI
public void setConfiguration(Configuration configuration)
setConfiguration
in interface EPServiceProviderSPI
configuration
- is the engine configspublic String getURI()
EPServiceProvider
getURI
in interface EPServiceProvider
public EPRuntime getEPRuntime()
EPServiceProvider
If the engine instance is destroyed, the behavior is undefined and a NullPointerException is possible.
getEPRuntime
in interface EPServiceProvider
public EPAdministrator getEPAdministrator()
EPServiceProvider
If the engine instance is destroyed, the behavior is undefined and a NullPointerException is possible.
getEPAdministrator
in interface EPServiceProvider
public EPServicesContext getServicesContext()
EPServiceProviderSPI
getServicesContext
in interface EPServiceProviderSPI
public ThreadingService getThreadingService()
EPServiceProviderSPI
getThreadingService
in interface EPServiceProviderSPI
public EventAdapterService getEventAdapterService()
EPServiceProviderSPI
getEventAdapterService
in interface EPServiceProviderSPI
public SchedulingService getSchedulingService()
EPServiceProviderSPI
getSchedulingService
in interface EPServiceProviderSPI
public FilterService getFilterService()
EPServiceProviderSPI
getFilterService
in interface EPServiceProviderSPI
public TimerService getTimerService()
EPServiceProviderSPI
getTimerService
in interface EPServiceProviderSPI
public ConfigurationInformation getConfigurationInformation()
EPServiceProviderSPI
getConfigurationInformation
in interface EPServiceProviderSPI
public NamedWindowMgmtService getNamedWindowMgmtService()
EPServiceProviderSPI
getNamedWindowMgmtService
in interface EPServiceProviderSPI
public TableService getTableService()
EPServiceProviderSPI
getTableService
in interface EPServiceProviderSPI
public EngineLevelExtensionServicesContext getExtensionServicesContext()
EPServiceProviderSPI
getExtensionServicesContext
in interface EPServiceProviderSPI
public StatementLifecycleSvc getStatementLifecycleSvc()
EPServiceProviderSPI
getStatementLifecycleSvc
in interface EPServiceProviderSPI
public MetricReportingService getMetricReportingService()
EPServiceProviderSPI
getMetricReportingService
in interface EPServiceProviderSPI
public ValueAddEventService getValueAddEventService()
EPServiceProviderSPI
getValueAddEventService
in interface EPServiceProviderSPI
public StatementEventTypeRef getStatementEventTypeRef()
EPServiceProviderSPI
getStatementEventTypeRef
in interface EPServiceProviderSPI
public EngineEnvContext getEngineEnvContext()
EPServiceProviderSPI
getEngineEnvContext
in interface EPServiceProviderSPI
public Context getContext()
EPServiceProviderSPI
getContext
in interface EPServiceProvider
getContext
in interface EPServiceProviderSPI
public StatementContextFactory getStatementContextFactory()
EPServiceProviderSPI
getStatementContextFactory
in interface EPServiceProviderSPI
public StatementIsolationService getStatementIsolationService()
getStatementIsolationService
in interface EPServiceProviderSPI
public DeploymentStateService getDeploymentStateService()
getDeploymentStateService
in interface EPServiceProviderSPI
public void destroy()
EPServiceProvider
Releases any resources held by the service. The service enteres a state in which operations provided by administrative and runtime interfaces originiated by the service are not guaranteed to operate properly.
Removes the service URI from the known URIs. Allows configuration to change for the instance.
When destroying a service instance your application must make sure that threads that are sending events into the service have completed their work. More generally, the service should not be currently in use during or after the destroy operation.
destroy
in interface EPServiceProvider
public boolean isDestroyed()
EPServiceProvider
isDestroyed
in interface EPServiceProvider
public void initialize()
EPServiceProvider
Do not use the EPAdministrator
administrative and EPRuntime
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 engine instance but forgets any runtime configuration changes.
Stops and destroys any existing statement resources such as filters, patterns, expressions, views.
initialize
in interface EPServiceProvider
public void initialize(Long currentTime)
initialize
in interface EPServiceProviderSPI
protected void doInitialize(Long startTime)
startTime
- optional start timepublic void addServiceStateListener(EPServiceStateListener listener)
EPServiceProvider
addServiceStateListener
in interface EPServiceProvider
listener
- to addpublic boolean removeServiceStateListener(EPServiceStateListener listener)
EPServiceProvider
removeServiceStateListener
in interface EPServiceProvider
listener
- to removepublic void removeAllServiceStateListeners()
EPServiceProvider
removeAllServiceStateListeners
in interface EPServiceProvider
public void addStatementStateListener(EPStatementStateListener listener)
EPServiceProvider
addStatementStateListener
in interface EPServiceProvider
listener
- to addpublic boolean removeStatementStateListener(EPStatementStateListener listener)
EPServiceProvider
removeStatementStateListener
in interface EPServiceProvider
listener
- to removepublic void removeAllStatementStateListeners()
EPServiceProvider
removeAllStatementStateListeners
in interface EPServiceProvider
public String[] getEPServiceIsolatedNames()
EPServiceProvider
getEPServiceIsolatedNames
in interface EPServiceProvider
public SchedulingMgmtService getSchedulingMgmtService()
EPServiceProviderSPI
getSchedulingMgmtService
in interface EPServiceProviderSPI
public EngineImportService getEngineImportService()
EPServiceProviderSPI
getEngineImportService
in interface EPServiceProviderSPI
public TimeProvider getTimeProvider()
EPServiceProviderSPI
getTimeProvider
in interface EPServiceProviderSPI
public VariableService getVariableService()
EPServiceProviderSPI
getVariableService
in interface EPServiceProviderSPI
public ContextManagementService getContextManagementService()
getContextManagementService
in interface EPServiceProviderSPI
public ReadWriteLock getEngineInstanceWideLock()
EPServiceProvider
EPRuntime.sendEvent(java.lang.Object)
method takes a read lock.
The EPAdministrator.createEPL(java.lang.String)
methods take a write lock.getEngineInstanceWideLock
in interface EPServiceProvider