Esempio n. 1
0
        private void CheckManifest(
            int rolloutItemNumber,
            EPCompiledManifest manifest)
        {
            try {
                RuntimeVersion.CheckVersion(manifest.CompilerVersion);
            }
            catch (RuntimeVersion.VersionException ex) {
                throw new EPDeployDeploymentVersionException(ex.Message, ex, rolloutItemNumber);
            }

            if (manifest.ModuleProviderClassName == null)
            {
                if (manifest.QueryProviderClassName != null)
                {
                    throw new EPDeployException(
                              "Cannot deploy EPL that was compiled as a fire-and-forget query, make sure to use the 'compile' method of the compiler",
                              rolloutItemNumber);
                }

                throw new EPDeployException("Failed to find module provider class name in manifest (is this a compiled module?)", rolloutItemNumber);
            }

            try {
                _services.EventSerdeFactory.VerifyHADeployment(manifest.IsTargetHA);
            }
            catch (ExprValidationException ex) {
                throw new EPDeployException(ex.Message, ex, rolloutItemNumber);
            }
        }
        protected internal static EPCompiled Compile(
            IList<Compilable> compilables,
            string optionalModuleName,
            IDictionary<ModuleProperty, object> moduleProperties,
            ModuleCompileTimeServices compileTimeServices,
            CompilerOptions compilerOptions)
        {
            ICollection<Assembly> assemblies = new HashSet<Assembly>();
            
            try {
                EPCompiledManifest manifest = CompileToModules(
                    assemblies,
                    compilables,
                    optionalModuleName,
                    moduleProperties,
                    compileTimeServices,
                    compilerOptions,
                    out var assembly);

                return new EPCompiled(assemblies, manifest);
            }
            catch (EPCompileException) {
                throw;
            }
            catch (Exception ex) {
                throw new EPCompileException(
                    "Unexpected exception compiling module: " + ex.Message,
                    ex,
                    new EmptyList<EPCompileExceptionItem>());
            }
        }