/** * Returns an existing runtime. Returns null if the runtime for the given URI has not been initialized * or the runtime for the given URI is in destroyed state. * * @param uri - the URI. If null provided it assumes "default". * @return Runtime for the given URI. */ public static EPRuntime getExistingRuntime(String uri) { String runtimeURINonNull = (uri == null) ? EPRuntimeProvider.DEFAULT_RUNTIME_URI : uri; EPRuntimeSPI runtime = runtimes.get(runtimeURINonNull); if (runtime == null || runtime.isDestroyed()) { return null; } return runtime; }
/** * Returns a runtime for a given URI. * Use the URI of "default" or null to return the default runtime. * * @param uri - the runtime URI. If null provided it assumes "default". * @param configuration is the configuration for the runtime * @return Runtime for the given URI. * @throws ConfigurationException to indicate a configuration problem */ public static EPRuntime getRuntime(String uri, Configuration configuration) throws ConfigurationException { String runtimeURINonNull = (uri == null) ? EPRuntimeProvider.DEFAULT_RUNTIME_URI : uri; if (runtimes.containsKey(runtimeURINonNull)) { EPRuntimeSPI runtime = runtimes.get(runtimeURINonNull); if (runtime.isDestroyed()) { runtime = getRuntimeInternal(configuration, runtimeURINonNull); runtimes.put(runtimeURINonNull, runtime); } else { runtime.setConfiguration(configuration); } return runtime; } // New runtime EPRuntimeSPI runtime = getRuntimeInternal(configuration, runtimeURINonNull); runtimes.put(runtimeURINonNull, runtime); runtime.postInitialize(); return runtime; }
public EPDeployment deploy(EPCompiled compiled, DeploymentOptions options) throws EPDeployException { if (runtime.isDestroyed()) { throw new EPRuntimeDestroyedException(runtime.getURI());