Class EPCompilerImpl

java.lang.Object
com.espertech.esper.compiler.internal.util.EPCompilerImpl
All Implemented Interfaces:
EPCompiler, EPCompilerSPI

public class EPCompilerImpl extends Object implements EPCompilerSPI
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.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 stmtText, com.espertech.esper.common.client.configuration.Configuration configuration)
    Parse the single-statement EPL and return a statement object model.
    expressionCompiler(com.espertech.esper.common.client.configuration.Configuration configuration)
     
    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
    Read the module by reading the text file and return the module.
    com.espertech.esper.common.client.module.Module
    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
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EPCompilerImpl

      public EPCompilerImpl()
  • Method Details

    • compileQuery

      public com.espertech.esper.common.client.EPCompiled compileQuery(String fireAndForgetEPLQuery, CompilerArguments arguments) throws EPCompileException
      Description copied from interface: EPCompiler
      Compiles a single fire-and-forget query for execution by the runtime.
      Specified by:
      compileQuery in interface EPCompiler
      Parameters:
      fireAndForgetEPLQuery - fire-and-forget query to compile
      arguments - compiler arguments
      Returns:
      byte code
      Throws:
      EPCompileException - when the compilation failed
    • compileQuery

      public com.espertech.esper.common.client.EPCompiled compileQuery(com.espertech.esper.common.client.soda.EPStatementObjectModel fireAndForgetEPLQueryModel, CompilerArguments arguments) throws EPCompileException
      Description copied from interface: EPCompiler
      Compiles fire-and-forget query object model for execution by the runtime.
      Specified by:
      compileQuery in interface EPCompiler
      Parameters:
      fireAndForgetEPLQueryModel - fire-and-forget query to compile
      arguments - compiler arguments
      Returns:
      byte code
      Throws:
      EPCompileException - when the compilation failed
    • compile

      public com.espertech.esper.common.client.EPCompiled compile(String epl, CompilerArguments arguments) throws EPCompileException
      Description copied from interface: EPCompiler
      Compiles EPL and returns the byte code for deployment into a runtime.

      Use semicolon(;) to separate multiple statements in a module.

      Specified by:
      compile in interface EPCompiler
      Parameters:
      epl - epl to compile
      arguments - compiler arguments
      Returns:
      byte code
      Throws:
      EPCompileException - when the compilation failed
    • expressionCompiler

      public EPCompilerSPIExpression expressionCompiler(com.espertech.esper.common.client.configuration.Configuration configuration) throws EPCompileException
      Specified by:
      expressionCompiler in interface EPCompilerSPI
      Throws:
      EPCompileException
    • eplToModel

      public com.espertech.esper.common.client.soda.EPStatementObjectModel eplToModel(String stmtText, com.espertech.esper.common.client.configuration.Configuration configuration) throws EPCompileException
      Description copied from interface: EPCompiler
      Parse the single-statement EPL and return a statement object model.
      Specified by:
      eplToModel in interface EPCompiler
      Parameters:
      stmtText - to parse
      configuration - a configuration object when available
      Returns:
      statement object model
      Throws:
      EPCompileException - when the EPL could not be parsed
    • parseModule

      public com.espertech.esper.common.client.module.Module parseModule(String eplModuleText) throws IOException, com.espertech.esper.common.client.module.ParseException
      Description copied from interface: EPCompiler
      Parse the module text returning the module object model.
      Specified by:
      parseModule in interface EPCompiler
      Parameters:
      eplModuleText - to parse
      Returns:
      module object model
      Throws:
      IOException - when the parser failed
      com.espertech.esper.common.client.module.ParseException - when parsing of the module failed
    • compile

      public com.espertech.esper.common.client.EPCompiled compile(com.espertech.esper.common.client.module.Module module, CompilerArguments arguments) throws EPCompileException
      Description copied from interface: EPCompiler
      Compiles a module object model and returns the byte code for deployment into a runtime.
      Specified by:
      compile in interface EPCompiler
      Parameters:
      module - module object to compile
      arguments - compiler arguments
      Returns:
      byte code
      Throws:
      EPCompileException - when the compilation failed
    • readModule

      public com.espertech.esper.common.client.module.Module readModule(InputStream stream, String uri) throws IOException, com.espertech.esper.common.client.module.ParseException
      Description copied from interface: EPCompiler
      Read the input stream and return the module. It is up to the calling method to close the stream when done.
      Specified by:
      readModule in interface EPCompiler
      Parameters:
      stream - to read
      uri - uri of the module
      Returns:
      module module
      Throws:
      IOException - when the io operation failed
      com.espertech.esper.common.client.module.ParseException - when parsing of the module failed
    • readModule

      public com.espertech.esper.common.client.module.Module readModule(File file) throws IOException, com.espertech.esper.common.client.module.ParseException
      Description copied from interface: EPCompiler
      Read the module by reading the text file and return the module.
      Specified by:
      readModule in interface EPCompiler
      Parameters:
      file - the file to read
      Returns:
      module
      Throws:
      IOException - when the file could not be read
      com.espertech.esper.common.client.module.ParseException - when parsing of the module failed
    • readModule

      public com.espertech.esper.common.client.module.Module readModule(URL url) throws IOException, com.espertech.esper.common.client.module.ParseException
      Description copied from interface: EPCompiler
      Read the module by reading from the URL provided and return the module.
      Specified by:
      readModule in interface EPCompiler
      Parameters:
      url - the URL to read
      Returns:
      module
      Throws:
      IOException - when the url input stream could not be read
      com.espertech.esper.common.client.module.ParseException - when parsing of the module failed
    • readModule

      public com.espertech.esper.common.client.module.Module readModule(String resource, ClassLoader classLoader) throws IOException, com.espertech.esper.common.client.module.ParseException
      Description copied from interface: EPCompiler
      Read the resource by opening from classpath and return the module.
      Specified by:
      readModule in interface EPCompiler
      Parameters:
      resource - name of the classpath resource
      classLoader - classloader
      Returns:
      module module
      Throws:
      IOException - when the resource could not be read
      com.espertech.esper.common.client.module.ParseException - when parsing of the module failed
    • syntaxValidate

      public void syntaxValidate(com.espertech.esper.common.client.module.Module module, CompilerArguments arguments) throws EPCompileException
      Description copied from interface: EPCompiler
      Validate the syntax of the module.
      Specified by:
      syntaxValidate in interface EPCompiler
      Parameters:
      module - to validate
      arguments - compiler arguments
      Throws:
      EPCompileException - when the EPL could not be parsed