Packages

object JavaApi

API interface for accessing the TeSSLa compiler from other Java or Scala projects. This API is optimized for a comfortable use from Java and Scala code.

Usage example (in Java):

import de.uni_luebeck.isp.tessla.interpreter.JavaApi;
import de.uni_luebeck.isp.tessla.interpreter.JavaApi.*;
import de.uni_luebeck.isp.tessla.interpreter.StreamEngine;

class Main {

    public static void main(String[] args) {

         String spec_str = "in temperature: Events[Int]\r\n" +
         "\r\n" +
         "def low = temperature < 3\r\n" +
         "def high = temperature > 8\r\n" +
         "def unsafe = low || high\r\n" +
         "\r\n" +
         "out unsafe";


         System.out.println("Compiling...");

         Engine res = JavaApi.compile(spec_str ,"spec.tessla").engine();

         System.out.println("Ready!");

         res.addListener(new EngineListener(){
           public void event(String stream, scala.math.BigInt time, Object value) {
             System.out.println("Got: " + stream + " = " + value + " at " + time);
           }

           public void printEvent(scala.math.BigInt time, Object value) {
             System.out.println("Raw output: " + value + " at " + time);
           }
         });

         res.setTime(1);
         res.provide("temperature",2);
         res.setTime(2);
         res.provide("temperature",15);
         res.setTime(5);
         res.provide("temperature",8);
         res.step();

         System.out.println("Finished!");

     }

 }

Note: This API internally uses the TeSSLa interpreter. For high performance applications it is advisable to use the TeSSLa compiler to generate a Scala API directly for a specific specification.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JavaApi
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. case class CompilationResult(result: Result, engine: Engine) extends Product with Serializable

    Container for the result of the compilation of a TeSSLa specification.

    Container for the result of the compilation of a TeSSLa specification.

    result

    Object containing the errors and warnings which occurred during compilation

    engine

    Monitor generated from the specification (can be used to receive input streams and generate output streams)

  2. case class Diagnostic(diagnostic: core.Diagnostic) extends Product with Serializable

    Diagnostic object, carrying information about errors and warnings which occur during compilation and execution.

    Diagnostic object, carrying information about errors and warnings which occur during compilation and execution.

    diagnostic

    The Diagnostic object from the core API used to generate the Diagnostic object

  3. case class Engine(spec: Interpreter) extends Product with Serializable

    Class for a TeSSLa monitor.

    Class for a TeSSLa monitor.

    Intended usage is not to directly instantiate an Engine but to use the compile function instead. See usage example of JavaApi for details.

    An Engine object can be used to receive events from input streams (see provide) and to attach listeners for output streams (see addListener)

    spec

    The interpreter of the base specification

  4. abstract class EngineListener extends AnyRef

    Abstract interface of a Listener which can be attached to an Engine to observe the outputs generated there.

    Abstract interface of a Listener which can be attached to an Engine to observe the outputs generated there. Use Engine.addListener to attach a Listener to an engine.

  5. case class Result(warnings: List[Diagnostic], errors: List[Diagnostic]) extends Product with Serializable

    Container class for errors and warnings that occurred during compilation of a TeSSLa specification.

    Container class for errors and warnings that occurred during compilation of a TeSSLa specification.

    warnings

    Warnings which occurred during compilation

    errors

    Errors which occurred during compilation

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. def compile(tessla: String, fileName: String, baseTime: String): CompilationResult

    Compiles a TeSSLa specification, i.e.

    Compiles a TeSSLa specification, i.e. generates a monitor which can then be used to receive an input trace and generate an output trace. This variant of the function requires a base time unit to be set, which is necessary if the TeSSLa specification itself uses time units (like ns, ms, s).

    tessla

    The TeSSLa code to be compiled/executed.

    fileName

    The name of the TeSSLa file (does not really have to exist in the filesystem but is used, e.g. in error messages.

    returns

    Object containing information about errors/warnings during compilation and an engine which can be used for monitoring.

  7. def compile(tessla: String, fileName: String): CompilationResult

    Compiles a TeSSLa specification, i.e.

    Compiles a TeSSLa specification, i.e. generates a monitor which can then be used to receive an input trace and generate an output trace.

    tessla

    The TeSSLa code to be compiled/executed.

    fileName

    The name of the TeSSLa file (does not really have to exist in the filesystem but is used, e.g. in error messages.

    returns

    Object containing information about errors/warnings during compilation and an engine which can be used for monitoring.

  8. def compile(specSource: CharStream, compilerOptions: Options): CompilationResult

    Compiles a TeSSLa specification, i.e.

    Compiles a TeSSLa specification, i.e. generates a monitor which can then be used to receive an input trace and generate an output trace. This variant of the function requires compiler options to handle the fine tuning of the compiler and a CharStream for the input.

    specSource

    The TeSSLa specification source as a char stream.

    compilerOptions

    The options for the compiler. See the corresponding documentation of Compiler.Options for details.

    returns

    Object containing information about errors/warnings during compilation and an engine which can be used for monitoring.

  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  17. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  18. def toString(): String
    Definition Classes
    AnyRef → Any
  19. def verify(tessla: String, fileName: String, timeUnit: String): Result

    Checks a TeSSLa specification for sound compilation.

    Checks a TeSSLa specification for sound compilation. I.e. checks for Errors/Warnings in the code. This variant of the function requires a base time unit to be set, which is necessary if the TeSSLa specification itself uses time units (like ns, ms, s).

    tessla

    The TeSSLa code to be verified.

    fileName

    The name of the TeSSLa file (does not really have to exist in the filesystem but is used, e.g. in error messages.

    timeUnit

    The base time unit. I.e. the unit of the input timestamps, Equal to the --base-time flag of the TeSSLa binary. Possible valid values are e.g. 1ns, 25ms, 1s etc.

    returns

    Object containing information about errors and warnings during compilation.

  20. def verify(tessla: String, fileName: String): Result

    Checks a TeSSLa specification for sound compilation.

    Checks a TeSSLa specification for sound compilation. I.e. checks for Errors/Warnings in the code.

    tessla

    The TeSSLa code to be verified.

    fileName

    The name of the TeSSLa file (does not really have to exist in the filesystem but is used, e.g. in error messages.

    returns

    Object containing information about errors and warnings during compilation.

  21. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  22. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  23. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped