public EPServicesContext getServicesContext() { if (runtimeEnvironment == null) { throw new EPRuntimeDestroyedException(runtimeURI); } return runtimeEnvironment.getServices(); }
public EPRenderEventService getRenderEventService() { if (runtimeEnvironment == null) { throw new EPRuntimeDestroyedException(runtimeURI); } return runtimeEnvironment.getServices().getEventRenderer(); }
public ThreadingService getThreadingService() { if (runtimeEnvironment == null) { throw new EPRuntimeDestroyedException(runtimeURI); } return runtimeEnvironment.getServices().getThreadingService(); }
public Context getContext() { if (runtimeEnvironment == null) { throw new EPRuntimeDestroyedException(runtimeURI); } return runtimeEnvironment.getServices().getRuntimeEnvContext(); }
public EPDataFlowService getDataFlowService() { if (runtimeEnvironment == null) { throw new EPRuntimeDestroyedException(runtimeURI); } return runtimeEnvironment.getServices().getDataflowService(); }
public ReadWriteLock getRuntimeInstanceWideLock() { if (runtimeEnvironment == null) { throw new EPRuntimeDestroyedException(runtimeURI); } return runtimeEnvironment.getServices().getEventProcessingRWLock().getLock(); }
/** * Invoked after an initialize operation. */ public void postInitialize() { // plugin-loaders List<ConfigurationRuntimePluginLoader> pluginLoaders = runtimeEnvironment.getServices().getConfigSnapshot().getRuntime().getPluginLoaders(); // in the order configured for (ConfigurationRuntimePluginLoader config : pluginLoaders) { try { PluginLoader plugin = (PluginLoader) runtimeEnvironment.getServices().getRuntimeEnvContext().lookup("plugin-loader/" + config.getLoaderName()); plugin.postInitialize(); } catch (Throwable t) { String message = "Error post-initializing plugin class " + config.getClassName() + ": " + t.getMessage(); log.error(message, t); throw new EPException(message, t); } } }
destroyEngineMetrics(runtimeEnvironment.getServices().getRuntimeURI()); runtimeToDestroy.getServices().getTimerService().stopInternalClock(false); List<ConfigurationRuntimePluginLoader> pluginLoaders = runtimeToDestroy.getServices().getConfigSnapshot().getRuntime().getPluginLoaders(); if (!pluginLoaders.isEmpty()) { List<ConfigurationRuntimePluginLoader> reversed = new ArrayList<ConfigurationRuntimePluginLoader>(pluginLoaders); PluginLoader plugin; try { plugin = (PluginLoader) runtimeToDestroy.getServices().getRuntimeEnvContext().lookup("plugin-loader/" + config.getLoaderName()); plugin.destroy(); } catch (NamingException e) { runtimeToDestroy.getServices().getThreadingService().destroy(); runtimeToDestroy.getServices().destroy(); runtimes.remove(runtimeURI); runtimeToDestroy.getServices().initialize();
public EPCompilerPathable getRuntimePath() { EPServicesContext services = runtimeEnvironment.getServices(); VariableRepositoryPreconfigured variables = new VariableRepositoryPreconfigured(); for (Map.Entry<String, VariableDeployment> entry : services.getVariableManagementService().getDeploymentsWithVariables().entrySet()) { for (Map.Entry<String, Variable> variableEntry : entry.getValue().getVariables().entrySet()) { if (variableEntry.getValue().getMetaData().isPreconfigured()) { variables.addVariable(variableEntry.getKey(), variableEntry.getValue().getMetaData()); } } } EventTypeRepositoryImpl eventTypes = new EventTypeRepositoryImpl(true); for (Map.Entry<String, EventType> entry : services.getEventTypeRepositoryBus().getNameToTypeMap().entrySet()) { if (entry.getValue().getMetadata().getAccessModifier() == NameAccessModifier.PRECONFIGURED) { eventTypes.addType(entry.getValue()); } } return new EPCompilerPathableImpl( services.getVariablePathRegistry().copy(), services.getEventTypePathRegistry().copy(), services.getExprDeclaredPathRegistry().copy(), services.getNamedWindowPathRegistry().copy(), services.getTablePathRegistry().copy(), services.getContextPathRegistry().copy(), services.getScriptPathRegistry().copy(), eventTypes, variables); }
runtimeEnvironment.getServices().getTimerService().stopInternalClock(false); destroyEngineMetrics(runtimeEnvironment.getServices().getRuntimeURI()); runtimeEnvironment.getServices().destroy();