Interface EPCompiler
- All Known Subinterfaces:
EPCompilerSPI
- All Known Implementing Classes:
EPCompilerImpl
public interface EPCompiler
The EPL compiler compiles EPL text as well as object models to byte code.
-
Method Summary
Modifier and TypeMethodDescriptioncom.espertech.esper.common.client.EPCompiled
compile
(com.espertech.esper.common.client.module.Module module, CompilerArguments arguments) Compiles a module object model and returns the byte code for deployment into a runtime.com.espertech.esper.common.client.EPCompiled
compile
(String epl, CompilerArguments arguments) Compiles EPL and returns the byte code for deployment into a runtime.com.espertech.esper.common.client.EPCompiled
compileQuery
(com.espertech.esper.common.client.soda.EPStatementObjectModel fireAndForgetEPLQueryModel, CompilerArguments arguments) Compiles fire-and-forget query object model for execution by the runtime.com.espertech.esper.common.client.EPCompiled
compileQuery
(String fireAndForgetEPLQuery, CompilerArguments arguments) Compiles a single fire-and-forget query for execution by the runtime.com.espertech.esper.common.client.soda.EPStatementObjectModel
eplToModel
(String epl, com.espertech.esper.common.client.configuration.Configuration configuration) Parse the single-statement EPL and return a statement object model.com.espertech.esper.common.client.module.Module
parseModule
(String eplModuleText) Parse the module text returning the module object model.com.espertech.esper.common.client.module.Module
readModule
(File file) Read the module by reading the text file and return the module.com.espertech.esper.common.client.module.Module
readModule
(InputStream stream, String moduleUri) Read the input stream and return the module.com.espertech.esper.common.client.module.Module
readModule
(String resource, ClassLoader classLoader) Read the resource by opening from classpath and return the module.com.espertech.esper.common.client.module.Module
readModule
(URL url) Read the module by reading from the URL provided and return the module.void
syntaxValidate
(com.espertech.esper.common.client.module.Module module, CompilerArguments arguments) Validate the syntax of the module.
-
Method Details
-
compile
com.espertech.esper.common.client.EPCompiled compile(String epl, CompilerArguments arguments) throws EPCompileException Compiles EPL and returns the byte code for deployment into a runtime.Use semicolon(;) to separate multiple statements in a module.
- Parameters:
epl
- epl to compilearguments
- compiler arguments- Returns:
- byte code
- Throws:
EPCompileException
- when the compilation failed
-
compile
com.espertech.esper.common.client.EPCompiled compile(com.espertech.esper.common.client.module.Module module, CompilerArguments arguments) throws EPCompileException Compiles a module object model and returns the byte code for deployment into a runtime.- Parameters:
module
- module object to compilearguments
- compiler arguments- Returns:
- byte code
- Throws:
EPCompileException
- when the compilation failed
-
compileQuery
com.espertech.esper.common.client.EPCompiled compileQuery(String fireAndForgetEPLQuery, CompilerArguments arguments) throws EPCompileException Compiles a single fire-and-forget query for execution by the runtime.- Parameters:
fireAndForgetEPLQuery
- fire-and-forget query to compilearguments
- compiler arguments- Returns:
- byte code
- Throws:
EPCompileException
- when the compilation failed
-
compileQuery
com.espertech.esper.common.client.EPCompiled compileQuery(com.espertech.esper.common.client.soda.EPStatementObjectModel fireAndForgetEPLQueryModel, CompilerArguments arguments) throws EPCompileException Compiles fire-and-forget query object model for execution by the runtime.- Parameters:
fireAndForgetEPLQueryModel
- fire-and-forget query to compilearguments
- compiler arguments- Returns:
- byte code
- Throws:
EPCompileException
- when the compilation failed
-
parseModule
com.espertech.esper.common.client.module.Module parseModule(String eplModuleText) throws IOException, com.espertech.esper.common.client.module.ParseException Parse the module text returning the module object model.- Parameters:
eplModuleText
- to parse- Returns:
- module object model
- Throws:
IOException
- when the parser failedcom.espertech.esper.common.client.module.ParseException
- when parsing of the module failed
-
eplToModel
com.espertech.esper.common.client.soda.EPStatementObjectModel eplToModel(String epl, com.espertech.esper.common.client.configuration.Configuration configuration) throws EPCompileException Parse the single-statement EPL and return a statement object model.- Parameters:
epl
- to parseconfiguration
- a configuration object when available- Returns:
- statement object model
- Throws:
EPCompileException
- when the EPL could not be parsed
-
syntaxValidate
void syntaxValidate(com.espertech.esper.common.client.module.Module module, CompilerArguments arguments) throws EPCompileException Validate the syntax of the module.- Parameters:
module
- to validatearguments
- compiler arguments- Throws:
EPCompileException
- when the EPL could not be parsed
-
readModule
com.espertech.esper.common.client.module.Module readModule(InputStream stream, String moduleUri) throws IOException, com.espertech.esper.common.client.module.ParseException Read the input stream and return the module. It is up to the calling method to close the stream when done.- Parameters:
stream
- to readmoduleUri
- uri of the module- Returns:
- module module
- Throws:
IOException
- when the io operation failedcom.espertech.esper.common.client.module.ParseException
- when parsing of the module failed
-
readModule
com.espertech.esper.common.client.module.Module readModule(String resource, ClassLoader classLoader) throws IOException, com.espertech.esper.common.client.module.ParseException Read the resource by opening from classpath and return the module.- Parameters:
resource
- name of the classpath resourceclassLoader
- classloader- Returns:
- module module
- Throws:
IOException
- when the resource could not be readcom.espertech.esper.common.client.module.ParseException
- when parsing of the module failed
-
readModule
com.espertech.esper.common.client.module.Module readModule(File file) throws IOException, com.espertech.esper.common.client.module.ParseException Read the module by reading the text file and return the module.- Parameters:
file
- the file to read- Returns:
- module
- Throws:
IOException
- when the file could not be readcom.espertech.esper.common.client.module.ParseException
- when parsing of the module failed
-
readModule
com.espertech.esper.common.client.module.Module readModule(URL url) throws IOException, com.espertech.esper.common.client.module.ParseException Read the module by reading from the URL provided and return the module.- Parameters:
url
- the URL to read- Returns:
- module
- Throws:
IOException
- when the url input stream could not be readcom.espertech.esper.common.client.module.ParseException
- when parsing of the module failed
-